:root {
    --bg-main: #f3f4f6; /* Light gray background */
    --bg-card: #ffffff; /* White cards */
    --bg-sidebar: #1e1e2d; /* Dark sidebar */
    --text-main: #333333;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    
    --primary: #f2553b; /* Orange/Red accent from image */
    --primary-hover: #d1412b;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    
    --blue: #3b82f6;
    --green: #10b981;
    --purple: #8b5cf6;
    --orange: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.sidebar-header p {
    font-size: 0.8rem;
    color: #9ca3af;
}

.nav-links {
    list-style: none;
    padding: 1rem 0;
}

.nav-links li {
    padding: 0.5rem 1.5rem;
}

.nav-links a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-links li.active a, .nav-links a:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.text-danger { color: #fca5a5 !important; }
.text-danger:hover { background-color: rgba(239,68,68,0.2) !important; color: white !important; }


/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.top-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

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

/* Status Badges */
.status-badges {
    display: flex;
    gap: 15px;
}
.badge {
    background: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot.green { background-color: #10b981; box-shadow: 0 0 8px #10b981; }
.dot.red { background-color: #ef4444; }

@keyframes blink { 50% { opacity: 0.4; } }
.blink { animation: blink 1s infinite; }

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-card .icon {
    width: 60px; height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}
.icon.purple { background-color: rgba(139, 92, 246, 0.1); color: var(--purple); }
.icon.green { background-color: rgba(16, 185, 129, 0.1); color: var(--green); }
.icon.blue { background-color: rgba(59, 130, 246, 0.1); color: var(--blue); }
.icon.orange { background-color: rgba(245, 158, 11, 0.1); color: var(--orange); }

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-card .number {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-card p {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* --- Layout Grid --- */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 900px) {
    .grid-2-col { grid-template-columns: 1fr; }
}

.panel {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.panel h2 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* --- Table --- */
.ip-table {
    width: 100%;
    border-collapse: collapse;
}

.ip-table th, .ip-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.ip-table th { color: var(--text-muted); font-size: 0.9rem; }
.ip-table td { font-size: 0.95rem; }

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }
label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: #475569; font-weight: 500; }
input[type="text"], input[type="url"], input[type="password"], input[type="file"] {
    width: 100%; padding: 0.75rem; border-radius: 8px;
    border: 1px solid var(--border-color); font-size: 0.95rem;
}
input:focus { outline: none; border-color: var(--primary); }

.btn {
    padding: 0.75rem 1.5rem; border-radius: 8px; border: none; font-weight: 600; cursor: pointer;
}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-danger { background-color: var(--danger); color: white; }

/* --- Login --- */
.login-body { display: flex; align-items: center; justify-content: center; background-color: var(--bg-sidebar); }
.login-container {
    background: white; padding: 2.5rem; border-radius: 15px; width: 400px;
    color: var(--text-main);
}
.login-container h2 { text-align: center; margin-bottom: 2rem; color: var(--bg-sidebar); }
.login-container .btn { width: 100%; margin-top: 10px; }
