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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #001f3f;
    min-height: 100vh;
    color: #f4f4f4;
}

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

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #003366;
    color: #f4f4f4;
}

.btn-primary:hover {
    background: #002244;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f4f4f4;
    color: #001f3f;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}

.btn-danger:hover {
    background: #922b21;
}

.btn-success {
    background: #218c74;
    color: #fff;
}

.btn-success:hover {
    background: #145a32;
}

.auth-container {
    max-width: 400px;
    margin: 100px auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.auth-title {
    text-align: center;
    margin-bottom: 30px;
    color: #f4f4f4;
    font-size: 28px;
}

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

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

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #5a67d8;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.sidebar h3 {
    color: #333;
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.key-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.key-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.key-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.key-card.available {
    border-color: #38a169;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
}

.key-card.in-use {
    border-color: #e53e3e;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

.key-card.unauthorized {
    border-color: #a0aec0;
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
    opacity: 0.6;
}

.key-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.key-icon i {
    color: #000;
}

.vehicle-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2d3748;
}

.vehicle-plate {
    color: #718096;
    font-size: 14px;
    margin-bottom: 10px;
}

.key-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.status-available {
    background: #c6f6d5;
    color: #22543d;
}

.status-in-use {
    background: #fed7d7;
    color: #8B0000;
}

.status-unauthorized {
    background: #e2e8f0;
    color: #4a5568;
}

.key-status.status-in-use,
.key-status.status-inuse {
    color: #8B0000 !important;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #003366;
    color: #f4f4f4;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.activity-log {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.activity-item {
    padding: 10px 0;
    border-bottom: 1px solid #f7fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    color: #718096;
    font-size: 12px;
}

.hidden {
    display: none !important;
}

.nav-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.nav-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-tab.active {
    border-bottom-color: #5a67d8;
    color: #5a67d8;
    font-weight: 600;
}

.nav-tab:hover {
    background: #f7fafc;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.user-table th,
.user-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.user-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.vehicle-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.vehicle-table th,
.vehicle-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.vehicle-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

#currentUser {
    color: #333;
    font-weight: bold;
}

#keyModalContent h3,
#keyModalContent p,
#keyModalContent label,
#keyModalContent,
#keyModalContent ul,
#keyModalContent li {
    color: #333;
}

#addUserModal h3,
#addVehicleModal h3 {
    color: #333;
}

#userProfile,
#userProfile p,
#currentKeyInfo,
#currentKeyInfo p,
#currentKeyInfo div {
    color: #333;
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .key-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}