/* ==========================================================================
   MyOrion Automation Hub - Design System & Modern Architecture
   Sidebar + Main Content Layout & 2-Column Task Grid
   High-Contrast Dark Navy / Slate Theme (WCAG AA/AAA Compliant)
   ========================================================================== */

:root {
    /* Color Palette - Deep Slate / Dark Navy */
    --bg-base: #090d16;
    --bg-sidebar: #0d1322;
    --bg-header: rgba(13, 19, 34, 0.88);
    --bg-surface: #10182b;
    --bg-card: rgba(19, 31, 55, 0.85);
    --bg-card-hover: rgba(26, 42, 73, 0.95);
    --bg-card-subtle: rgba(15, 23, 42, 0.7);
    --bg-input: #0b1120;
    --bg-input-focus: #0f172a;
    --bg-terminal: #060911;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.22);
    --border-focus: rgba(99, 102, 241, 0.6);
    --border-active: rgba(99, 102, 241, 0.9);

    /* Text Colors - WCAG AA & AAA Compliant High Contrast */
    --text-primary: #f8fafc;       /* Contrast ratio > 15:1 */
    --text-secondary: #cbd5e1;     /* Contrast ratio > 9:1 */
    --text-muted: #94a3b8;         /* Contrast ratio > 5.5:1 */
    --text-dim: #64748b;
    --text-white: #ffffff;

    /* Accent & Brand Colors */
    --accent-indigo: #6366f1;
    --accent-indigo-light: #818cf8;
    --accent-purple: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-emerald-light: #34d399;
    --accent-cyan: #06b6d4;
    --accent-cyan-light: #38bdf8;
    --accent-rose: #f43f5e;
    --accent-rose-light: #fb7185;
    --accent-amber: #f59e0b;
    --accent-amber-light: #fbbf24;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-rose: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);

    /* Shadows & Glows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.55);
    --shadow-glow-indigo: 0 0 24px -4px rgba(99, 102, 241, 0.45);
    --shadow-glow-emerald: 0 0 24px -4px rgba(16, 185, 129, 0.45);
    --shadow-glow-rose: 0 0 24px -4px rgba(244, 63, 94, 0.45);
    --shadow-glow-cyan: 0 0 24px -4px rgba(6, 182, 212, 0.45);

    /* Radius & Spacing */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Transitions */
    --transition-fast: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 45%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.06) 0px, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Lucide Icon Generic Styling */
[data-lucide], svg.lucide {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    stroke-width: 2;
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   1. APP ROOT & SIDEBAR + MAIN CONTENT LAYOUT
   ========================================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* Sidebar Navigation */
.app-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: width var(--transition-smooth), min-width var(--transition-smooth);
    user-select: none;
}

/* Sidebar Collapsed State */
.app-sidebar.collapsed {
    width: 76px;
    min-width: 76px;
}

.app-sidebar.collapsed .brand-info,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .sidebar-group-title,
.app-sidebar.collapsed .sidebar-badge,
.app-sidebar.collapsed .sidebar-badge-accent,
.app-sidebar.collapsed .nav-item-ext-icon,
.app-sidebar.collapsed .system-meta-text,
.app-sidebar.collapsed .sidebar-user-details {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
}

.app-sidebar.collapsed .sidebar-collapse-btn {
    position: absolute;
    bottom: 12px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

.app-sidebar.collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 12px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px 18px 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo-glow {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    box-shadow: var(--shadow-glow-indigo);
    flex-shrink: 0;
}

.brand-logo-glow [data-lucide] {
    width: 20px;
    height: 20px;
}

.brand-info {
    min-width: 0;
}

.brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    white-space: nowrap;
}

.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-collapse-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--border-focus);
    color: var(--text-white);
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-group-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 4px 10px 6px 10px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    width: 100%;
    text-align: left;
}

.sidebar-nav-item [data-lucide] {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-nav-item:hover [data-lucide] {
    color: var(--accent-indigo-light);
}

.sidebar-nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--text-white);
    font-weight: 600;
}

