/* ZOLD "Prodify" Style - Purple/Violet Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand Colors - Orange-Red Palette */
    --primary: #FF751F;
    --primary-hover: #E85A3A;
    --primary-light: #FFE8E0;
    --primary-gradient: linear-gradient(135deg, #FF751F 0%, #E85A3A 100%);

    /* Status Colors */
    --status-success: #10B981;
    /* Green */
    --status-warning: #F4C430;
    /* Updated Warning - Golden Yellow */
    --status-danger: #EF4444;
    /* Red */
    --status-info: #06B6D4;
    /* Cyan (In Progress) */
    --status-done: #215E61;
    /* Teal for Done/Custom status */

    /* Neutral / Surface */
    --bg-body: #F9FAFB;
    /* Clean Light Gray */
    --bg-surface: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;

    /* Design Tokens */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* Deep Shadow */
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    /* Lifted Shadow */

    --font-main: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    /* Removed radial gradient for cleaner look */
}

/* Layout Fix Updates */
.main-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 80px;
    /* Match collapsed sidebar width */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Styling - Icon-Only Mode with Hover Expansion */
.sidebar {
    width: 80px;
    /* Collapsed by default - icons only */
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    white-space: nowrap;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expanded state on hover */
.sidebar:hover {
    width: 260px;
    padding: 1.5rem 1rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

/* Logo - Dynamic sizing */
.sidebar-brand {
    padding: 0 0.25rem 1.5rem 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-brand img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    max-width: 50px;
    /* Small logo when collapsed */
    max-height: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo expands on hover */
.sidebar:hover .sidebar-brand img {
    max-width: 180px;
    max-height: 90px;
}

/* Nav Links - Icon centered when collapsed */
.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center icon when collapsed */
    padding: 0.75rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

/* Icon styling */
.nav-link i {
    width: 24px;
    min-width: 24px;
    font-size: 1.2em;
    text-align: center;
    margin-right: 0;
    /* No margin when collapsed */
    transition: margin 0.3s ease;
}

/* Text hidden by default */
.nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.3s ease, margin 0.3s ease;
    margin-left: 0;
}

/* On sidebar hover: show text, align left */
.sidebar:hover .nav-link {
    justify-content: flex-start;
    padding: 0.75rem 1rem;
}

.sidebar:hover .nav-link i {
    margin-right: 12px;
}

.sidebar:hover .nav-link span {
    opacity: 1;
    width: auto;
    margin-left: 0;
}

/* Nav label hidden when collapsed */
.nav-label {
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.2s, height 0.2s;
}

.sidebar:hover .nav-label {
    opacity: 1;
    height: auto;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* Promo Card in Sidebar */
.sidebar-promo {
    margin-top: auto;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.sidebar-promo::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transform: rotate(45deg);
}

.sidebar-promo h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sidebar-promo p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.btn-promo {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

/* Sidebar Footer - Collapsed/Expanded states */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
}

.user-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centered when collapsed */
    gap: 0;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* User info hidden when collapsed */
.user-profile .d-flex,
.user-profile .fa-chevron-up {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s, width 0.2s;
}

/* Show user info on hover */
.sidebar:hover .user-profile {
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
}

.sidebar:hover .user-profile .d-flex,
.sidebar:hover .user-profile .fa-chevron-up {
    opacity: 1;
    width: auto;
}

.user-profile:hover {
    background-color: var(--bg-body);
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Header & Top Bar */
.top-header {
    margin-bottom: 2rem;
}

.welcome-text h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.welcome-text span {
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

/* Typography Helpers */
.text-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    border-radius: 50px;
    /* Pill shape */
    padding: 0.6rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    /* Solid fallback */
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(255, 117, 31, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 8px -1px rgba(255, 117, 31, 0.4);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-main);
    background: var(--bg-surface);
}

.btn-outline-secondary:hover {
    background: #F3F4F6;
    color: var(--text-main);
    border-color: #D1D5DB;
}

.btn-action-ai {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Status Pills */
.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

/* In Progress Pill - Cyan */
.badge-working {
    background-color: #CFFAFE;
    color: #0E7490;
}

/* Success Pill */
.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

/* Error/High Priority Pill - Pink */
.badge-danger,
.badge-high {
    background-color: #FCE7F3;
    color: #BE185D;
}

/* Low Priority - Gray */
.badge-secondary,
.badge-low {
    background-color: #F3F4F6;
    color: #374151;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom-width: 1px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 1rem 1.5rem;
}

.table td {
    vertical-align: middle;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-main);
}

.table-hover tbody tr:hover {
    background-color: #F9FAFB;
}

/* Inputs */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Glassmorphism Helpers (Subtle) */
.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Auth Pages Centering */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* --- Mobile Responsiveness (Sidebar) --- */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
        width: 280px;
        /* Slightly wider for touch */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Overlay when sidebar open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Mobile Header Toggle */
    .mobile-header-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1.5rem;
    }
}


/* --- Dashboard Redesign V3 (Clean & Pro) --- */

/* 1. Dashboard Toolbar */
.dashboard-toolbar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 1rem;
}

.form-select-custom {
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-select-custom:hover {
    background-color: #F3F4F6;
    border-color: #D1D5DB;
}

.form-select-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 117, 31, 0.1);
    outline: none;
}

