/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Common Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --box-shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Warm Dark Theme Colors (Charcoal, Amber, Copper & Soft Gold) */
[data-theme="dark"] {
    --bg-base: #141211; /* Extra warm deep charcoal/stone */
    --bg-surface: rgba(28, 25, 23, 0.7); /* Stone-900 warm */
    --bg-sidebar: #1c1917; /* Stone-900 solid */
    --border-color: rgba(245, 158, 11, 0.12); /* Amber glow border */
    --text-primary: #fafaf9; /* Stone-50 cream */
    --text-secondary: #e7e5e4; /* Stone-200 */
    --text-muted: #a8a29e; /* Stone-400 */
    
    /* Accents */
    --accent-blue: #f59e0b; /* Amber */
    --accent-blue-rgb: 245, 158, 11;
    --accent-cyan: #f97316; /* Copper Orange */
    --accent-cyan-rgb: 249, 115, 22;
    --accent-purple: #ea580c; /* Rust Orange */
    --accent-purple-rgb: 234, 88, 12;
    --accent-green: #84cc16; /* Lime Green */
    --accent-green-rgb: 132, 204, 22;
    --accent-orange: #eab308; /* Gold Yellow */
    
    /* Glassmorphism overlays */
    --glass-bg: rgba(41, 37, 36, 0.65);
    --glass-border: rgba(245, 158, 11, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --card-hover: rgba(245, 158, 11, 0.04);
}

/* Warm Light Theme Colors (Sand, Terracotta & Soft Amber) */
[data-theme="light"] {
    --bg-base: #fafaf9; /* Warm stone-50 sand */
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-sidebar: #ffffff;
    --border-color: rgba(217, 119, 6, 0.08); /* Warm copper border */
    --text-primary: #1c1917; /* Stone-900 warm charcoal */
    --text-secondary: #44403c; /* Stone-700 */
    --text-muted: #87817d; /* Stone-500 */
    
    /* Accents */
    --accent-blue: #d97706; /* Copper Amber */
    --accent-blue-rgb: 217, 119, 6;
    --accent-cyan: #ea580c; /* Orange-600 */
    --accent-cyan-rgb: 234, 88, 12;
    --accent-purple: #c2410c; /* Dark Rust */
    --accent-purple-rgb: 194, 65, 12;
    --accent-green: #65a30d; /* Warm Green-600 */
    --accent-green-rgb: 101, 163, 13;
    --accent-orange: #ca8a04; /* Gold-600 */
    
    /* Glassmorphism overlays */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(217, 119, 6, 0.04);
    --glass-shadow: 0 8px 32px 0 rgba(120, 80, 20, 0.04);
    
    --card-hover: rgba(217, 119, 6, 0.02);
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

/* ==========================================================================
   APP LAYOUT
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
    z-index: 10;
    transition: background-color var(--transition-normal), border var(--transition-normal);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.menu-item svg {
    transition: transform var(--transition-fast);
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: var(--card-hover);
}

.menu-item:hover svg {
    transform: translateX(2px);
}

.menu-item.active {
    color: white;
    background: linear-gradient(90deg, var(--accent-cyan), rgba(249, 115, 22, 0.75));
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.menu-item.active svg {
    stroke: white;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Layout */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header Styling */
.main-header {
    height: 80px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background-color: var(--bg-sidebar);
    z-index: 5;
    transition: background-color var(--transition-normal), border var(--transition-normal);
}

.search-box {
    position: relative;
    width: 360px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#global-search {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

#global-search:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(var(--accent-cyan-rgb), 0.15);
}

/* Dropdown Search Results */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    max-height: 380px;
    overflow-y: auto;
    z-index: 100;
    padding: 8px 0;
}

.search-results-dropdown.hidden {
    display: none;
}

.search-result-group {
    padding: 8px 16px 4px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.search-result-item:hover {
    background-color: var(--card-hover);
    color: var(--text-primary);
}

.search-result-item svg {
    flex-shrink: 0;
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-title {
    font-weight: 500;
}

.search-result-path {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    transform: rotate(15deg);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-base);
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.online {
    background-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
    animation: pulse 2s infinite;
}

.status-text {
    color: var(--text-secondary);
}

/* ==========================================================================
   VIEWPORT & CARDS (GLASSMORPHISM)
   ========================================================================== */
.content-viewport {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(var(--accent-cyan-rgb), 0.04), transparent 60%);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

.pane-header {
    margin-bottom: 32px;
}

.pane-header h2 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(90deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pane-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    transition: transform var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
}

/* ==========================================================================
   DASHBOARD TAB
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), border var(--transition-fast);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card[data-category="pdf"]::after { background-color: var(--accent-cyan); }
.stat-card[data-category="excel"]::after { background-color: var(--accent-green); }
.stat-card[data-category="video"]::after { background-color: var(--accent-purple); }
.stat-card[data-category="cad"]::after { background-color: var(--accent-orange); }

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.25);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.stat-card[data-category="pdf"] .stat-icon { color: var(--accent-cyan); }
.stat-card[data-category="excel"] .stat-icon { color: var(--accent-green); }
.stat-card[data-category="video"] .stat-icon { color: var(--accent-purple); }
.stat-card[data-category="cad"] .stat-icon { color: var(--accent-orange); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.dashboard-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 32px;
}

.dashboard-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.main-info-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.loops-summary {
    margin-bottom: 30px;
}

.loops-summary h4 {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.loop-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.loop-badge {
    font-size: 0.78rem;
    font-weight: 500;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 50px;
    color: var(--text-secondary);
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* Button UI */
.btn {
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.btn-secondary {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--card-hover);
    border-color: var(--text-muted);
}

/* Quick links list */
.quick-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.quick-link-item:hover {
    border-color: var(--accent-cyan);
    transform: translateX(4px);
    background-color: var(--card-hover);
}

.quick-link-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quick-link-details {
    display: flex;
    flex-direction: column;
}

.quick-link-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.quick-link-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.quick-link-action {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.quick-link-item:hover .quick-link-action {
    color: var(--accent-cyan);
}

/* ==========================================================================
   INTERACTIVE MODEL (P&ID) TAB & LOOP SELECTOR
   ========================================================================== */
.pid-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    height: calc(100vh - 200px);
}

.pid-canvas-wrapper {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 16px !important;
}

.pid-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
}

/* Sub Loop Selector */
.loop-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background-color: var(--bg-base);
    padding: 6px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    width: 100%;
}

.loop-select-btn {
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    background-color: transparent;
}

.loop-select-btn:hover {
    color: var(--text-primary);
    background-color: var(--card-hover);
}

.loop-select-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    box-shadow: 0 4px 10px rgba(var(--accent-blue-rgb), 0.25);
}

