* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    font-size: 13px;
}

.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-wrap: nowrap;
    gap: 15px;
}

.navbar h1 {
    font-size: 24px;
    font-weight: 600;
}

.navbar .nav-right {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    background: transparent !important;
}

.navbar .user-info {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.navbar .user-info span {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
}

.navbar a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    background: transparent;
    border-radius: 3px;
    transition: background 0.3s;
    white-space: nowrap;
}

.navbar a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.navbar-logo {
    background: transparent !important;
    padding: 0 !important;
}

.navbar img {
    background: transparent !important;
    padding: 0;
    margin: 0;
}

.navbar a.logout {
    background: #e74c3c;
}

.navbar a.logout:hover {
    background: #c0392b;
}

.user-profile-btn {
    background: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px !important;
    border-radius: 4px;
    transition: background 0.3s;
    font-weight: 600;
    white-space: nowrap;
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 3px;
    border-left: 4px solid;
}

.alert.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert.info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 13px;
}

.btn:hover {
    background: #2980b9;
}

.btn.btn-success {
    background: #27ae60;
}

.btn.btn-success:hover {
    background: #229954;
}

.btn.btn-danger {
    background: #e74c3c;
}

.btn.btn-danger:hover {
    background: #c0392b;
}

.btn.btn-warning {
    background: #f39c12;
}

.btn.btn-warning:hover {
    background: #d68910;
}

.btn.btn-secondary {
    background: #95a5a6;
}

.btn.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 3px;
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-group button {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.form-group button:hover {
    background: #2980b9;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-card.pending {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.dashboard-card.approved {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.dashboard-card.draft {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.dashboard-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.dashboard-card .number {
    font-size: 36px;
    font-weight: bold;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table thead {
    background: #34495e;
    color: white;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table tbody tr.status-draft {
    background: #fff9e6;
}

table tbody tr.status-pending {
    background: #ffe6e6;
}

table tbody tr.status-approved {
    background: #e6f3ff;
}

table tbody tr.status-rejected {
    background: #f0f0f0;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.badge.draft {
    background: #fff3cd;
    color: #856404;
}

.badge.pending {
    background: #f8d7da;
    color: #721c24;
}

.badge.approved {
    background: #d4edda;
    color: #155724;
}

.badge.rejected {
    background: #f8f9fa;
    color: #343a40;
}

/* Inspection Form */
.inspection-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.inspection-form-header h2 {
    color: #2c3e50;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 3px;
    border-left: 4px solid #3498db;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.form-full {
    grid-column: 1 / -1;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.radio-group input,
.checkbox-group input {
    width: auto;
    margin: 0;
}

/* Inspection Data Table */
.inspection-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 12px;
    background: white;
}

.inspection-table th,
.inspection-table td {
    border: 1px solid #bdc3c7;
    padding: 8px;
    text-align: left;
}

.inspection-table th {
    background: #c0c0c0;
    font-weight: bold;
    text-align: center;
}

.inspection-table input[type="text"],
.inspection-table input[type="number"] {
    width: 100%;
    padding: 4px;
    border: 1px solid #bdc3c7;
    border-radius: 2px;
    font-size: 12px;
}

.inspection-table input[type="text"]:focus,
.inspection-table input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.action-buttons a,
.action-buttons button {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h2 {
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-logo {
        flex-direction: row !important;
        margin-bottom: 10px;
    }

    .container {
        margin: 20px 10px;
        padding: 20px 15px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .inspection-table {
        font-size: 11px;
    }

    .inspection-table th,
    .inspection-table td {
        padding: 5px;
    }

    table {
        font-size: 12px;
    }

    table th,
    table td {
        padding: 8px;
    }
}