/* 2. Stats Cards V3 (Data Density Layout) */
.stat-card-v3 {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card-v3:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.stat-card-v3 .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
    z-index: 2;
}

.stat-card-v3 .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    z-index: 2;
}

/* Subtle icon in top-right corner */
.stat-card-v3 .icon-wrapper {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0.9;
}

/* V3 Color Variants */
.stat-card-v3.primary .icon-wrapper {
    background: #EEF2FF;
    color: var(--primary);
}

.stat-card-v3.indigo .icon-wrapper {
    background: #E0E7FF;
    color: #4338CA;
}

.stat-card-v3.success .icon-wrapper {
    background: #DCFCE7;
    color: #166534;
}

.stat-card-v3.warning .icon-wrapper {
    background: #FEF3C7;
    color: #D97706;
}


/* 3. Table Card Polish */
.table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.table-card .card-header {
    background: var(--bg-surface);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-card .table thead th {
    background-color: #F9FAFB;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.table-card .table tbody td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
    color: var(--text-main);
}

.status-badge {
    padding: 0.35em 0.8em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.status-badge.completed {
    background: #DCFCE7;
    color: #166534;
}

.status-badge.running {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-badge.failed {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.pending {
    background: #F3F4F6;
    color: #374151;
}

/* Progress Bar */
.progress-slim {
    height: 6px;
    border-radius: 99px;
    background-color: #F3F4F6;
    overflow: hidden;
    width: 100%;
    min-width: 100px;
}

.progress-slim .progress-bar {
    background: var(--status-done);
    height: 100%;
    border-radius: 99px;
}

/* --- Dashboard Redesign V4 (Pro SaaS) --- */

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
}

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

/* Stats Cards Pro */
.stat-card-pro {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    /* Ultra-compact padding */
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Taint border */
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Softer hover shadow */
}

.stat-card-pro .stat-value {
    font-size: 1.75rem;
    /* Ultra-compact font size */
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card-pro .stat-label {
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.stat-icon-box {
    width: 36px;
    /* Ultra-compact icon size */
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    /* Reduced icon font size */
}

/* Pro Table */
.table-pro {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-pro thead th {
    background: transparent;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-pro tbody td {
    background: white;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--dark);
    font-size: 0.95rem;
    vertical-align: middle;
}

.table-pro tbody tr:first-child td:first-child {
    border-top-left-radius: 12px;
}

.table-pro tbody tr:first-child td:last-child {
    border-top-right-radius: 12px;
}

.table-pro tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.table-pro tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.table-pro tbody tr:hover td {
    background-color: #f8fafc;
}

/* Status Badges Pro */
.badge-pro {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.badge-pro.online {
    background: #dcfce7;
    color: #166534;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
}

.status-dot.offline {
    background-color: #ef4444;
}

.badge-pro.completed {
    background: #dcfce7;
    color: #166534;
}

.badge-pro.running {
    background: #fef08a;
    color: #854d0e;
}

/* Yellow for 'Running' */
.badge-pro.failed {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pro.paused {
    background: #f1f5f9;
    color: #475569;
}

.badge-pro.offline {
    background: #fee2e2;
    color: #ef4444;
    /* Explicit Red */
}

/* Red for Offline */
.badge-pro.away {
    background: #fef9c3;
    color: #eab308;
}

/* Yellow for Away */

/* Right Panel Lists */
.list-card-pro {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--card-shadow);
}

.list-item-pro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.list-item-pro:last-child {
    border-bottom: none;
}

.avatar-pro {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-thin {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    width: 100px;
}

.progress-thin .bar {
    height: 100%;
    border-radius: 99px;
    background: #F59E0B;
    /* SAS Yellow/Orange */
}