.pid-svg-container {
    flex-grow: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #12100f; /* Industrial warm black base */
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    padding: 10px;
}

/* SVG hotspots with warm glows */
.svg-hotspot {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.svg-hotspot circle {
    fill: rgba(245, 158, 11, 0.2);
    stroke: var(--accent-blue);
    stroke-width: 2;
    transition: all var(--transition-fast);
}

.svg-hotspot:hover circle {
    fill: rgba(245, 158, 11, 0.6);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
}

.svg-hotspot.active circle {
    fill: var(--accent-blue);
    stroke: white;
    stroke-width: 3;
    filter: drop-shadow(0 0 10px var(--accent-blue));
}

/* Hotspots for actuator / valves */
.svg-valve-hotspot circle {
    fill: rgba(249, 115, 22, 0.2);
    stroke: var(--accent-cyan);
}

.svg-valve-hotspot:hover circle {
    fill: rgba(249, 115, 22, 0.6);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.8));
}

.svg-valve-hotspot.active circle {
    fill: var(--accent-cyan);
    stroke: white;
    stroke-width: 3;
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

/* Hotspots for pumps */
.svg-pump-hotspot circle {
    fill: rgba(132, 204, 22, 0.2);
    stroke: var(--accent-green);
}

.svg-pump-hotspot:hover circle {
    fill: rgba(132, 204, 22, 0.6);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px rgba(132, 204, 22, 0.8));
}

.svg-pump-hotspot.active circle {
    fill: var(--accent-green);
    stroke: white;
    stroke-width: 3;
    filter: drop-shadow(0 0 10px var(--accent-green));
}