.sidebar-nav-item.active [data-lucide] {
    color: var(--accent-indigo-light);
}

.sidebar-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.sidebar-badge-accent {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald-light);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.675rem;
    font-weight: 600;
}

.nav-item-ext-icon {
    margin-left: auto;
    width: 14px !important;
    height: 14px !important;
    opacity: 0.6;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(10, 15, 27, 0.4);
}

.sidebar-system-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 12px;
}

.system-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-primary);
}

.system-meta-text {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
}

.sidebar-user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-white);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    color: var(--accent-indigo-light);
    display: block;
}

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

.btn-sidebar-logout:hover {
    color: var(--accent-rose-light);
    background: rgba(244, 63, 94, 0.15);
}

/* ==========================================================================
   2. TOP BAR / APP HEADER
   ========================================================================== */
.app-main-layout {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-sidebar-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.breadcrumb-icon {
    color: var(--accent-indigo-light);
    width: 17px !important;
    height: 17px !important;
}

.breadcrumb-sep {
    color: var(--text-dim);
}

.breadcrumb-current {
    font-weight: 600;
    color: var(--text-white);
}

/* Streamlined Status & Quick Controls in Topbar */
.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green {
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.dot-yellow {
    background: var(--accent-amber);
    box-shadow: 0 0 8px var(--accent-amber);
    animation: pulse 1.5s infinite;
}

.dot-gray {
    background: var(--text-muted);
}

.dot-red {
    background: var(--accent-rose);
    box-shadow: 0 0 8px var(--accent-rose);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.15); }
}

/* Header Action Buttons */
.btn-header-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 0.775rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-header-action:hover {
    background: rgba(30, 41, 59, 0.9);
    color: var(--text-white);
    border-color: var(--border-medium);
}

.btn-novnc-action {
    border-color: rgba(6, 182, 212, 0.35);
    color: var(--accent-cyan-light);
}

.btn-novnc-action:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow-cyan);
}

.header-port-badge {
    background: rgba(6, 182, 212, 0.2);
    padding: 1px 5px;
    border-radius: var(--radius-xs);
    font-size: 0.6875rem;
    font-family: var(--font-mono);
}

.btn-creds-action:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo-light);
}

.btn-terminal-action {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.btn-terminal-action:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-indigo);
    color: var(--text-white);
}

/* User Profile Badge in Header */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 6px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
}

.user-avatar-wrap {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-white);
    flex-shrink: 0;
}

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

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

.user-role-label {
    font-size: 0.65rem;
    color: var(--accent-emerald-light);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    color: var(--accent-rose-light);
    background: rgba(244, 63, 94, 0.15);
}

/* ==========================================================================
   3. CONTENT AREA & VIEWS
   ========================================================================== */
.app-content-area {
    flex: 1;
    padding: 24px 28px 100px 28px; /* Extra bottom padding for docked bottom drawer */
    max-width: 1540px;
    margin: 0 auto;
    width: 100%;
}

.hub-view-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards Generic */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    border-color: var(--border-medium);
}

.card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    gap: 14px;
    flex-wrap: wrap;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title-icon-wrap.icon-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-title-icon-wrap.icon-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-body {
    padding: 20px;
}

/* ==========================================================================
   4. OPERATIONAL WORKFLOW GUIDE ACCORDION (UX ENHANCEMENT)
   ========================================================================== */
.guide-accordion {
    background: linear-gradient(180deg, rgba(23, 37, 68, 0.6) 0%, rgba(15, 23, 42, 0.65) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.guide-accordion-summary {
    list-style: none;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    gap: 16px;
}

.guide-accordion-summary::-webkit-details-marker {
    display: none;
}

.guide-summary-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.guide-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--accent-indigo-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-summary-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-white);
}

