:root {
    --primary: #1E3A8A;
    --primary-light: #3B82F6;
    --accent: #F59E0B;
    --danger: #EF4444;
    --success: #10B981;
    --bg-dark: #0F172A;
    --bg-light: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border: #E2E8F0;
}

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

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Login Screen */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
}

.login-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

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

.logo-icon {
    font-size: 48px;
    color: var(--primary-light);
    margin-bottom: 12px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.login-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.error-msg {
    color: var(--danger);
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-muted);
    font-size: 11px;
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-dark);
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
    padding: 24px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #60A5FA;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
}

.nav-item .badge {
    margin-left: auto;
    background-color: var(--danger);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 12px;
}

.sidebar-footer {
    padding: 16px 20px;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.user-info i {
    font-size: 28px;
    color: #60A5FA;
}

.user-info strong {
    display: block;
    font-size: 13px;
    color: white;
}

.user-info small {
    color: #94A3B8;
    font-size: 11px;
}

.btn-logout {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-logout:hover {
    color: var(--danger);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 70px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 4px;
}

.status-pill.online {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-pill.online i {
    font-size: 8px;
}

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

.btn-secondary {
    background-color: #F1F5F9;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background-color: #E2E8F0;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.btn-icon:hover {
    background-color: #F1F5F9;
}

.content-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.stat-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--primary-light); }
.stat-icon.red { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; }

.stat-info h3 {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

/* Dashboard Grid & Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

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

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

.badge.blue { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.badge.red { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge.green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge.orange { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.badge.purple { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-weight: 600;
}

.btn-sm:hover {
    background: #F1F5F9;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

/* System Health List */
.system-health-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.system-health-list li {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.system-health-list strong {
    color: var(--success);
}

/* Terminal */
.terminal-box {
    background-color: #0F172A;
    color: #38BDF8;
    padding: 16px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 12px;
    height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 14px;
    z-index: 1001;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
}