/* Sidebar Details Drawer inside P&ID */
.pid-details-drawer {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.drawer-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.drawer-placeholder svg {
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.drawer-placeholder h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.drawer-placeholder p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: slideInRight var(--transition-normal);
}

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.instrument-tag {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.instrument-loop {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

#drawer-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.drawer-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.instrument-photo-wrapper {
    width: 100%;
    height: 190px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.instrument-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.instrument-photo-wrapper:hover img {
    transform: scale(1.05);
}

.drawer-section h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    border-left: 2px solid var(--accent-cyan);
    padding-left: 8px;
}

.drawer-section p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table td {
    padding: 8px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-color);
}

.specs-table td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
    width: 120px;
}

.specs-table td:last-child {
    color: var(--text-primary);
    text-align: right;
}

.manuals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.manual-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.manual-item-link:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.manual-item-link svg {
    color: var(--accent-cyan);
}

/* ==========================================================================
   DOCUMENT REPOSITORY (EXPLORER) TAB
   ========================================================================== */
.explorer-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: calc(100vh - 200px);
}

.explorer-sidebar {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 20px !important;
}

.sidebar-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.folder-node {
    margin-left: 12px;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    user-select: none;
}

.folder-header:hover {
    background-color: var(--card-hover);
    color: var(--text-primary);
}

.folder-header.active {
    color: var(--accent-cyan);
    background-color: rgba(249, 115, 22, 0.08);
    font-weight: 600;
}

.folder-toggle-icon {
    font-size: 0.65rem;
    transition: transform var(--transition-fast);
    opacity: 0.7;
}

.folder-header.expanded .folder-toggle-icon {
    transform: rotate(90deg);
}

.folder-children {
    display: none;
    border-left: 1px dashed var(--border-color);
    margin-left: 14px;
    padding-left: 4px;
}

.folder-header.expanded + .folder-children {
    display: block;
}

.explorer-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
}

.explorer-toolbar {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.crumb {
    color: var(--text-muted);
    cursor: pointer;
}

.crumb:hover {
    color: var(--text-primary);
}

.crumb.active {
    color: var(--accent-cyan);
    font-weight: 600;
    cursor: default;
}

.crumb:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-muted);
    pointer-events: none;
}

.view-toggle {
    display: flex;
    background-color: var(--bg-base);
    padding: 4px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
}

.btn-icon.active {
    background-color: var(--bg-sidebar);
    color: var(--accent-cyan);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.file-grid-container {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    user-select: none;
}

.grid-item:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-premium);
}

.grid-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: transform var(--transition-fast);
}

.grid-item:hover .grid-icon-wrapper {
    transform: scale(1.08);
}

