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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1rem;
}

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

.username {
    color: #2c3e50;
    font-size: 0.95rem;
}

.btn-logout {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
}

nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.nav-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-btn:hover {
    color: #2c3e50;
}

.nav-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.gpu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.gpu-card {
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.gpu-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.gpu-card.busy {
    border-color: #e74c3c;
}

.gpu-card.idle {
    border-color: #2ecc71;
}

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

.gpu-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

.status-badge.available {
    background: #d5f4e6;
    color: #27ae60;
}

.status-badge.busy {
    background: #fadbd8;
    color: #c0392b;
}

.status-badge.offline {
    background: #ecf0f1;
    color: #7f8c8d;
}

.gpu-info {
    margin-top: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 0.9rem;
}

.info-label {
    color: #7f8c8d;
}

.info-value {
    font-weight: 500;
    color: #2c3e50;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.3s;
}

.progress-fill.high {
    background: #e74c3c;
}

.progress-fill.medium {
    background: #f39c12;
}

.progress-fill.low {
    background: #2ecc71;
}

.processes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
}

.process-item {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin: 3px 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ecf0f1;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    font-size: 0.85rem;
}

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

.warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.success {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.error {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

.reservation-item {
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.reservation-item.urgent {
    border-left-color: #e74c3c;
}

.reservation-item.exclusive {
    border-left-color: #f39c12;
}

.reservation-item.shared {
    border-left-color: #3498db;
}

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

.reservation-user {
    font-weight: bold;
    color: #2c3e50;
}

.reservation-gpu {
    color: #3498db;
    font-weight: 500;
}

.reservation-time {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.reservation-desc {
    color: #555;
    font-size: 0.9rem;
    margin-top: 5px;
}

.reservation-meta {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -12px;
    transition: all 0.3s;
}

.filter-btn:hover {
    color: #2c3e50;
}

.filter-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Manageable Reservation Items */
.manageable-reservation-item {
    border: 2px solid #ecf0f1;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    transition: all 0.3s;
}

.manageable-reservation-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.manageable-reservation-item.exclusive {
    border-left: 4px solid #f39c12;
}

.manageable-reservation-item.shared {
    border-left: 4px solid #3498db;
}

.manageable-reservation-item.status-completed {
    opacity: 0.7;
    background: #f8f9fa;
}

.manageable-reservation-item.status-cancelled {
    opacity: 0.6;
    background: #fff5f5;
}

.manageable-reservation-item.status-active {
    border-color: #2ecc71;
    background: #f0fff4;
}

.reservation-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #c0392b;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 10px;
}

.status-badge.scheduled {
    background: #3498db;
    color: white;
}

.status-badge.active {
    background: #2ecc71;
    color: white;
}

.status-badge.completed {
    background: #95a5a6;
    color: white;
}

.status-badge.cancelled {
    background: #e74c3c;
    color: white;
}

.exclusive-badge, .shared-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 8px;
}

.exclusive-badge {
    background: #fff3cd;
    color: #856404;
}

.shared-badge {
    background: #d1ecf1;
    color: #0c5460;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    padding: 10px;
    min-height: 150px;
}

.calendar-date {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.calendar-reservation {
    background: #3498db;
    color: white;
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.calendar-reservation.urgent {
    background: #e74c3c;
}

/* Google Calendar Style - 24 Hour View */
.calendar-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
}

.calendar-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.calendar-day-header {
    padding: 15px 10px;
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    border-left: 1px solid #ecf0f1;
}

.calendar-body {
    position: relative;
}

.calendar-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    border-bottom: 1px solid #ecf0f1;
    min-height: 50px;
}

.time-label {
    padding: 10px;
    text-align: right;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-right: 2px solid #ddd;
    background: #f8f9fa;
}

.calendar-cell {
    border-left: 1px solid #ecf0f1;
    position: relative;
    min-height: 50px;
    padding: 2px;
}

.calendar-event {
    position: absolute;
    left: 2px;
    right: 2px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.75rem;
    overflow: hidden;
    z-index: 5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.calendar-event.urgent {
    background: #e74c3c;
}

.calendar-event.exclusive {
    background: #f39c12;
}

.calendar-event.shared {
    background: #3498db;
}

.event-time {
    font-weight: bold;
    margin-bottom: 2px;
}

.event-user {
    font-weight: 500;
}

.event-gpu {
    font-size: 0.7rem;
    opacity: 0.9;
}

.event-duration {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .gpu-grid {
        grid-template-columns: 1fr;
    }

    .calendar-header,
    .calendar-row {
        grid-template-columns: 60px repeat(7, 120px);
    }

    .calendar-container {
        overflow-x: scroll;
    }

    nav {
        flex-wrap: wrap;
    }
}
