* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header & Navigation */
.header {
    background: white;
    padding: 40px 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 16px;
}

.navbar {
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-radius: 10px;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.navbar h1 {
    color: #333;
    font-size: 24px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-right span {
    color: #666;
}

.btn-back {
    color: #667eea;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.btn-back:hover {
    color: #764ba2;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-logout {
    background: #ff6b6b;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-logout:hover {
    background: #ff5252;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    margin-top: 10px;
}

/* Content Layout */
.content {
    background: white;
    padding: 40px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Forms */
.form-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
}

.form-container h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Return page file input and preview */
.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
}

.file-preview img {
    display: block;
    max-height: 360px;
    width: auto;
    margin: 0 auto;
}

.file-name {
    font-size: 13px;
    color: #666;
}

@media (max-width: 480px) {
    .form-container { padding: 20px; }
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Messages */
.message {
    margin: 20px 0;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard */
.dashboard-content {
    padding: 30px 20px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.menu-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.menu-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.menu-card h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.menu-card p {
    color: #666;
    font-size: 14px;
}

/* Scan Page */
.scan-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.scan-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.camera-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 1 / 1;
}

.camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-hint {
    text-align: center;
    color: #666;
    margin-top: 15px;
}

.scan-mode {
    text-align: center;
}

/* Asset Details */
.asset-details-container {
    padding: 30px 20px;
}

.asset-card,
.status-card,
.borrow-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.asset-card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.asset-details {
    color: #666;
    line-height: 1.8;
}

.asset-details p {
    margin-bottom: 10px;
}

.asset-details strong {
    color: #333;
}

.status-card {
    text-align: center;
}

.status-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.status-card p {
    color: #666;
}

#availableStatus {
    color: #155724;
}

#availableStatus h3 {
    color: #155724;
}

#borrowedStatus {
    color: #721c24;
}

#borrowedStatus h3 {
    color: #721c24;
}

.borrow-form h3 {
    color: #333;
    margin-bottom: 20px;
}

/* Success Page */
.success-page {
    background: white;
    padding: 60px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.success-icon {
    font-size: 80px;
    color: #28a745;
    margin-bottom: 20px;
}

.success-page h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 20px;
}

.success-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin: 30px 0;
    text-align: left;
}

.success-details p {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
}

.success-details strong {
    color: #333;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.action-buttons a {
    padding: 12px 30px;
}

/* Borrowing List */
.borrowing-list-container {
    padding: 30px 20px;
}

.borrowing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.borrowing-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #667eea;
}

.borrowing-card.returned {
    border-left-color: #28a745;
}

.borrowing-card.overdue {
    border-left-color: #ff6b6b;
}

.borrowing-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.borrowing-header h3 {
    color: #333;
    font-size: 18px;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e9ecef;
    color: #495057;
}

.status-badge.borrowed {
    background: #cfe2ff;
    color: #084298;
}

.status-badge.returned {
    background: #d1e7dd;
    color: #0f5132;
}

.status-badge.overdue {
    background: #f8d7da;
    color: #842029;
}

.borrowing-details {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.borrowing-details p {
    margin-bottom: 8px;
}

.borrowing-details strong {
    color: #333;
}

.empty-message {
    background: white;
    padding: 60px 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.empty-message p {
    color: #666;
    margin-bottom: 20px;
    font-size: 16px;
}

/* Document Upload Styles */
.document-item {
    position: relative;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.document-item input[type="file"] {
    display: block;
    margin-bottom: 5px;
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.document-item small {
    display: block;
    color: #999;
    font-size: 12px;
}

.remove-doc-btn {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.remove-doc-btn:hover {
    background: #c82333;
}

.remove-doc-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.file-name {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

#documentsSection small {
    display: block;
    margin-bottom: 15px;
    color: #999;
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 10px;
    }

    .navbar-right {
        width: 100%;
        justify-content: center;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group a {
        width: 100%;
        text-align: center;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 30px 20px;
        max-width: 100%;
    }

    .success-page {
        padding: 40px 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .borrowing-grid {
        grid-template-columns: 1fr;
    }

    .borrowing-header {
        flex-direction: column;
        gap: 10px;
    }
}