/* File type icon coloring (Warm styles) */
.grid-item[data-ext=".pdf"] .grid-icon-wrapper { color: #f43f5e; }
.grid-item[data-ext=".xlsx"] .grid-icon-wrapper, 
.grid-item[data-ext=".xls"] .grid-icon-wrapper { color: #84cc16; }
.grid-item[data-ext=".docx"] .grid-icon-wrapper,
.grid-item[data-ext=".doc"] .grid-icon-wrapper { color: #eab308; }
.grid-item[data-ext=".mp4"] .grid-icon-wrapper { color: #ea580c; }
.grid-item[data-ext=".jpg"] .grid-icon-wrapper,
.grid-item[data-ext=".png"] .grid-icon-wrapper,
.grid-item[data-ext=".jpeg"] .grid-icon-wrapper { color: #f472b6; }
.grid-item[data-ext=".dwg"] .grid-icon-wrapper,
.grid-item[data-ext=".bak"] .grid-icon-wrapper { color: #a78bfa; }

.grid-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.grid-size {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* List View */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.list-item:hover {
    border-color: var(--accent-cyan);
    background-color: var(--card-hover);
    transform: translateX(2px);
}

.list-file-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.list-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-item[data-ext=".pdf"] .list-icon { color: #f43f5e; }
.list-item[data-ext=".xlsx"] .list-icon,
.list-item[data-ext=".xls"] .list-icon { color: #84cc16; }
.list-item[data-ext=".docx"] .list-icon { color: #eab308; }
.list-item[data-ext=".mp4"] .list-icon { color: #ea580c; }

.list-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.list-file-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.list-size {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ==========================================================================
   WORK ORDERS (EXCEL READER)
   ========================================================================== */
.orders-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: calc(100vh - 200px);
}

.orders-sidebar {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 20px !important;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-file-item-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    overflow: hidden;
    width: 100%;
}

.order-file-item-container:hover {
    border-color: var(--accent-green);
    background-color: var(--card-hover);
    transform: translateY(-2px);
}

.order-file-item-container.active {
    border-color: var(--accent-green);
    background-color: rgba(132, 204, 22, 0.08);
    box-shadow: 0 4px 10px rgba(132, 204, 22, 0.1);
}

.order-file-select-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-align: left;
    flex-grow: 1;
    overflow: hidden;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}

.order-file-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    margin-right: 8px;
    flex-shrink: 0;
}

.order-file-download-btn:hover {
    color: var(--accent-green);
    background-color: rgba(132, 204, 22, 0.12);
    transform: scale(1.08);
}

.order-file-icon {
    color: var(--accent-green);
    flex-shrink: 0;
}

.order-file-details {
    display: flex;
    flex-direction: column;
}

.order-file-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.order-file-size {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.orders-viewer {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
}

.viewer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.viewer-header-info {
    display: flex;
    flex-direction: column;
}

.viewer-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.viewer-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-download-header {
    background: linear-gradient(135deg, var(--accent-green), #4d7c0f) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(132, 204, 22, 0.25) !important;
    white-space: nowrap;
}

.btn-download-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(132, 204, 22, 0.35) !important;
}

/* Excel Tabs */
.excel-sheets-tabs {
    padding: 12px 24px 0 24px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-base);
    overflow-x: auto;
}

.excel-sheets-tabs.hidden {
    display: none;
}

.sheet-tab {
    padding: 10px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    background-color: var(--bg-sidebar);
    margin-bottom: -1px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sheet-tab:hover {
    color: var(--text-primary);
    background-color: var(--bg-base);
}

.sheet-tab.active {
    color: var(--accent-green);
    background-color: var(--bg-surface);
    border-top: 3px solid var(--accent-green);
    font-weight: 700;
}

.excel-table-wrapper {
    flex-grow: 1;
    overflow: auto;
    padding: 24px;
    background-color: var(--bg-base);
}

.excel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.excel-placeholder svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

/* Excel Rendered Table */
.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background-color: var(--bg-surface);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.excel-table th {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
}

.excel-table td {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-width: 300px;
}

.excel-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.01);
}

.excel-table tr:hover {
    background-color: var(--card-hover);
}

/* ==========================================================================
   VIDEOS TAB
   ========================================================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.video-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: var(--box-shadow-premium);
}

.video-thumbnail {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #2b1f1a, #522713);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.play-icon-overlay {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: rgba(var(--accent-purple-rgb), 0.85);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform var(--transition-fast), background-color var(--transition-fast);
    padding-left: 3px;
}

.video-card:hover .play-icon-overlay {
    transform: scale(1.1);
    background-color: var(--accent-purple);
    box-shadow: 0 0 15px var(--accent-purple);
}

.video-info {
    padding: 18px;
}

.video-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==========================================================================
   MODAL LIGHTBOX VISUALS
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity var(--transition-fast);
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    width: 80%;
    max-width: 1000px;
    height: 85%;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    animation: scaleUp var(--transition-normal);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--accent-cyan);
}

.modal-body {
    flex-grow: 1;
    padding: 0;
    background-color: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-body video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    background-color: black;
    outline: none;
}

.modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 24px;
}

/* ==========================================================================
   ANIMATIONS & UTILITIES
   ========================================================================== */
.hidden {
    display: none !important;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 40px;
    width: 100%;
}

.loading-spinner::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    
    .sidebar-brand {
        margin-bottom: 16px;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .menu-item {
        white-space: nowrap;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        height: auto;
        overflow: visible;
    }
    
    .content-viewport {
        padding: 20px;
    }
    
    .pid-container, .explorer-container, .orders-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .pid-canvas-wrapper, .explorer-sidebar, .orders-sidebar {
        height: 400px;
    }
}

/* ==========================================================================
   INTELLIGENT DOCUMENTATION CENTER (DOCU)
   ========================================================================== */
.docu-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: calc(100vh - 200px);
}

.docu-sidebar {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 20px !important;
}

.docu-search-wrapper {
    margin-bottom: 16px;
}

#docu-search-input {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: border var(--transition-fast);
}

#docu-search-input:focus {
    border-color: var(--accent-cyan);
}

.docu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex-grow: 1;
}

.docu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.docu-item:hover {
    border-color: var(--accent-cyan);
    background-color: var(--card-hover);
    transform: translateY(-2px);
}

.docu-item.active {
    border-color: var(--accent-cyan);
    background-color: rgba(245, 158, 11, 0.08);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.1);
}

.docu-item-icon {
    color: #f43f5e;
    flex-shrink: 0;
}

.docu-item-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.docu-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docu-item-path {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docu-viewer {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 32px !important;
}

.docu-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.docu-placeholder svg {
    margin-bottom: 20px;
    opacity: 0.4;
    color: var(--accent-cyan);
}

.docu-placeholder h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.docu-placeholder p {
    font-size: 0.9rem;
    max-width: 320px;
}

.docu-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
    animation: fadeIn var(--transition-normal);
}

.docu-header-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    gap: 20px;
}

.docu-meta-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.docu-meta-info h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

.docu-meta-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
}

.docu-stats-badges {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.docu-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 50px;
    color: var(--text-secondary);
}

.docu-body-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.docu-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.docu-section h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-cyan);
    font-weight: 700;
}