.guide-summary-subtitle {
    font-size: 0.775rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.guide-summary-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-badge-pill {
    padding: 3px 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    color: #a5b4fc;
    font-weight: 600;
}

.accordion-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}

.guide-accordion[open] .accordion-chevron {
    transform: rotate(180deg);
}

.guide-accordion-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    flex-wrap: wrap;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.step-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all var(--transition-fast);
}

.step-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.step-card.highlight-step {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(30, 41, 59, 0.55);
}

.step-number-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-type-icon {
    color: var(--text-muted);
}

.step-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
}

.step-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.step-text b {
    color: var(--text-white);
}

/* Embedded noVNC Frame */
.embedded-vnc-section {
    background: #000;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.vnc-frame-header {
    background: var(--bg-surface);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.vnc-frame-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-white);
}

.vnc-live-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.vnc-frame-tools {
    display: flex;
    gap: 8px;
}

.btn-tool {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-fast);
}

.btn-tool:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
}

.vnc-frame-wrapper {
    height: 520px;
    width: 100%;
}

.vnc-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ==========================================================================
   5. 2-COLUMN TASK CARDS GRID (MAIN WORKSPACE)
   ========================================================================== */
.tasks-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.task-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    border-top: 3px solid transparent;
}

/* Card Accent Tops */
.card-task-sfa {
    border-top-color: var(--accent-purple);
}

.card-task-clean {
    border-top-color: var(--accent-rose);
}

.card-task-download {
    border-top-color: var(--accent-emerald);
}

.card-task-upload {
    border-top-color: var(--accent-cyan);
}

.task-card.is-running {
    border-color: var(--accent-amber);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.task-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.task-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-icon-box [data-lucide] {
    width: 22px;
    height: 22px;
}

.task-icon-box.icon-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 16px -2px rgba(139, 92, 246, 0.3);
}

.task-icon-box.icon-rose {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.35);
    box-shadow: 0 0 16px -2px rgba(244, 63, 94, 0.3);
}

.task-icon-box.icon-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 16px -2px rgba(16, 185, 129, 0.3);
}

.task-icon-box.icon-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(6, 182, 212, 0.35);
    box-shadow: 0 0 16px -2px rgba(6, 182, 212, 0.3);
}

.task-title-group {
    flex: 1;
    min-width: 0;
}

