:root {
    /* Premium Dark Theme Colors */
    --bg-base: #0f111a;
    --bg-surface: #1a1d2d;
    --bg-surface-hover: #23273a;
    --text-primary: #f8f9fa;
    --text-secondary: #a0a6c0;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.2);
    
    /* Brand & Accents */
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-primary: #6366f1;
    --accent-color-rgb: 99, 102, 241;
    
    /* Equipment Type Colors (Defaults for UI elements if needed) */
    --color-frac-pump: #10b981;
    --color-blender: #3b82f6;
    --color-chem-van: #f59e0b;
    --color-service-unit: #ef4444;
    --color-other: #8b5cf6;

    /* Glassmorphism */
    --glass-bg: rgba(26, 29, 45, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Layout */
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 2rem;
}

.header-content {
    width: 100%;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #fff, #a0a6c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.primary-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    font-size: 0.9rem;
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.secondary-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--border-highlight);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

/* Board Layout */
.board-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
}

/* Tabs Navigation */
.tabs-container {
    display: flex;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-btn.drag-over-tab {
    background: var(--accent-hover);
    color: white;
    box-shadow: 0 0 0 2px white;
    transform: scale(1.05);
}

/* Category Sections */
.category-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.category-header h2 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.groups-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 1rem;
}

.group-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.group-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.locations-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Location Column (Swimlane) */
.location-column {
    cursor: grab;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex: 0 0 auto;
    width: 320px;
    min-width: 320px;
    max-width: 90vw;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-height) - 200px);
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
    resize: horizontal;
    overflow: hidden;
}

.location-column.drag-over {
    background: var(--bg-surface-hover);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.location-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.asset-count {
    background: var(--border-highlight);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.location-body {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-content: start;
    gap: 0.75rem;
    min-height: 100px;
}
.location-body::-webkit-scrollbar { width: 4px; }
.location-body::-webkit-scrollbar-thumb { background: var(--border-highlight); border-radius: 4px; }

/* Asset Card */
.asset-card {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: grab;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.asset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border-color: var(--border-highlight);
}

.asset-card:active {
    cursor: grabbing;
}

.asset-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: none;
}

/* Type Indicator Strip */
.asset-type-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--type-color, var(--accent-color));
}

.asset-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-left: 0.5rem;
}