.docu-summary-box {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 18px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-height: 240px;
    overflow-y: auto;
    font-style: italic;
}

.docu-empty-gallery {
    padding: 30px;
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-muted);
    font-size: 0.88rem;
    background-color: rgba(0, 0, 0, 0.1);
}

.docu-gallery-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.docu-image-card {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.docu-image-card:hover {
    border-color: var(--accent-cyan);
    transform: scale(1.03);
    box-shadow: var(--box-shadow-premium);
}

.docu-img-wrapper {
    height: 140px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

.docu-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.docu-image-title {
    padding: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: var(--bg-sidebar);
}

@media (max-width: 1024px) {
    .docu-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .docu-sidebar {
        height: 350px;
    }
}

/* ==========================================================================
   DASHBOARD EXTRACTED IMAGES GRID & INTERCONNECTION BUTTONS
   ========================================================================== */
.dashboard-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.dashboard-img-card {
    height: 100%;
}

/* Explorer quick action buttons inside cards and list rows */
.grid-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
}

.explorer-card-action-btn, .explorer-list-action-btn {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    transition: all var(--transition-fast);
}

.explorer-card-action-btn:hover, .explorer-list-action-btn:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background-color: rgba(245, 158, 11, 0.08);
    transform: scale(1.08);
}

/* Lightbox custom action button inside modal header */
.btn-modal-action {
    background-color: var(--bg-base) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-size: 0.72rem !important;
    padding: 6px 12px !important;
    border-radius: var(--border-radius-sm) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast) !important;
}

.btn-modal-action:hover {
    border-color: var(--accent-cyan) !important;
    color: var(--accent-cyan) !important;
    background-color: rgba(245, 158, 11, 0.08) !important;
    transform: translateY(-1px);
}

/* Modal extra link for dashboard images */
.dashboard-modal-extra-link button {
    background-color: var(--bg-base) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-size: 0.8rem !important;
    padding: 8px 16px !important;
    border-radius: var(--border-radius-md) !important;
    transition: all var(--transition-fast) !important;
}

.dashboard-modal-extra-link button:hover {
    border-color: var(--accent-cyan) !important;
    color: var(--accent-cyan) !important;
    background-color: rgba(245, 158, 11, 0.08) !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   ADMIN LOGIN & SECURITY STYLES
   ========================================================================== */
.shake {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

#sidebar-lock-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

#sidebar-lock-btn:hover {
    background-color: var(--card-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