.task-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.task-type-badge {
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-purple { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-cyan { background: rgba(6, 182, 212, 0.2); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }

.task-status-indicator {
    font-size: 0.7rem;
    color: var(--accent-emerald-light);
    font-weight: 500;
}

.task-meta-item {
    font-size: 0.725rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-white);
}

.task-description {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.task-description code {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-subtle);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    color: #e2e8f0;
}

/* Contextual Management Box inside Task Card */
.task-context-box {
    background: rgba(11, 16, 28, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-meta-pills {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meta-pill b {
    color: var(--text-primary);
}

.btn-context-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-context-action:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-indigo);
    color: var(--text-white);
}

.btn-context-rose {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fecdd3;
}

.btn-context-rose:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: var(--accent-rose);
    color: var(--text-white);
}

/* Balanced Compact Checklist Grids in Cards 3 & 4 */
.dms-reports-selector,
.upload-targets-selector {
    background: rgba(11, 16, 28, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.selector-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 8px;
    flex-wrap: wrap;
}

.selector-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selector-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.selection-count-badge {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 0.675rem;
    font-weight: 600;
}

.dms-checkbox-grid,
.upload-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.compact-check-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(20, 30, 50, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.compact-check-card:hover {
    background: rgba(30, 45, 75, 0.8);
    border-color: rgba(99, 102, 241, 0.4);
}

.compact-check-card:has(.checkbox-input:checked) {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.55);
}

.compact-check-card [data-lucide] {
    width: 15px !important;
    height: 15px !important;
    color: var(--text-muted);
}

.compact-check-card:has(.checkbox-input:checked) [data-lucide] {
    color: var(--accent-indigo-light);
}

.compact-check-label {
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-check-card:has(.checkbox-input:checked) .compact-check-label {
    color: var(--text-white);
}

/* Upload Manual Dropdown */
.upload-manual-details {
    margin-top: 10px;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.35);
}

.upload-manual-summary {
    cursor: pointer;
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--accent-cyan-light);
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    list-style: none;
}

.upload-manual-summary::-webkit-details-marker {
    display: none;
}

.summary-arrow {
    margin-left: auto;
    width: 14px !important;
    height: 14px !important;
    transition: transform var(--transition-fast);
}

.upload-manual-details[open] .summary-arrow {
    transform: rotate(180deg);
}

.upload-file-selector-box {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.select-styled {
    background: #0b1120;
    border: 1px solid var(--border-medium);
    color: var(--text-white);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    width: 100%;
    outline: none;
}

.upload-select-row {
    display: flex;
    gap: 8px;
}

.upload-file-select {
    flex: 1;
}

.upload-file-hint {
    font-size: 0.7rem;
    color: var(--accent-emerald-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Run Buttons in Cards */
.task-action-btn {
    margin-top: 4px;
}

.btn-run {
    width: 100%;
    padding: 11px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-white);
    box-shadow: var(--shadow-glow-indigo);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(99, 102, 241, 0.6);
}

.btn-rose {
    background: var(--gradient-rose);
    color: var(--text-white);
    box-shadow: var(--shadow-glow-rose);
}

.btn-rose:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(244, 63, 94, 0.6);
}

.btn-accent {
    background: var(--gradient-emerald);
    color: var(--text-white);
    box-shadow: var(--shadow-glow-emerald);
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.6);
}

.btn-cyan {
    background: var(--gradient-cyan);
    color: var(--text-white);
    box-shadow: var(--shadow-glow-cyan);
}

.btn-cyan:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(6, 182, 212, 0.6);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Stop Control Box */
.stop-control-box {
    margin-top: -6px;
    margin-bottom: 6px;
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--text-white);
    border: none;
    box-shadow: var(--shadow-glow-rose);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-full {
    width: 100%;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(244, 63, 94, 0.7);
}

/* ==========================================================================
   6. LIVE AUTOMATION CONSOLE: BOTTOM SLIDE-UP DRAWER (UX ENHANCEMENT)
   ========================================================================== */
.terminal-drawer {
    position: fixed;
    bottom: 0;
    left: 260px; /* Aligns with sidebar */
    right: 0;
    z-index: 800;
    background: rgba(7, 10, 18, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-medium);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.65);
    transition: height var(--transition-smooth), left var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.app-sidebar.collapsed ~ .app-main-layout .terminal-drawer,
body:has(.app-sidebar.collapsed) .terminal-drawer {
    left: 76px;
}

body:has(#main-content.hidden) .terminal-drawer,
body:has(#login-section:not(.hidden)) .terminal-drawer,
.login-section:not(.hidden) ~ .terminal-drawer {
    display: none !important;
}

/* Collapsed State: Sleek 46px Docked Status Bar */
.terminal-drawer.collapsed {
    height: 48px;
    overflow: hidden;
}

.terminal-drawer.expanded {
    height: 420px;
}

.terminal-bar-collapsed {
    height: 48px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-subtle);
}

.bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-pulse-indicator {
    display: flex;
    align-items: center;
}

.bar-title {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-white);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bar-status {
    font-size: 0.775rem;
    color: var(--text-secondary);
    margin-left: 10px;
}

.bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-drawer-toggle {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-drawer-toggle:hover {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-white);
}

.btn-xs {
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: var(--radius-xs);
}

/* Expanded Terminal Panel */
.terminal-drawer-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.terminal-header {
    background: rgba(15, 23, 42, 0.85);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-white);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.terminal-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-autoscroll {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-term-tool {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 4px 9px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-fast);
}

.btn-term-tool:hover {
    background: rgba(255, 255, 255, 0.16);
    color: var(--text-white);
}

.btn-minimize:hover {
    color: var(--accent-amber-light);
}

.terminal-body {
    flex: 1;
    padding: 14px 18px;
    overflow-y: auto;
    background: var(--bg-terminal);
    min-height: 0;
}

.terminal-output {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ==========================================================================
   7. SALES LIST EDITOR MODAL (SINGLE-CONTEXT INTEGRATION)
   ========================================================================== */
.sales-modal-dialog {
    max-width: 820px;
}

.sales-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.file-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: var(--radius-md);
}

.file-info-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-icon {
    color: var(--accent-indigo-light);
}

.file-path {
    font-family: var(--font-mono);
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-white);
}

.file-sync-badge {
    font-size: 0.7rem;
    color: var(--accent-emerald-light);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.add-item-bar {
    display: flex;
    gap: 10px;
}

.input-with-icon {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.text-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 10px 14px 10px 38px;
    color: var(--text-white);
    font-size: 0.875rem;
    font-family: var(--font-mono);
    outline: none;
    transition: all var(--transition-fast);
}

.text-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.chips-view {
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
    background: rgba(11, 16, 28, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sales-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-white);
    transition: all var(--transition-fast);
}

.sales-chip:hover {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.15);
}

.btn-remove-chip {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.btn-remove-chip:hover {
    color: var(--accent-rose-light);
}

.raw-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-white);
    font-family: var(--font-mono);
    font-size: 0.825rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
}

