@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdn-uicons.flaticon.com/uicons-regular-rounded/css/uicons-regular-rounded.css');

:root {
    /* Cakto inspired variables */
    --primary-color: #10b981; /* Neon green */
    --primary-hover: #059669; 
    --primary-light: rgba(16, 185, 129, 0.1); 
    
    --bg-color: #0a0f12; /* Deep dark background */
    --card-bg: #151b1f; /* Slightly lighter for cards */
    
    --text-main: #ffffff; /* White text */
    --text-muted: #9ca3af; /* Gray text */
    
    --border-color: #262e33; /* Very dark border */
    
    --warning-bg: rgba(245, 158, 11, 0.1); 
    --warning-text: #f59e0b; 
    
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #ef4444;

    --sidebar-bg: #0a0f12; 
    --sidebar-hover: #151b1f; 
    --sidebar-text: #9ca3af; 
    --sidebar-active: #ffffff;
    
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0, 0.5), 0 2px 4px -2px rgba(0,0,0, 0.5);
    --shadow-glow: 0 0 15px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] {
    --bg-color: #f3f4f6; /* Light gray background */
    --card-bg: #ffffff; /* White cards */
    
    --text-main: #111827; /* Dark gray text */
    --text-muted: #6b7280; /* Medium gray text */
    
    --border-color: #e5e7eb; /* Light border */
    
    --sidebar-bg: #ffffff; 
    --sidebar-hover: #f3f4f6; 
    --sidebar-text: #4b5563; 
    --sidebar-active: #ffffff;
    
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0, 0.1), 0 2px 4px -2px rgba(0,0,0, 0.1);
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.text-primary { color: var(--primary-color); }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }

.c-blue { color: #3b82f6 !important; background: rgba(59, 130, 246, 0.1) !important; border: 1px solid rgba(59, 130, 246, 0.2) !important;}
.c-green { color: #10b981 !important; background: rgba(16, 185, 129, 0.1) !important; border: 1px solid rgba(16, 185, 129, 0.2) !important;}
.c-orange { color: #f97316 !important; background: rgba(249, 115, 22, 0.1) !important; border: 1px solid rgba(249, 115, 22, 0.2) !important;}
.c-red { color: #ef4444 !important; background: rgba(239, 68, 68, 0.1) !important; border: 1px solid rgba(239, 68, 68, 0.2) !important;}
.c-purple { color: #a855f7 !important; background: rgba(168, 85, 247, 0.1) !important; border: 1px solid rgba(168, 85, 247, 0.2) !important;}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    gap: 0.5rem;
}
.btn i {
    font-size: 1.1em;
}
.btn-primary {
    background: var(--primary-color);
    color: #000000;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}
.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    background-color: var(--card-bg);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Layout - Login */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
}
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.login-header .logo-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: #000;
    font-size: 32px;
    box-shadow: var(--shadow-glow);
}
.login-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: white;
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    transition: all 0.2s;
    font-size: 0.95rem;
    color: white;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}
.form-control::placeholder {
    color: #4b5563;
}

/* Layout - Dashboard */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    color: var(--sidebar-text);
    border-right: 1px solid var(--border-color);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    margin-bottom: 2.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}
.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 1rem;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}
.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: white;
}
.nav-item.active {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}
.nav-item.active i {
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
}
.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2.5rem 4rem;
    overflow-y: auto;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}
.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}
.page-title p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border-left: 3px solid transparent;
}
.stat-card:hover {
    border-left: 3px solid var(--primary-color);
}
.stat-icon {
    width: 56px;
    height: 56px;
    background-color: var(--bg-color);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}
.stat-card:hover .stat-icon {
    transform: scale(1.05);
}
.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}
.stat-info p {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    color: white;
}

/* Analise Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.chart-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.mini-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.mini-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-left: 2px solid var(--primary-color);
}
.mini-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.mini-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.mini-card-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0;
}
.mini-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin: 0;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.resource-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}
.resource-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
}
.resource-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.resource-title {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.resource-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    color: white;
}
.resource-footer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Badges */
.badge { 
    padding: 4px 10px; 
    border-radius: 4px; 
    font-size: 0.75rem; 
    font-weight: 600;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}
.badge-pending { background: rgba(245, 158, 11, 0.1); color: #fcd34d; border-color: rgba(245, 158, 11, 0.2); }
.badge-running { 
    background: rgba(16, 185, 129, 0.1); 
    color: var(--primary-color); 
    border-color: rgba(16, 185, 129, 0.2);
}
.badge-completed { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border-color: rgba(59, 130, 246, 0.2); }
.badge-paused { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.badge-secondary { background: var(--bg-color); color: var(--text-muted); border-color: var(--border-color); }

/* Table Enhancements */
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1rem; }
.table th, .table td { padding: 1.25rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { color: var(--text-muted); font-weight: 500; font-size: 0.85rem; }
.table tbody tr { transition: background-color 0.2s; }
.table tbody tr:hover { background-color: var(--bg-color); }
.action-btn { 
    background: var(--bg-color); 
    border: 1px solid var(--border-color); 
    cursor: pointer; 
    color: var(--text-muted); 
    margin-right: 8px; 
    font-size: 1rem; 
    text-decoration: none; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    width: 36px; 
    height: 36px; 
    border-radius: 8px; 
    transition: all 0.2s; 
}
.action-btn:hover { background: rgba(16, 185, 129, 0.1); color: var(--primary-color); border-color: var(--primary-color); }
.action-btn.delete:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: #ef4444; }

/* Warning Banner */
.warning-banner {
    background-color: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
}
.warning-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--warning-text);
    font-weight: 500;
}
.warning-icon {
    font-size: 1.5rem;
}
