/* style.css */

:root {
    color-scheme: light;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --surface-border: #e2e8f0;
    --card-bg-light: #ffffff;
    --surface-subtle: #f8fafc;
    --surface-muted: #f1f5f9;
    --text: #1e293b;
    --text-main: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --app-bg: #f4f7f6;
    --border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #d5dbdb;
    --input-text: #2c3e50;
    --focus-ring: #2563eb;
    --link: #2563eb;

    /* Semantic Status Color Pairs (Light Theme) */
    --info-bg: #eff6ff;
    --info-fg: #1e40af;
    --success-bg: #f0fdf4;
    --success-fg: #15803d;
    --warning-bg: #fef3c7;
    --warning-fg: #92400e;
    --danger-bg: #fef2f2;
    --danger-fg: #991b1b;

    /* WCAG AA (>= 4.5:1 with white text) Solid Badge Colors */
    --badge-blue-bg: #2563eb;
    --badge-green-bg: #15803d;
    --badge-amber-bg: #b45309;
    --badge-orange-bg: #c2410c;
    --badge-teal-bg: #047857;
    --badge-red-bg: #b91c1c;

    /* 8-Point Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* 4-Tier Border Radius Scale */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-full: 9999px;
}

html.dark-mode, body.dark-mode {
    color-scheme: dark;
    --surface: #1e1e1e;
    --surface-2: #252b36;
    --surface-3: #2d3443;
    --surface-border: #3a4255;
    --card-bg-light: #1e1e1e;
    --surface-subtle: #121824;
    --surface-muted: #1e293b;
    --text: #f1f5f9;
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --app-bg: #121212;
    --border: #3a4255;
    --input-bg: #243044;
    --input-border: #334155;
    --input-text: #f8fafc;
    --focus-ring: #60a5fa;
    --link: #60a5fa;

    /* Semantic Status Color Pairs (Dark Theme) */
    --info-bg: #172554;
    --info-fg: #93c5fd;
    --success-bg: #052e16;
    --success-fg: #86efac;
    --warning-bg: #342811;
    --warning-fg: #fcd34d;
    --danger-bg: #3b0d0d;
    --danger-fg: #fca5a5;

    /* WCAG AA Solid Badge Colors */
    --badge-blue-bg: #1d4ed8;
    --badge-green-bg: #166534;
    --badge-amber-bg: #92400e;
    --badge-orange-bg: #9a3412;
    --badge-teal-bg: #065f46;
    --badge-red-bg: #991b1b;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    background-color: #f4f7f6;
    margin: 0;
    padding: 20px;
    color: #333;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c3e50;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card {
    background: white;
    border-radius: var(--radius-lg, 10px);
    padding: var(--space-5, 20px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: var(--space-5, 20px);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-full {
    grid-column: span 2;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
}

input[type="checkbox"], input[type="radio"] {
    width: auto;
    padding: 0;
    flex-shrink: 0;
}

input[type="tel"] {
    text-align: center;
    max-width: 160px;
}

.btn {
    padding: var(--space-2, 8px) var(--space-4, 16px);
    border: none;
    border-radius: var(--radius-md, 6px);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.88em;
    color: white;
    transition: background 0.2s, box-shadow 0.2s;
    line-height: 1.3;
}

.btn-sm {
    padding: var(--space-1, 4px) var(--space-2, 8px) !important;
    font-size: 0.8em !important;
    border-radius: var(--radius-sm, 4px) !important;
}

.btn-lg {
    padding: var(--space-3, 12px) var(--space-5, 20px) !important;
    font-size: 0.95em !important;
    border-radius: var(--radius-lg, 10px) !important;
}

.btn-primary { background-color: #3498db; }
.btn-primary:hover { background-color: #2980b9; }

.btn-secondary { background-color: #64748b; color: #ffffff; border: 1px solid #475569; }
.btn-secondary:hover { background-color: #475569; color: #ffffff; }

.btn-success { background-color: #2ecc71; }
.btn-success:hover { background-color: #27ae60; }

.btn-warning { background-color: #f1c40f; color: #333; }
.btn-warning:hover { background-color: #f39c12; }

.btn-danger { background-color: #e74c3c; }
.btn-danger:hover { background-color: #c0392b; }

.btn-info { background-color: #9b59b6; }
.btn-info:hover { background-color: #8e44ad; }

.btn-lang { background-color: #ecf0f1; color: #2c3e50; border: 1px solid #bdc3c7; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Noto Color Emoji'; }
.btn-lang:hover { background-color: #bdc3c7; }

.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
    color: #7f8c8d;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
}

.tab-btn.active {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Collapsible Desktop Task Item Styling */
.task-item {
    background: #ecf0f1;
    border-left: 5px solid #bdc3c7;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.task-item summary {
    padding: 15px;
    cursor: pointer;
    outline: none;
    list-style: none; /* Hide default arrow */
}

.task-item summary::-webkit-details-marker {
    display: none;
}

.task-item[open] summary {
    display: none;
}

.task-item .task-details-content {
    padding: 0 15px 15px 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.task-item[open] .task-details-content {
    border-top: none;
    margin-top: 0 !important;
    padding-top: 15px !important;
}

.pri-Urgent { border-left-color: #e74c3c; background-color: #fadbd8; }
.pri-High { border-left-color: #e67e22; background-color: #fdebd0; }
.pri-Medium { border-left-color: #f1c40f; background-color: #fcf3cf; }
.pri-Low { border-left-color: #3498db; background-color: #ebf5fb; }
.pri-None { border-left-color: #bdc3c7; }
.pri-Declined { border-left-color: #c0392b; background-color: #f2d7d5; opacity: 0.8; }

.task-item.completed {
    opacity: 0.7;
    background-color: #eaeded !important;
    border-left-color: #95a5a6 !important;
    animation: none !important;
    box-shadow: none !important;
}

.audit-stamp {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-top: 8px;
    font-style: italic;
}

.modal-bg, .modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.scrollbox {
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    background: white;
    display: flex;
    flex-direction: column;
}

.scrollbox-header {
    padding: 8px;
    background: #ecf0f1;
    border-bottom: 1px solid #bdc3c7;
    text-align: right;
}

.scrollbox-content {
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
}

.scrollbox-content label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: normal;
}
.scrollbox-content label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.purchase-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.purchase-table th {
    background-color: #34495e;
    color: white;
    padding: 10px;
    text-align: left;
}
.purchase-table td {
    padding: 10px;
    border-bottom: 1px solid #edf2f7;
    cursor: pointer;
}
.purchase-table tr:hover td {
    background-color: #f8f9fa;
}
.purch-item-name {
    font-weight: bold;
    color: #2c3e50;
}
.purch-pri-indicator {
    width: 6px;
    height: 100%;
    display: inline-block;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

.purch-stat-default { background-color: #fdf2e9; }
.purch-stat-pending { background-color: #fef5e7; }
.purch-stat-approved { background-color: #ebf5fb; }
.purch-stat-purchased { background-color: #e8f8f5; }
.purch-stat-canceled { background-color: #fadbd8; }

.purch-modal-title { color: #2c3e50; }
.purch-section-title { color: #2c3e50; }
.purch-qty-badge { background-color: #2c3e50; color: white; }

.purch-detail-box { background-color: white; border: 1px solid #edf2f7; padding: 12px; border-radius: 6px; }
.purch-wo-box { background-color: #f8f9fa; border: 1px solid #bdc3c7; padding: 15px; border-radius: 6px; margin-bottom: 20px; }
.purch-wo-box-text { color: #2c3e50; }
.purch-notes-box { background-color: white; padding: 12px; border-radius: 6px; border: 1px solid #edf2f7; color: #2c3e50; white-space: pre-wrap; }

.modal-header-bg { background-color: #ecf0f1; border-bottom: 2px solid #bdc3c7; }
.modal-footer-bg { background-color: #f9f9f9; border-top: 1px solid #bdc3c7; }

.vertical-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.vertical-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

/* Calendar Event Overrides */
.fc-event { border: none !important; background: transparent !important; margin-bottom: 2px; }
.fc-event-content-wrapper { 
    display: block; 
    white-space: normal; 
    overflow-wrap: break-word; 
    color: #000 !important;
    border-left: 4px solid transparent;
    border-radius: 4px;
}
.fc-dayGridMonth-view .fc-daygrid-day-frame { aspect-ratio: 1 / 1; }
.cal-event-Urgent { background-color: #fadbd8 !important; border-left-color: #e74c3c !important; }
.cal-event-High { background-color: #fdebd0 !important; border-left-color: #e67e22 !important; }
.cal-event-Medium { background-color: #fcf3cf !important; border-left-color: #f1c40f !important; }
.cal-event-Low { background-color: #ebf5fb !important; border-left-color: #3498db !important; }
.cal-event-None { background-color: #ffffff !important; border-left-color: #bdc3c7 !important; }
.cal-event-completed { background-color: #f2f4f4 !important; border-left-color: #bdc3c7 !important; text-decoration: none !important; opacity: 0.6 !important; color: inherit !important; }
.cal-event-overdue { animation: flash-urgent 1.5s infinite; }

.attachment-thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.attachment-thumbnail {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    border: 1px solid #bdc3c7;
    background-size: cover;
    background-position: center;
}
.attachment-thumbnail .btn-remove-thumb {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #e74c3c;
    color: white;
    border: none;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.flash-tab,
.tab-btn.flash-tab,
.nav-item.flash-tab {
    animation: pulse-tab 1.5s infinite !important;
    font-weight: bold !important;
}

@keyframes pulse-tab {
    0% { color: #e74c3c; background-color: transparent; }
    50% { color: #fff; background-color: #e74c3c; text-shadow: 0 0 5px rgba(255, 255, 255, 0.8); }
    100% { color: #e74c3c; background-color: transparent; }
}

@keyframes flash-urgent {
    0% { box-shadow: 0 0 5px rgba(231, 76, 60, 0.2); }
    50% { box-shadow: 0 0 15px rgba(231, 76, 60, 0.9); }
    100% { box-shadow: 0 0 5px rgba(231, 76, 60, 0.2); }
}

.pulse-tab-slow {
    animation: pulse-tab 6s infinite ease-in-out;
}

.tab-amber,
.tab-btn.tab-amber {
    background-color: #f39c12 !important;
    color: white !important;
}

.nav-item.tab-amber {
    background-color: #fef3c7 !important;
    color: #d97706 !important;
}

.nav-item.tab-amber .nav-label,
.nav-item.tab-amber .nav-icon {
    color: #d97706 !important;
}

body.dark-mode .tab-amber,
body.dark-mode .tab-btn.tab-amber {
    background-color: #d68910 !important;
    color: white !important;
}

body.dark-mode .nav-item.tab-amber {
    background-color: #78350f !important;
    color: #fde68a !important;
}

.pri-Urgent { 
    border-left-color: #e74c3c; 
    background-color: #fadbd8; 
    animation: flash-urgent 1.5s infinite;
}

.translated-tag {
    background: #9b59b6;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    margin-right: 5px;
}

.btn-filter {
    background-color: #ecf0f1;
    color: #7f8c8d;
    border: 1px solid #bdc3c7;
}
.btn-filter.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

.add-tech-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.add-tech-chk-container {
    width: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.add-tech-name {
    flex-grow: 1;
    word-break: break-word;
}
.add-tech-row input[type="checkbox"] {
    margin: 0;
    width: auto;
}

.notif-item {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.88em;
    cursor: pointer;
    transition: background 0.2s;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    position: relative;
}
.notif-item:hover { background-color: #f4f6f6; }
.notif-item:last-child { border-bottom: none; }
.notif-item.urgent { border-left: 4px solid #e74c3c; }
.notif-item.approval { border-left: 4px solid #f39c12; }
.notif-item.success { border-left: 4px solid #2ecc71; }
.notif-item.info { border-left: 4px solid #3498db; }
.notif-item.unread { font-weight: 600; background-color: rgba(52, 152, 219, 0.05); }

.notif-content {
    flex: 1;
    min-width: 0;
}
.notif-msg {
    display: block;
    margin-top: 2px;
    color: #4b5563;
    font-weight: normal;
    word-break: break-word;
}
.notif-time {
    display: block;
    font-size: 0.78em;
    color: #94a3b8;
    margin-top: 4px;
}
.notif-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s;
    flex-shrink: 0;
}
.notif-close-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}
.notif-mark-all-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}
.notif-mark-all-btn:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* Dark Mode rules for Notification Center */
body.dark-mode #notifDropdown,
body.dark-mode #notifList {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
body.dark-mode .notif-item {
    color: #f1f5f9;
    border-bottom-color: #334155;
    background-color: #1e293b;
}
body.dark-mode .notif-item:hover {
    background-color: #273548;
}
body.dark-mode .notif-item.unread {
    background-color: rgba(56, 189, 248, 0.1);
}
body.dark-mode .notif-msg {
    color: #cbd5e1;
}
body.dark-mode .notif-time {
    color: #64748b;
}
body.dark-mode .notif-close-btn {
    color: #64748b;
}
body.dark-mode .notif-close-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
}

/* Dashboard Enterprise Metadata & Tabular Grids */
.task-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #edf2f7;
}

.meta-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.meta-value {
    font-size: 0.95rem;
    color: #2c3e50;
}

.tabular-data {
    font-variant-numeric: tabular-nums;
}

.hairline-border {
    border-top: 1px solid #edf2f7;
}

/* Ghost Buttons */
.btn-ghost-danger { background-color: transparent; border: 1px solid #e74c3c; color: #e74c3c; }
.btn-ghost-danger:hover { background-color: #e74c3c; color: white; }
.btn-ghost-warning { background-color: transparent; border: 1px solid #f39c12; color: #f39c12; }
.btn-ghost-warning:hover { background-color: #f39c12; color: white; }
.btn-ghost-info { background-color: transparent; border: 1px solid #3498db; color: #3498db; }
.btn-ghost-info:hover { background-color: #3498db; color: white; }

/* Desktop Compatibility for Night Mode */
body.dark-mode input[type="file"] { background-color: #243044 !important; color: #f8fafc !important; border: 1px solid #334155 !important; }

/* Desktop Dark Mode Theme */
body.dark-mode { background-color: #121212; color: #f1f5f9; }
body.dark-mode .task-item.completed { background-color: #2c2c2c !important; border-left-color: #444 !important; opacity: 0.6; }
body.dark-mode .card, body.dark-mode .header, body.dark-mode .scrollbox { background-color: #1e1e1e; border-color: #333; color: #f1f5f9; }
body.dark-mode .task-item { background-color: #1e1e1e; border-top: 1px solid #333; border-right: 1px solid #333; border-bottom: 1px solid #333; color: #f1f5f9; box-shadow: 0 0 5px #333; }
body.dark-mode .tab-btn { color: #aaa; }
body.dark-mode .tab-btn.active { color: #3498db; }
body.dark-mode .btn-lang { background-color: #243044 !important; color: #f8fafc !important; border-color: #334155 !important; }
body.dark-mode .btn-secondary, html.dark-mode .btn-secondary { background-color: #334155 !important; color: #f8fafc !important; border: 1px solid #475569 !important; }
body.dark-mode .btn-secondary:hover, html.dark-mode .btn-secondary:hover { background-color: #475569 !important; color: #ffffff !important; }
body.dark-mode .scrollbox-header { background-color: #333 !important; border-bottom-color: #444 !important; }
body.dark-mode table { background-color: #1e1e1e !important; color: #f1f5f9 !important; }
body.dark-mode .purchase-table { background-color: #1e1e1e; border-color: #333; }
body.dark-mode .purchase-table th { background-color: #333; color: #f8fafc; }
body.dark-mode .purchase-table td { border-bottom-color: #444; color: #f1f5f9; border-bottom: 1px solid #444; }
body.dark-mode .purchase-table tr:hover td { background-color: #2c2c2c; }
body.dark-mode .purch-item-name { color: #f1f5f9; }
body.dark-mode div[id^="metric"] { color: #f1f5f9 !important; }
body.dark-mode .purch-stat-default { background-color: #2c2c2c; }
body.dark-mode .purch-stat-pending { background-color: #3e2723; }
body.dark-mode .purch-stat-approved { background-color: #0d47a1; }
body.dark-mode .purch-stat-purchased { background-color: #004d40; }
body.dark-mode .purch-stat-canceled { background-color: #4a148c; }
body.dark-mode .purch-modal-title { color: #f8fafc !important; }
body.dark-mode .purch-section-title { color: #f8fafc !important; }
body.dark-mode .purch-qty-badge { background-color: #444 !important; color: #f8fafc !important; }
body.dark-mode .purch-detail-box { background-color: #2c2c2c; border-color: #444; }
body.dark-mode .purch-wo-box { background-color: #2c2c2c; border-color: #444; }
body.dark-mode .purch-wo-box-text { color: #f1f5f9; }
body.dark-mode .purch-notes-box { background-color: #2c2c2c; border-color: #444; color: #f1f5f9; }
body.dark-mode .modal-header-bg { background-color: #2c2c2c; border-bottom-color: #444; }
body.dark-mode .modal-footer-bg { background-color: #1e1e1e; border-top-color: #444; }
body.dark-mode #calendarContainer { background: #1e1e1e !important; border-color: #444 !important; }
body.dark-mode select#mobMyStatsType { color: #f8fafc !important; }
body.dark-mode .meta-label { color: #94a3b8; }
body.dark-mode .meta-value { color: #f1f5f9; }
body.dark-mode .hairline-border { border-top-color: #444 !important; }
body.dark-mode .task-meta-grid { border-top-color: #444; }
body.dark-mode .btn-ghost-danger { border-color: #e74c3c; color: #e74c3c; }
body.dark-mode .btn-ghost-danger:hover { background-color: #e74c3c; color: white; }
body.dark-mode .btn-ghost-warning { border-color: #f39c12; color: #f39c12; }
body.dark-mode .btn-ghost-warning:hover { background-color: #f39c12; color: white; }
body.dark-mode .btn-ghost-info { border-color: #3498db; color: #3498db; }
body.dark-mode .btn-ghost-info:hover { background-color: #3498db; color: white; }

/* --- Comprehensive Semantic Surfaces & Add-on Container Overrides --- */
body.dark-mode #userFormContainer,
body.dark-mode .grid-item,
body.dark-mode #sysMgmtUnlock,
body.dark-mode details[style*="background: white"],
body.dark-mode details[style*="background:white"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background-color: #ffffff"],
body.dark-mode [style*="background-color:#ffffff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background-color: #f8fafc"],
body.dark-mode [style*="background-color:#f8fafc"],
body.dark-mode [style*="background: #f1f5f9"],
body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background-color: #f1f5f9"],
body.dark-mode [style*="background-color:#f1f5f9"],
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background:#f8f9fa"],
body.dark-mode [style*="background: #fafafa"],
body.dark-mode [style*="background:#fafafa"],
body.dark-mode [style*="background-color: #fafafa"],
body.dark-mode [style*="background-color:#fafafa"],
body.dark-mode [style*="background: #f9f9f9"],
body.dark-mode [style*="background:#f9f9f9"],
body.dark-mode [style*="background: #ecf0f1"],
body.dark-mode [style*="background:#ecf0f1"],
body.dark-mode [style*="background: #f2f4f4"],
body.dark-mode [style*="background:#f2f4f4"],
body.dark-mode [style*="background: #f4f6f6"],
body.dark-mode [style*="background:#f4f6f6"] {
    background-color: #1e1e1e !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body.dark-mode summary[style*="background: #ecf0f1"],
body.dark-mode summary[style*="background:#ecf0f1"],
body.dark-mode summary[style*="background: #e8f8f5"],
body.dark-mode summary[style*="background:#e8f8f5"] {
    background-color: #243044 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

/* Contextual Banners & Alerts (High-Contrast Tints in Dark Mode) */
body.dark-mode [style*="background: #eaf2f8"],
body.dark-mode [style*="background:#eaf2f8"],
body.dark-mode [style*="background: #eff6ff"],
body.dark-mode [style*="background:#eff6ff"],
body.dark-mode [style*="background-color: #eff6ff"],
body.dark-mode [style*="background-color:#eff6ff"],
body.dark-mode [style*="background: #e0f2fe"],
body.dark-mode [style*="background:#e0f2fe"],
body.dark-mode [style*="background-color: #e0f2fe"],
body.dark-mode [style*="background-color:#e0f2fe"],
body.dark-mode [style*="background: #dbeafe"],
body.dark-mode [style*="background:#dbeafe"],
body.dark-mode [style*="background: #e8f4fd"],
body.dark-mode [style*="background:#e8f4fd"],
body.dark-mode [style*="background: #f4f9fd"],
body.dark-mode [style*="background:#f4f9fd"] {
    background-color: #172554 !important;
    color: #93c5fd !important;
    border-color: #1e40af !important;
}

body.dark-mode [style*="background: #e8f8f5"],
body.dark-mode [style*="background:#e8f8f5"],
body.dark-mode [style*="background: #f0fdf4"],
body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background-color: #f0fdf4"],
body.dark-mode [style*="background-color:#f0fdf4"],
body.dark-mode [style*="background: #ecfdf5"],
body.dark-mode [style*="background:#ecfdf5"],
body.dark-mode [style*="background: #d4efdf"],
body.dark-mode [style*="background:#d4efdf"],
body.dark-mode [style*="background: #dcfce7"],
body.dark-mode [style*="background:#dcfce7"] {
    background-color: #052e16 !important;
    border-color: #15803d !important;
    color: #86efac !important;
}

body.dark-mode [style*="background: #fef9e7"],
body.dark-mode [style*="background:#fef9e7"],
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background:#fef3c7"],
body.dark-mode [style*="background-color: #fef3c7"],
body.dark-mode [style*="background-color:#fef3c7"],
body.dark-mode [style*="background: #fefce8"],
body.dark-mode [style*="background:#fefce8"],
body.dark-mode [style*="background: #fdf2e9"],
body.dark-mode [style*="background:#fdf2e9"],
body.dark-mode [style*="background: #fffbeb"],
body.dark-mode [style*="background:#fffbeb"],
body.dark-mode [style*="background: #fff7ed"],
body.dark-mode [style*="background:#fff7ed"],
body.dark-mode [style*="background-color: #fcf3cf"],
body.dark-mode [style*="background-color:#fcf3cf"] {
    background-color: #342811 !important;
    border-color: #b45309 !important;
    color: #fcd34d !important;
}

body.dark-mode [style*="background: #fadbd8"],
body.dark-mode [style*="background:#fadbd8"],
body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fee2e2"],
body.dark-mode [style*="background-color: #fee2e2"],
body.dark-mode [style*="background-color:#fee2e2"],
body.dark-mode [style*="background: #fef2f2"],
body.dark-mode [style*="background:#fef2f2"],
body.dark-mode [style*="background-color: #fef2f2"],
body.dark-mode [style*="background-color:#fef2f2"],
body.dark-mode [style*="background: #fff1f2"],
body.dark-mode [style*="background:#fff1f2"] {
    background-color: #3b0d0d !important;
    border-color: #b91c1c !important;
    color: #fca5a5 !important;
}

/* --- High-Contrast Typography & Inversion --- */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .lbl-perm-admin,
body.dark-mode .lbl-perm-tech {
    color: #f8fafc !important;
}

body.dark-mode strong,
body.dark-mode b {
    color: inherit;
}

body.dark-mode .card label,
body.dark-mode form label,
body.dark-mode .modal-content label {
    color: #f8fafc;
}

body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #2c3e50"],
body.dark-mode [style*="color:#2c3e50"],
body.dark-mode [style*="color: #0f172a"],
body.dark-mode [style*="color:#0f172a"],
body.dark-mode [style*="color: #333333"],
body.dark-mode [style*="color:#333333"],
body.dark-mode [style*="color: #333"],
body.dark-mode [style*="color:#333"],
body.dark-mode [style*="color: #000"],
body.dark-mode [style*="color:#000"],
body.dark-mode [style*="color: black"],
body.dark-mode [style*="color:black"] {
    color: #f8fafc !important;
}

body.dark-mode [style*="color: #334155"],
body.dark-mode [style*="color:#334155"],
body.dark-mode [style*="color: #475569"],
body.dark-mode [style*="color:#475569"],
body.dark-mode [style*="color: #34495e"],
body.dark-mode [style*="color:#34495e"] {
    color: #cbd5e1 !important;
}

body.dark-mode [style*="color: #64748b"],
body.dark-mode [style*="color:#64748b"],
body.dark-mode [style*="color: #5d6d7e"],
body.dark-mode [style*="color:#5d6d7e"],
body.dark-mode [style*="color: #7f8c8d"],
body.dark-mode [style*="color:#7f8c8d"] {
    color: #94a3b8 !important;
}

body.dark-mode [style*="color: #1f618d"],
body.dark-mode [style*="color:#1f618d"],
body.dark-mode [style*="color: #2980b9"],
body.dark-mode [style*="color:#2980b9"],
body.dark-mode [style*="color: #1e40af"],
body.dark-mode [style*="color:#1e40af"],
body.dark-mode [style*="color: #0369a1"],
body.dark-mode [style*="color:#0369a1"] {
    color: #93c5fd !important;
}

body.dark-mode [style*="color: #166534"],
body.dark-mode [style*="color:#166534"] {
    color: #86efac !important;
}

body.dark-mode [style*="color: #92400e"],
body.dark-mode [style*="color:#92400e"] {
    color: #fcd34d !important;
}

body.dark-mode [style*="color: #991b1b"],
body.dark-mode [style*="color:#991b1b"],
body.dark-mode [style*="color: #c0392b"],
body.dark-mode [style*="color:#c0392b"] {
    color: #fca5a5 !important;
}

/* Form Inputs, Selects & Textareas */
body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
html.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body.dark-mode select,
html.dark-mode select,
body.dark-mode textarea,
html.dark-mode textarea {
    background-color: var(--input-bg, #243044) !important;
    color: var(--input-text, #f8fafc) !important;
    border: 1px solid var(--input-border, #334155) !important;
}

body.dark-mode option,
html.dark-mode option {
    background-color: var(--input-bg, #243044) !important;
    color: var(--input-text, #f8fafc) !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder,
html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: var(--text-muted, #94a3b8) !important;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

:focus-visible {
    outline: 2px solid var(--focus-ring, #2563eb) !important;
    outline-offset: 2px !important;
}

/* --- Light-Only Islands (WYSIWYG print previews, sticker previews, ID badges) --- */
.theme-light-island,
.theme-light-island [style*="background"],
.theme-light-island [style*="color"],
.theme-light-island table,
.theme-light-island tr,
.theme-light-island td,
.theme-light-island th,
.theme-light-island div,
.theme-light-island span,
.theme-light-island p {
    color-scheme: light !important;
}
.theme-light-island {
    background-color: #ffffff !important;
    color: #0f172a !important;
}
body.dark-mode .theme-light-island,
html.dark-mode .theme-light-island {
    background-color: #ffffff !important;
    color: #0f172a !important;
}
body.dark-mode .theme-light-island [style*="color: #0f172a"],
body.dark-mode .theme-light-island [style*="color:#0f172a"],
body.dark-mode .theme-light-island [style*="color: #0F172A"],
body.dark-mode .theme-light-island [style*="color:#0F172A"],
html.dark-mode .theme-light-island [style*="color: #0f172a"],
html.dark-mode .theme-light-island [style*="color:#0f172a"],
html.dark-mode .theme-light-island [style*="color: #0F172A"],
html.dark-mode .theme-light-island [style*="color:#0F172A"] {
    color: #0f172a !important;
}
body.dark-mode .theme-light-island [style*="color: #334155"],
body.dark-mode .theme-light-island [style*="color:#334155"],
body.dark-mode .theme-light-island [style*="color: #334155"],
body.dark-mode .theme-light-island [style*="color:#334155"],
html.dark-mode .theme-light-island [style*="color: #334155"],
html.dark-mode .theme-light-island [style*="color:#334155"] {
    color: #334155 !important;
}
body.dark-mode .theme-light-island [style*="color: #475569"],
body.dark-mode .theme-light-island [style*="color:#475569"],
html.dark-mode .theme-light-island [style*="color: #475569"],
html.dark-mode .theme-light-island [style*="color:#475569"] {
    color: #475569 !important;
}
body.dark-mode .theme-light-island [style*="background: white"],
body.dark-mode .theme-light-island [style*="background:white"],
body.dark-mode .theme-light-island [style*="background: #ffffff"],
body.dark-mode .theme-light-island [style*="background:#ffffff"],
body.dark-mode .theme-light-island [style*="background: #FFFFFF"],
body.dark-mode .theme-light-island [style*="background:#FFFFFF"],
body.dark-mode .theme-light-island [style*="background: #fff"],
body.dark-mode .theme-light-island [style*="background:#fff"] {
    background-color: #ffffff !important;
}

/* Interactive Workspaces & Canvases */
body.dark-mode #cpBadgeInteractiveCanvasesContainer,
body.dark-mode #soCampusMapStage,
body.dark-mode .canvas-wrapper {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

/* Table Headers, Alternating Rows & Borders */
body.dark-mode thead,
body.dark-mode thead tr,
body.dark-mode tr[style*="background: #f1f5f9"],
body.dark-mode tr[style*="background:#f1f5f9"],
body.dark-mode tr[style*="background: #f2f4f4"],
body.dark-mode tr[style*="background:#f2f4f4"],
body.dark-mode tr[style*="background: #ecf0f1"],
body.dark-mode tr[style*="background:#ecf0f1"] {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

body.dark-mode tr[style*="border-bottom: 1px solid #bdc3c7"],
body.dark-mode tr[style*="border-bottom:1px solid #bdc3c7"],
body.dark-mode tr[style*="border-bottom: 1px solid #e2e8f0"],
body.dark-mode tr[style*="border-bottom:1px solid #e2e8f0"],
body.dark-mode tr[style*="border-bottom: 1px solid #f2f4f4"],
body.dark-mode tr[style*="border-bottom:1px solid #f2f4f4"] {
    border-bottom: 1px solid #334155 !important;
}

body.dark-mode td code,
body.dark-mode p code,
body.dark-mode div code {
    background-color: #243044 !important;
    color: #93c5fd !important;
    border: 1px solid #334155 !important;
}

/* Specialized Add-ons Widgets */
body.dark-mode #ptdAlertRecipientCheckboxList,
body.dark-mode .ptd-recipient-picker-item {
    background-color: #1e1e1e !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
body.dark-mode .ptd-recipient-picker-item:hover {
    background-color: #243044 !important;
}
body.dark-mode #addonUserAdminPermsBox,
body.dark-mode #addonUserOpsPermsBox,
body.dark-mode #addonUserTechPermsBox {
    background-color: #162032 !important;
    border-color: #334155 !important;
}

/* Desktop Floating Action Buttons */
.fab-btn {
    position: fixed;
    bottom: clamp(20px, 4vh, 40px);
    right: clamp(20px, 4vw, 40px);
    width: clamp(100px, 10vw, 130px);
    height: clamp(100px, 10vw, 130px);
    background-color: #3498db;
    color: white;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(48px, 5vw, 72px);
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: none;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s, background-color 0.2s;
}
.fab-btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}
.fab-btn:active {
    transform: scale(0.95);
}
.fab-left {
    right: auto;
    left: clamp(20px, 4vw, 40px);
}

/* Utility Classes */
.btn-sm { padding: var(--space-1, 4px) var(--space-2, 8px); font-size: 0.8em; border-radius: var(--radius-sm, 4px); margin: 0; }
.btn-lg { padding: var(--space-3, 12px) var(--space-5, 20px); font-size: 0.95em; border-radius: var(--radius-lg, 10px); }
.controls-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }


/* PTDevices Primary Metrics & Status Footer */
.ptd-tank-card {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.ptd-dashboard-controls-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 10px;
}

.ptd-refresh-icon-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 2px 4px !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    line-height: 1 !important;
    cursor: pointer;
}

.ptd-summary-metric-item,
.ptd-primary-metric-card {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ptd-unified-tank-vessel {
    position: relative;
    border: 2.5px solid #5d6d7e !important;
    border-radius: 10px 10px 16px 16px !important;
    background: #ffffff;
    overflow: hidden;
}

.ptd-summary-metric-num {
    font-size: clamp(3.6rem, 5.2vw, 5.2rem) !important;
    font-weight: 400 !important;
    line-height: 1.02;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    text-align: center !important;
}

.ptd-primary-metric-num {
    font-size: clamp(4.2rem, 6vw, 6.2rem) !important;
    font-weight: 400 !important;
    line-height: 1.02;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    text-align: center !important;
}

.ptd-summary-metric-pct,
.ptd-primary-metric-pct,
.ptd-summary-metric-subrate,
.ptd-primary-metric-subrate {
    display: block !important;
    font-weight: 400 !important;
    text-align: center !important;
}

.ptd-status-footer {
    margin-top: 20px;
    padding: 10px 14px;
    border-top: 1px solid #e1e8ed;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.78em;
    color: #6c7a89;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.dark-mode .ptd-dashboard-controls-bar,
body.dark-mode .ptd-status-footer,
body.dark-mode .ptd-expanded-metadata-footer {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #95a5a6 !important;
}

body.dark-mode .ptd-unified-tank-vessel {
    background-color: #1e272e !important;
    border-color: #7f8c8d !important;
}

body.dark-mode .ptd-unified-tank-vessel .ptd-water-qty-text,
body.dark-mode .ptd-unified-tank-vessel .ptd-metric-label,
body.dark-mode .ptd-unified-tank-vessel .ptd-tank-supporting-details {
    color: #ecf0f1 !important;
}

@media (max-width: 768px) {
    .ptd-collapsed-layout {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    .ptd-collapsed-identity {
        justify-content: center !important;
        width: 100% !important;
    }
    .ptd-summary-metrics-group {
        width: 100%;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 18px !important;
    }
    .ptd-summary-metric-item {
        text-align: center !important;
        border-left: none !important;
        border-top: 1px solid #ecf0f1;
        padding-left: 0 !important;
        padding-top: 12px !important;
        width: 100% !important;
        flex: 1 1 100%;
    }
    .ptd-summary-metric-num {
        font-size: clamp(3.2rem, 13vw, 5.0rem) !important;
        font-weight: 400 !important;
        text-align: center !important;
    }
    .ptd-primary-metrics-grid {
        grid-template-columns: 1fr !important;
    }
    .ptd-primary-metric-card {
        text-align: center !important;
    }
    .ptd-primary-metric-card .ptd-usage-header-row {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    .ptd-primary-metric-num {
        font-size: clamp(3.4rem, 13.5vw, 5.2rem) !important;
        font-weight: 400 !important;
        text-align: center !important;
    }
    .ptd-summary-metric-pct,
    .ptd-primary-metric-pct {
        font-size: clamp(2.0rem, 7.6vw, 2.9rem) !important;
    }
}

/* =========================================================================
   PHASE 6 NAVIGATION REDESIGN — COLLAPSIBLE DESKTOP SIDEBAR & HOME LAUNCHER
   ========================================================================= */
/* appSection sidebar margin removed */

/* collapsed margin removed */

/* desktopTopNavContainer display handled cleanly */

.desk-sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

.launcher-app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1) !important;
    border-color: #93c5fd !important;
}

body.dark-mode .launcher-app-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

@media (max-width: 900px) {
    body.desk-sidebar-enabled #appSection,
    body.desk-sidebar-enabled.desk-sidebar-collapsed #appSection {
        margin-left: 68px;
    }
}


/* ============================================================================
   RESPONSIVE COMPACT DATA TABLES & DETAIL MODAL TOUCH STYLES
   ============================================================================ */
.mob-compact-table {
    width: 100%;
    border-collapse: collapse;
}

.mob-compact-table tbody tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mob-compact-table tbody tr.clickable-row:hover {
    background-color: #f8fafc;
}

.mob-compact-table tbody tr.clickable-row:active {
    background-color: #eff6ff !important;
}

body.dark-mode .mob-compact-table tbody tr.clickable-row:hover {
    background-color: #1e293b;
}

body.dark-mode .mob-compact-table tbody tr.clickable-row:active {
    background-color: #0f172a !important;
}

.mob-only-cell,
.mob-only-block,
.mob-only-inline,
.mob-only-flex {
    display: none !important;
}

/* Dark-mode overrides for Space Occupancy pastel cards & badges */
body.dark-mode [style*="background:#ebf5fb"],
body.dark-mode [style*="background: #ebf5fb"] {
    background-color: #0c2d48 !important;
    color: #bae6fd !important;
}
body.dark-mode [style*="background:#f5eef8"],
body.dark-mode [style*="background: #f5eef8"] {
    background-color: #2e1a47 !important;
    color: #e9d5ff !important;
}
body.dark-mode [style*="background:#fdedec"],
body.dark-mode [style*="background: #fdedec"] {
    background-color: #3b1219 !important;
    color: #fecaca !important;
}
body.dark-mode [style*="background:#f4fbf7"],
body.dark-mode [style*="background: #f4fbf7"] {
    background-color: #0f291e !important;
    color: #bbf7d0 !important;
}
body.dark-mode [style*="background:#f3e8ff"],
body.dark-mode [style*="background: #f3e8ff"] {
    background-color: #2e1a47 !important;
    color: #e9d5ff !important;
}
body.dark-mode [style*="background:#e2e8f0"],
body.dark-mode [style*="background: #e2e8f0"] {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}
body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background: #f0fdf4"] {
    background-color: #0f291e !important;
    border-color: #166534 !important;
    color: #bbf7d0 !important;
}
body.dark-mode [style*="background:#fefce8"],
body.dark-mode [style*="background: #fefce8"] {
    background-color: #2e2409 !important;
    border-color: #854d0e !important;
    color: #fef08a !important;
}
body.dark-mode [style*="background:#eff6ff"],
body.dark-mode [style*="background: #eff6ff"] {
    background-color: #172554 !important;
    border-color: #1d4ed8 !important;
    color: #bfdbfe !important;
}
body.dark-mode .mob-col-primary {
    color: #f1f5f9 !important;
}
body.dark-mode .mob-col-context {
    color: #94a3b8 !important;
}
body.dark-mode #tab-campus-presence [style*="color:#1e293b"],
body.dark-mode #tab-campus-presence [style*="color: #1e293b"],
body.dark-mode #tab-campus-presence [style*="color:#0f172a"],
body.dark-mode #tab-campus-presence [style*="color: #0f172a"],
body.dark-mode #tab-campus-presence [style*="color:#334155"],
body.dark-mode #tab-campus-presence [style*="color: #334155"] {
    color: #e2e8f0 !important;
}
body.dark-mode #tab-campus-presence [style*="color:#475569"],
body.dark-mode #tab-campus-presence [style*="color: #475569"],
body.dark-mode #tab-campus-presence [style*="color:#64748b"],
body.dark-mode #tab-campus-presence [style*="color: #64748b"] {
    color: #94a3b8 !important;
}

@media (max-width: 768px) {
    .dt-col-desktop {
        display: none !important;
    }

    .mob-only-cell {
        display: table-cell !important;
    }

    .mob-only-block {
        display: block !important;
    }

    .mob-only-inline {
        display: inline-block !important;
    }

    .mob-only-flex {
        display: flex !important;
    }

    .mob-compact-table tbody tr {
        min-height: 48px;
    }

    .mob-col-primary {
        padding: 8px 10px !important;
        font-weight: 600;
        color: #0f172a;
        vertical-align: middle;
    }

    .mob-col-context {
        padding: 8px 8px !important;
        font-size: 0.85em;
        color: #334155;
        vertical-align: middle;
    }

    .mob-col-action {
        padding: 8px 10px !important;
        text-align: right;
        vertical-align: middle;
        white-space: nowrap;
    }

    .mob-col-chevron {
        color: #94a3b8;
        font-size: 1.1em;
        font-weight: bold;
        margin-left: 4px;
        display: inline-block;
        vertical-align: middle;
    }
}

/* PTDevices Tank Dual-Layer Water Wave & Overflow Spill Animation */
@keyframes ptdWaveDriftLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes ptdWaveDriftRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

@keyframes ptdSpillCascade {
    0% { background-position: 0 0; }
    100% { background-position: 0 36px; }
}

@keyframes ptdSpillPulse {
    0%, 100% { opacity: 0.78; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.15); }
}

.ptd-water-wave-svg {
    position: absolute;
    left: 0;
    width: 200%;
    height: 18px;
    pointer-events: none;
    will-change: transform;
}

.ptd-water-wave-back {
    top: 1px;
    animation: ptdWaveDriftLeft 8.5s linear infinite;
}

.ptd-water-wave-front {
    top: 3px;
    animation: ptdWaveDriftRight 5.8s linear infinite;
}

.ptd-water-spill-lip {
    position: absolute;
    top: -5px;
    left: -2px;
    right: -2px;
    height: 10px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.72), rgba(125, 211, 252, 0.9), rgba(14, 165, 233, 0.75), rgba(125, 211, 252, 0.9), rgba(56, 189, 248, 0.72));
    border-radius: 6px;
    pointer-events: none;
    z-index: 2;
    animation: ptdSpillPulse 2.4s ease-in-out infinite;
}

.ptd-water-spill-stream {
    position: absolute;
    top: 0;
    bottom: -2px;
    width: 8px;
    pointer-events: none;
    z-index: 2;
    background-image: repeating-linear-gradient(
        180deg,
        rgba(56, 189, 248, 0.85) 0px,
        rgba(125, 211, 252, 0.55) 10px,
        rgba(14, 165, 233, 0.2) 18px,
        rgba(56, 189, 248, 0.85) 36px
    );
    background-size: 8px 36px;
    border-radius: 0 0 6px 6px;
    animation: ptdSpillCascade 1.15s linear infinite;
}

.ptd-water-spill-left {
    left: -5px;
}

.ptd-water-spill-right {
    right: -5px;
}

@keyframes ptdFillStreamFlow {
    0% { background-position: 0 0; }
    100% { background-position: 0 28px; }
}

@keyframes ptdFillBubbleRise {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { opacity: 0.65; }
    80% { opacity: 0.45; }
    100% { transform: translateY(-75px) scale(1.1); opacity: 0; }
}

.ptd-tank-is-filling .ptd-water-wave-back {
    animation-duration: 5.5s;
}

.ptd-tank-is-filling .ptd-water-wave-front {
    animation-duration: 3.8s;
}

.ptd-water-fill-stream {
    position: absolute;
    top: 0;
    left: 22%;
    width: 12px;
    border-radius: 0 0 6px 6px;
    pointer-events: none;
    z-index: 1;
    background-image: repeating-linear-gradient(
        180deg,
        rgba(14, 165, 233, 0.58) 0px,
        rgba(186, 230, 253, 0.82) 8px,
        rgba(56, 189, 248, 0.32) 18px,
        rgba(14, 165, 233, 0.58) 28px
    );
    background-size: 12px 28px;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
    animation: ptdFillStreamFlow 1.0s linear infinite;
}

@keyframes ptdSplashRing {
    0% { transform: translateX(-50%) scaleX(0.45) scaleY(0.65); opacity: 0.95; }
    60% { transform: translateX(-50%) scaleX(1.35) scaleY(1.05); opacity: 0.6; }
    100% { transform: translateX(-50%) scaleX(1.75) scaleY(0.85); opacity: 0; }
}

@keyframes ptdSplashDropLeft {
    0% { transform: translate(0, 0) scale(0.85); opacity: 0; }
    20% { opacity: 0.95; }
    100% { transform: translate(-22px, -22px) scale(0.55); opacity: 0; }
}

@keyframes ptdSplashDropRight {
    0% { transform: translate(0, 0) scale(0.85); opacity: 0; }
    20% { opacity: 0.95; }
    100% { transform: translate(22px, -22px) scale(0.55); opacity: 0; }
}

@keyframes ptdSplashDropMidLeft {
    0% { transform: translate(0, 0) scale(0.9); opacity: 0; }
    20% { opacity: 0.95; }
    100% { transform: translate(-10px, -27px) scale(0.55); opacity: 0; }
}

@keyframes ptdSplashDropMidRight {
    0% { transform: translate(0, 0) scale(0.9); opacity: 0; }
    20% { opacity: 0.95; }
    100% { transform: translate(10px, -27px) scale(0.55); opacity: 0; }
}

.ptd-water-fill-splash {
    position: absolute;
    top: -12px;
    left: calc(22% + 6px);
    transform: translateX(-50%);
    width: 56px;
    height: 28px;
    pointer-events: none;
    z-index: 2;
}

.ptd-water-splash-ring {
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 44px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid rgba(14, 165, 233, 0.85);
    background: rgba(125, 211, 252, 0.5);
    animation: ptdSplashRing 1.2s ease-out infinite;
}

.ptd-water-splash-ring-2 {
    animation-delay: 0.6s;
}

.ptd-water-splash-drop {
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.ptd-water-splash-drop-l1 { animation: ptdSplashDropLeft 1.0s ease-out infinite; }
.ptd-water-splash-drop-l2 { animation: ptdSplashDropMidLeft 1.25s ease-out 0.35s infinite; }
.ptd-water-splash-drop-r1 { animation: ptdSplashDropRight 1.05s ease-out 0.15s infinite; }
.ptd-water-splash-drop-r2 { animation: ptdSplashDropMidRight 1.3s ease-out 0.55s infinite; }

.ptd-water-fill-bubble {
    position: absolute;
    bottom: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(186, 230, 253, 0.8);
    pointer-events: none;
    animation: ptdFillBubbleRise 3.4s ease-in infinite;
}

@media (prefers-reduced-motion: reduce) {
    .ptd-water-wave-back,
    .ptd-water-wave-front,
    .ptd-water-spill-lip,
    .ptd-water-spill-stream,
    .ptd-water-fill-stream,
    .ptd-water-fill-bubble,
    .ptd-water-splash-ring,
    .ptd-water-splash-drop {
        animation: none !important;
    }
}

/* === MAPP LIVE TELEMETRY & UI ANIMATIONS START === */
@keyframes mappSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes mappPipeDash {
    from { stroke-dashoffset: 24; }
    to { stroke-dashoffset: 0; }
}

@keyframes mappBeaconPulse {
    0% { transform: scale(0.95); opacity: 0.85; }
    70% { transform: scale(2.1); opacity: 0; }
    100% { transform: scale(2.1); opacity: 0; }
}

@keyframes mappQrLaser {
    0% { top: 10%; opacity: 0.9; }
    50% { top: 86%; opacity: 1; }
    100% { top: 10%; opacity: 0.9; }
}

@keyframes mappTimerDash {
    0% { stroke-dashoffset: 38; }
    100% { stroke-dashoffset: 0; }
}

/* 1. PTDevices Pipe Flow */
.mapp-pipe-flow {
    stroke-dasharray: 5 3;
    animation: mappPipeDash 0.85s linear infinite;
}

/* 2. Active Work Order Gear & Ticking Timer Ring */
.mapp-gear-spin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    animation: mappSpin 3.2s linear infinite;
}

.mapp-timer-ring-arc {
    stroke-dasharray: 24 14;
    animation: mappTimerDash 1.8s linear infinite;
}

/* 3. Security Live Dot & QR Scanner Sweeping Laser */
.mapp-live-beacon {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    vertical-align: middle;
    margin-right: 5px;
    flex-shrink: 0;
}

.mapp-live-beacon::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 2px solid #22c55e;
    animation: mappBeaconPulse 1.6s ease-out infinite;
}

.mapp-qr-scanner-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.mapp-qr-scan-line {
    position: absolute;
    left: 6%;
    right: 6%;
    height: 2.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #22d3ee 20%, #4ade80 50%, #22d3ee 80%, transparent);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.9), 0 0 18px rgba(74, 222, 128, 0.55);
    pointer-events: none;
    z-index: 3;
    animation: mappQrLaser 2.2s ease-in-out infinite;
}

/* 4. Offline Sync Spinner */
.mapp-sync-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: mappSpin 1.1s linear infinite;
}

/* 5. PTDevices Time Until Full (Rising Shimmer) & Time Until Empty (Draining Wash) */
@keyframes mappRiseSweep {
    0% { transform: translateY(100%); opacity: 0.15; }
    30% { opacity: 1; }
    75% { opacity: 1; }
    100% { transform: translateY(-100%); opacity: 0.15; }
}

@keyframes mappDrainSweep {
    0% { transform: translateY(-100%); opacity: 0.15; }
    30% { opacity: 1; }
    75% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0.15; }
}

.ptd-metric2-card {
    position: relative;
    overflow: hidden;
}

.ptd-metric2-bg-sweep {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.ptd-metric2-bg-sweep.is-filling {
    background: linear-gradient(0deg, transparent 0%, rgba(16, 185, 129, 0.28) 45%, rgba(14, 165, 233, 0.24) 60%, transparent 100%);
    animation: mappRiseSweep 4.2s ease-in-out infinite;
}

.ptd-metric2-bg-sweep.is-draining {
    background: linear-gradient(180deg, transparent 0%, rgba(245, 158, 11, 0.26) 45%, rgba(217, 119, 6, 0.18) 60%, transparent 100%);
    animation: mappDrainSweep 5.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .mapp-pipe-flow,
    .mapp-gear-spin,
    .mapp-timer-ring-arc,
    .mapp-live-beacon::after,
    .mapp-qr-scan-line,
    .mapp-sync-spinner,
    .ptd-metric2-bg-sweep {
        animation: none !important;
    }
}
/* === MAPP LIVE TELEMETRY & UI ANIMATIONS END === */