.raw-textarea:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* ==========================================================================
   8. REPORTS LIST & BULK ACTIONS
   ========================================================================== */
.reports-header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reports-toolbar-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid var(--border-subtle);
    gap: 14px;
    flex-wrap: wrap;
}

.reports-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reports-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-card-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: var(--transition-fast);
}

.report-card-item:hover {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(25, 36, 61, 0.7);
    transform: translateX(2px);
}

.report-card-item.is-selected {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(99, 102, 241, 0.55);
}

.report-badge-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-emerald-light);
    flex-shrink: 0;
}

.report-details {
    flex: 1;
    min-width: 0;
}

.report-filename {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-submeta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.725rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.report-action-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ==========================================================================
   9. SCREENSHOT GALLERY
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
}

.gallery-item:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gallery-thumb-wrap {
    height: 140px;
    overflow: hidden;
    background: #000;
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.gallery-item:hover .gallery-thumb {
    transform: scale(1.05);
}

.gallery-meta {
    padding: 10px 12px;
}

.gallery-name {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-date {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   10. DEDICATED CREDENTIALS PAGE (VIEW 2)
   ========================================================================== */
.page-creds-hero {
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
}

.hero-content-wrap {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    max-width: 900px;
}

.hero-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-glow-indigo);
    flex-shrink: 0;
}

.hero-icon-box [data-lucide] {
    width: 24px;
    height: 24px;
}

.hero-badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.badge-pill {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-primary { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.badge-info { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.hero-heading {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.hero-subheading {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

.page-creds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.creds-card-header-gradient-target {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15) 0%, transparent 100%);
    border-bottom: 1px solid rgba(6, 182, 212, 0.3);
}

.creds-card-header-gradient-orion {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 600;
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan-light);
}

.badge-orion-sub {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.creds-card-body-spacious {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
}

.label-badge {
    font-size: 0.675rem;
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    background: rgba(244, 63, 94, 0.2);
    color: #fca5a5;
}

.badge-green {
    background: rgba(16, 185, 129, 0.2);
    color: #86efac;
}

.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    color: var(--text-white);
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.input-muted {
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-muted);
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap .form-input {
    width: 100%;
    padding-right: 40px;
}

.btn-toggle-pwd {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-pwd:hover {
    color: var(--text-white);
}

.input-hint {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.card-alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    line-height: 1.5;
}

.alert-target {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #bae6fd;
}

.alert-orion {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
}

.page-creds-actions-card {
    padding: 18px 24px;
}

.actions-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.actions-left-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-white);
    display: block;
}

.info-sub {
    font-size: 0.775rem;
    color: var(--text-muted);
}

.actions-buttons-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User switcher in dedicated page */
.page-user-chips-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-chip-btn {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.user-chip-btn:hover {
    border-color: var(--accent-indigo);
    color: var(--text-white);
}

.user-chip-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-glow-indigo);
}

.user-chip-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}

.data-table th {
    text-align: left;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.badge-status-ok {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald-light);
    font-size: 0.725rem;
    font-weight: 600;
}

.badge-status-empty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber-light);
    font-size: 0.725rem;
    font-weight: 600;
}

