/* ============================================================
   NovaBot Admin UI - Design System
   Professional multi-page admin interface
   ============================================================ */

/* ============================================================
   CSS RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
                 'Helvetica', 'Arial', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #111827;
    background: #f9fafb;
}

/* ============================================================
   COLOR PALETTE
   ============================================================ */
:root {
    /* Primary Colors */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #dbeafe;

    /* Success */
    --color-success: #10b981;
    --color-success-light: #d1fae5;

    /* Warning */
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;

    /* Danger */
    --color-danger: #ef4444;
    --color-danger-light: #fee2e2;

    /* Info */
    --color-info: #3b82f6;
    --color-info-light: #dbeafe;

    /* Neutral */
    --color-bg: #f9fafb;
    --color-bg-card: #ffffff;
    --color-sidebar: #1e293b;
    --color-sidebar-hover: #334155;
    --color-text: #111827;
    --color-text-secondary: #6b7280;
    --color-border: #e5e7eb;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   LAYOUT - SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: var(--color-sidebar);
    color: #f1f5f9;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.sidebar-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px var(--spacing-lg);
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--color-sidebar-hover);
    color: #f1f5f9;
}

.nav-item.active {
    background: var(--color-sidebar-hover);
    color: #ffffff;
    border-left-color: var(--color-primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.nav-label {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #f1f5f9;
}

.user-role {
    font-size: 12px;
    color: #94a3b8;
}

.logout-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fecaca;
    transform: translateY(-1px);
}

.logout-button:active {
    transform: translateY(0);
}

.logout-icon {
    width: 16px;
    height: 16px;
}

/* ============================================================
   LAYOUT - MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: 250px;
    height: 100vh;
    overflow-y: auto;
    background: var(--color-bg);
}

.content-wrapper {
    max-width: 1400px;
    padding: var(--spacing-xl);
}

/* ============================================================
   COMPONENTS - CARDS
   ============================================================ */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    margin-bottom: var(--spacing-lg);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.card-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
}

/* ============================================================
   COMPONENTS - BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
}

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

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

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ============================================================
   COMPONENTS - STATUS BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--color-success-light);
    color: #065f46;
}

.badge-warning {
    background: var(--color-warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--color-danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--color-info-light);
    color: #1e40af;
}

.badge-neutral {
    background: #f3f4f6;
    color: #4b5563;
}

/* ============================================================
   COMPONENTS - STAT CARDS
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.stat-info {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.stat-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.status-dot.online {
    background: var(--color-success);
}

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

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 2000;
    width: 40px;
    height: 40px;
    background: var(--color-sidebar);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle svg {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

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

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

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

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

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

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
