@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --light-bg: #f3f4f6;
    --card-bg: #ffffff;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: #334155;
    overflow-x: hidden;
}

/* Layout */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    z-index: 100;
}

#sidebar .sidebar-header {
    padding: 25px;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}

#sidebar .sidebar-header h4 {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebar .sidebar-header h4 i {
    color: var(--primary-color);
    font-size: 1.4rem;
}

#sidebar ul.components {
    padding: 15px 10px;
}

#sidebar ul li {
    margin-bottom: 5px;
}

#sidebar ul li a {
    padding: 12px 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    border-left: none;
    margin: 0 5px;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
    transform: translateX(3px);
}

#sidebar ul li a.active {
    color: #fff;
    background: var(--primary-color);
    box-shadow: 0 4px 15px -3px rgba(79, 70, 229, 0.4);
}

#sidebar ul li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    transition: all 0.3s;
}

#sidebar ul li a:hover i {
    color: var(--primary-color);
}

#sidebar ul li a.active i {
    color: #fff;
}

/* Sidebar Footer / Logout */
#sidebar .sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: auto;
}

#sidebar .sidebar-footer a {
    color: #ef4444;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    background: rgba(239, 68, 68, 0.1);
}

#sidebar .sidebar-footer a:hover {
    background: #ef4444;
    color: #fff;
}

#sidebar .sidebar-footer a i {
    margin-right: 10px;
}

/* Content */
#content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Navbar */
.main-navbar {
    padding: 15px 30px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Cards */
.card-modern {
    background: var(--card-bg);
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 24px;
}

.card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 24px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 16px;
}

.stat-icon.blue { background: #e0e7ff; color: var(--primary-color); }
.stat-icon.green { background: #dcfce7; color: var(--success-color); }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }

.stat-details h6 {
    margin: 0;
    color: #64748b;
    font-weight: 500;
}

.stat-details h3 {
    margin: 0;
    color: #1e293b;
    font-weight: 700;
}

/* Tables */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.table-modern tbody td {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern tbody tr {
    transition: background-color 0.2s;
}

.table-modern tbody tr:hover {
    background-color: #f8fafc;
    cursor: pointer;
}

/* Badges */
.badge-modern {
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
}
.badge-modern.success { background: #dcfce7; color: #166534; }
.badge-modern.warning { background: #fef3c7; color: #92400e; }
.badge-modern.danger { background: #fee2e2; color: #991b1b; }
.badge-modern.primary { background: #e0e7ff; color: #3730a3; }
.badge-modern.secondary { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn-modern {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
}

.btn-primary-modern {
    background: var(--primary-color);
    color: white;
}

.btn-primary-modern:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

/* Config Preview */
.config-box {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    max-height: 400px;
    overflow-y: auto;
}

/* Page Headers */
.page-header {
    margin-bottom: 32px;
}
.page-header h2 {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}
.page-header p {
    color: #64748b;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}
