* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-right: 1px solid #dc2626;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-240px);
}

.expand-btn {
    position: fixed;
    left: 40px;
    top: 20px;
    width: 40px;
    height: 40px;
    background: rgba(220, 38, 38, 0.9);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.expand-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.05);
}

.sidebar.collapsed + .main-wrapper .expand-btn {
    display: flex;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(220, 38, 38, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #dc2626;
    text-decoration: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.sidebar-toggle i {
    transition: transform 0.3s ease;
}

.nav-links {
    list-style: none;
    padding: 1rem 0;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.nav-links a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-links a:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border-left-color: #dc2626;
}

.nav-links a.active {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
    border-left-color: #dc2626;
}

.user-menu {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(220, 38, 38, 0.3);
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.user-details span {
    display: block;
    color: #b0b0b0;
    font-size: 0.85rem;
}

.user-details .username {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.95rem;
}

.logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    color: #dc2626;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.2);
}

.main-wrapper {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper.expanded {
    margin-left: 0;
}

.top-bar {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(220, 38, 38, 0.3);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: none;
}

.mobile-menu-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.page-title {
    font-size: 1.5rem;
    color: #dc2626;
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.container {
    max-width: none;
    margin: 0;
    padding: 0;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(220, 38, 38, 0.3);
}

.card-title {
    font-size: 1.5rem;
    color: #dc2626;
    font-weight: bold;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #dc2626;
    color: white;
}

.btn-primary:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-success {
    background: #16a34a;
    color: white;
}

.btn-warning {
    background: #ca8a04;
    color: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e0e0e0;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-control::placeholder {
    color: rgba(224, 224, 224, 0.5);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table th {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
    font-weight: bold;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-online { background: #16a34a; color: white; }
.status-offline { background: #dc2626; color: white; }
.status-maintenance { background: #ca8a04; color: white; }
.status-active { background: #16a34a; color: white; }
.status-suspended { background: #dc2626; color: white; }
.status-pending { background: #ca8a04; color: white; }

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(22, 163, 74, 0.2);
    border: 1px solid #16a34a;
    color: #4ade80;
}

.alert-error {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid #dc2626;
    color: #f87171;
}

.alert-warning {
    background: rgba(202, 138, 4, 0.2);
    border: 1px solid #ca8a04;
    color: #facc15;
}

.alert-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    color: #60a5fa;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(220, 38, 38, 0.3);
    text-align: center;
    padding: 1rem 2rem;
    margin-top: auto;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.spinner {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 2px solid #dc2626;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b91c1c;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-280px);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .main-content {
        padding: 1rem;
    }

    .top-bar {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }
}