/* ==========================================================================
   11. MODAL DIALOGS (GENERIC, CREDENTIALS & SALES)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.hidden {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 6, 12, 0.85);
    backdrop-filter: blur(10px);
}

.modal-dialog {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    z-index: 10;
}

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

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: var(--accent-indigo-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-white);
}

.modal-subtitle {
    font-size: 0.775rem;
    color: var(--text-muted);
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close-modal:hover {
    background: rgba(244, 63, 94, 0.2);
    color: #fff;
    border-color: rgba(244, 63, 94, 0.4);
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 15, 27, 0.4);
}

.tab-pills {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-pill {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.tab-pill.active {
    background: rgba(99, 102, 241, 0.25);
    color: var(--text-white);
    box-shadow: var(--shadow-sm);
}

.tab-badge {
    background: rgba(255, 255, 255, 0.12);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 0.675rem;
}

/* Credentials modal specific */
.creds-modal-dialog {
    max-width: 980px;
}

.creds-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.modal-alert-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: #c7d2fe;
    line-height: 1.5;
}

.creds-user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    gap: 14px;
    flex-wrap: wrap;
}

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

.creds-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.creds-section-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.creds-sec-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-upload { color: var(--accent-cyan-light); }
.badge-orion { color: #a5b4fc; }

/* Image Preview Modal */
#modal-preview-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   12. LOGIN SECTION
   ========================================================================== */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-container {
    max-width: 440px;
    width: 100%;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.login-card-glow {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 140px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.login-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    color: #fff;
    box-shadow: var(--shadow-glow-indigo);
}

.login-icon-box [data-lucide] {
    width: 26px;
    height: 26px;
}

.login-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    color: #fecdd3;
    font-size: 0.8rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.role-selector-wrap {
    margin-top: 6px;
}

.role-selector-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.role-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.role-chip {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.role-chip:hover,
.role-chip.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-indigo);
    color: var(--text-white);
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-login-submit {
    width: 100%;
    padding: 12px;
    font-size: 0.925rem;
    font-weight: 600;
    margin-top: 6px;
}

.login-footer-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   13. BUTTONS & TOAST NOTIFICATIONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-subtle);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-medium);
}

.btn-success {
    background: var(--gradient-emerald);
    color: #fff;
    box-shadow: var(--shadow-glow-emerald);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.785rem;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--accent-indigo-light);
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-link:hover {
    text-decoration: underline;
}

.text-danger {
    color: var(--accent-rose-light) !important;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-lg);
    color: var(--text-white);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-error { border-left: 4px solid var(--accent-rose); }
.toast-info { border-left: 4px solid var(--accent-indigo); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   14. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1200px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .tasks-grid-2col {
        grid-template-columns: 1fr;
    }

    .page-creds-grid {
        grid-template-columns: 1fr;
    }

    .creds-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -270px;
        transition: left var(--transition-smooth);
    }

    .app-sidebar.mobile-open {
        left: 0;
    }

    .terminal-drawer {
        left: 0 !important;
    }

    .mobile-sidebar-toggle {
        display: inline-flex;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .app-content-area {
        padding: 16px 14px 100px 14px;
    }

    .header-status .status-badge:nth-child(1),
    .header-status .btn-creds-action {
        display: none;
    }
}
