:root {
    --primary: #3b82f6;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-light: #64748b;
    --danger: #ef4444;
    --success: #22c55e;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-shrink: 0;
    transition: width 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
}

/* COLLAPSED STATE */
body.sidebar-collapsed .sidebar {
    width: 80px;
    padding: 20px 10px;
    align-items: center;
}

body.sidebar-collapsed .sidebar h2,
body.sidebar-collapsed .sidebar a span,
body.sidebar-collapsed .sidebar-footer a span {
    display: none;
}

body.sidebar-collapsed .sidebar h2 {
    justify-content: center;
    margin-bottom: 30px;
}

body.sidebar-collapsed .sidebar a {
    justify-content: center;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

body.sidebar-collapsed .sidebar a i {
    font-size: 1.2rem;
    margin: 0;
}

body.sidebar-collapsed .sidebar-toggle-btn {
    align-self: center;
    margin-bottom: 30px;
}

.sidebar h2 {
    margin-bottom: 30px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 30px;
    color: white;
}

.sidebar a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px;
    margin-bottom: 5px;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* TOGGLE BUTTON (HEADER) */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #e2e8f0;
}

/* TOGGLE BUTTON (SIDEBAR INTERNAL) */
.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
    margin-bottom: 20px;
    align-self: flex-start;
    transition: color 0.2s;
}

.sidebar-toggle-btn:hover {
    color: white;
}

.sidebar a:hover,
.sidebar a.active {
    background-color: #334155;
    color: white;
}

.sidebar-footer {
    margin-top: auto;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    color: var(--text-main);
    margin: 0;
    font-weight: 700;
}

/* CARDS & GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    border: 1px solid #e2e8f0;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
    color: var(--primary);
}

.card h3 {
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.card p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* BUTTONS */
button,
.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover,
.btn:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.btn-delete,
.btn-del,
.btn-warning {
    background-color: #fee2e2;
    color: var(--danger);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: none;
}

.btn-delete:hover,
.btn-del:hover {
    background-color: #fecaca;
}

.btn-stop {
    background-color: #ffedd5;
    color: #c2410c;
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* TABLES */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:hover {
    background-color: #f8fafc;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-light);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        padding: 15px;
        box-sizing: border-box;
    }

    .main-content {
        overflow: visible;
    }
}