.asset-id {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.asset-type-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.status-badge {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    display: inline-block;
    font-weight: 600;
}
.status-badge[data-status="In Progress"] { color: #3b82f6; background: rgba(59, 130, 246, 0.2); }
.status-badge[data-status="Completed"] { color: #10b981; background: rgba(16, 185, 129, 0.2); }
.status-badge[data-status="Unit Down"] { color: #ef4444; background: rgba(239, 68, 68, 0.2); }
.status-badge[data-status="Waiting on Parts"] { color: #f59e0b; background: rgba(245, 158, 11, 0.2); }
.status-badge[data-status="To be Done"] { color: #9ca3af; background: rgba(156, 163, 175, 0.2); }
.status-badge[data-status="Waiting for Approval"] { color: #ec4899; background: rgba(236, 72, 153, 0.2); }
.status-badge[data-status="Waiting for Equipment"] { color: #8b5cf6; background: rgba(139, 92, 246, 0.2); }
.status-badge[data-status="Waiting for Labor"] { color: #06b6d4; background: rgba(6, 182, 212, 0.2); }
.status-badge[data-status="Waiting for Testing"] { color: #14b8a6; background: rgba(20, 184, 166, 0.2); }
.status-badge[data-status="Waiting for Vendor"] { color: #f97316; background: rgba(249, 115, 22, 0.2); }

/* Types List */
.type-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.type-color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 1rem;
}
.delete-type-btn {
    background: none;
    border: none;
    color: var(--color-service-unit);
    cursor: pointer;
    font-size: 1.25rem;
}
.delete-type-btn:hover {
    opacity: 0.8;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden { display: none !important; }

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal {
    transform: scale(0.9);
}


.modal.hidden { display: none !important; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-actions {
    margin-top: 2rem;
}

.submit-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background: var(--accent-hover);
}

/* Empty States */
.empty-state {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
}

/* Responsive Adjustments */
@media screen and (max-width: 1200px) {
    .location-column {
    cursor: grab;
        min-width: 280px;
        width: 280px;
    }
}

@media screen and (max-width: 768px) {
    .app-header {
        height: auto;
        padding: 1rem;
    }
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .primary-btn {
        flex: 1;
        justify-content: center;
        min-width: 140px;
        font-size: 0.85rem;
    }
    .tabs-container {
        padding: 0.5rem 1rem;
    }
    .board-container {
        padding: 1rem;
    }
    
    /* Stack everything vertically on mobile */
    .groups-container {
        flex-direction: column;
        overflow-x: visible;
        gap: 1.5rem;
    }
    .locations-container {
        flex-direction: column;
        overflow-x: visible;
        gap: 1rem;
    }
    .location-column {
    cursor: grab;
        min-width: 100%;
        width: 100%;
        max-height: 400px;
    }
}

/* Search Components */
.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 0.25rem 0.75rem;
    color: white;
}
.search-icon {
    margin-right: 0.5rem;
    opacity: 0.7;
}
#global-search {
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    width: 200px;
    outline: none;
}
#global-search::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Search Drawer */
.search-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.search-drawer.open {
    right: 0;
}
.search-drawer .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.search-drawer .drawer-header h2 {
    font-size: 1.2rem;
    margin: 0;
}
.search-drawer .drawer-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}
.search-drawer .empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 2rem;
}


/* Group Dragging Styles */
.group-box[draggable="true"] {
    cursor: grab;
}
.group-box[draggable="true"]:active {
    cursor: grabbing;
}
.group-dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-primary);
}
.group-drag-over-top {
    border-top: 4px solid var(--accent-primary) !important;
}
.group-drag-over-bottom {
    border-bottom: 4px solid var(--accent-primary) !important;
}


/* --- Login & Authentication Styles --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4); /* Semi-transparent dark slate */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: var(--bg-surface);
    padding: 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.login-error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* User Management Table */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.users-table th, .users-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Viewer Mode Overrides */
.viewer-mode .icon-btn,
.viewer-mode .add-group-btn,
.viewer-mode .submit-btn,
.viewer-mode .header-actions .primary-btn {
    display: none !important;
}

/* Exempt some buttons from being hidden in viewer mode if needed */
.viewer-mode #logout-btn {
    display: inline-flex !important;
}

/* App Footer */
.app-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}
.footer-content {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-branding {
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.footer-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

body {
    padding-bottom: 60px; /* Add padding to body so footer doesn't overlap content */
}


/* Lane Drag and Drop */
.lane-dragging {
    cursor: grabbing !important;
    opacity: 0.4;
    transform: scale(0.98);
}
.lane-drag-over-left {
    border-left: 3px solid var(--accent-color) !important;
    transform: translateX(5px);
}
.lane-drag-over-right {
    border-right: 3px solid var(--accent-color) !important;
    transform: translateX(-5px);
}


.container-drag-over {
    background: rgba(var(--accent-color-rgb), 0.05);
    border: 2px dashed var(--accent-color);
    border-radius: var(--radius-md);
    min-height: 200px;
}

/* Light Mode Theme */
body.light-mode {
    --bg-base: #f1f3f5;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8f9fa;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: rgba(0, 0, 0, 0.15);
    --border-highlight: rgba(0, 0, 0, 0.25);
    
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.15);
    --glass-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Light Mode Component Overrides */
body.light-mode .search-container {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.1);
}
body.light-mode #global-search {
    color: var(--text-primary);
}
body.light-mode #global-search::placeholder {
    color: rgba(0, 0, 0, 0.5);
}
body.light-mode .header-content h1 {
    background: linear-gradient(to right, #1f2937, #4b5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.light-mode .location-header {
    background: rgba(0,0,0,0.05);
}
