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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.divider {
    text-align: center;
    margin: 20px 0;
    color: #999;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    width: 100%;
}

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

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #38a169;
}

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

.btn-danger:hover:not(:disabled) {
    background: #e53e3e;
}

.btn-info {
    background: #4299e1;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #3182ce;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.error-msg {
    padding: 12px;
    background: #fed7d7;
    color: #c53030;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid #c53030;
}

.success-msg {
    padding: 12px;
    background: #c6f6d5;
    color: #22543d;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid #22543d;
}

.info-box {
    padding: 20px;
    background: #e6fffa;
    color: #234e52;
    border-radius: 5px;
    margin: 15px 0;
    text-align: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header-left h1 {
    font-size: 24px;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.badge-admin {
    background: #fbd38d;
    color: #7c2d12;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

/* Content */
.content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.content h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Upload Form */
.upload-form {
    max-width: 500px;
}

.file-info {
    padding: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 14px;
}

/* Files List */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.file-meta {
    font-size: 12px;
    color: #999;
}

.file-actions {
    display: flex;
    gap: 10px;
}

/* Admin Section */
.admin-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.admin-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.form-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.form-card h4 {
    margin-bottom: 15px;
}

.form-card label {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 10px;
}

.form-card input[type="checkbox"] {
    margin-right: 5px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.form-actions button {
    flex: 1;
    max-width: 150px;
}

/* Locations List */
.locations-list {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.location-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #4299e1;
}

.location-info h4 {
    margin-bottom: 5px;
    color: #333;
}

.location-info p {
    font-size: 13px;
    color: #666;
    margin: 3px 0;
}

.location-actions {
    display: flex;
    gap: 10px;
}

/* Permission Form */
.permission-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin: 15px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .header-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-actions {
        width: 100%;
        margin-top: 10px;
    }

    .file-actions button {
        flex: 1;
    }

    .location-item {
        flex-direction: column;
    }

    .location-actions {
        width: 100%;
        margin-top: 10px;
    }
}

/* Users Table Styles */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.users-table thead {
    background: #f5f5f5;
    font-weight: bold;
}

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

.users-table tbody tr:hover {
    background: #f9f9f9;
}

.users-table input[type="text"],
.users-table input[type="email"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.users-table input[type="text"]:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.user-row td {
    vertical-align: middle;
}

/* Button Sizes */
.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
    margin-right: 4px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    background: #e0e0e0;
    color: #333;
    font-size: 12px;
    font-weight: bold;
}

.badge-admin {
    background: #ff6b6b;
    color: white;
}

.badge-success {
    background: #51cf66;
    color: white;
}

.badge-danger {
    background: #ff6b6b;
    color: white;
}

.badge-info {
    background: #4c6ef5;
    color: white;
}

/* Form Card */
.form-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #007bff;
}

.form-card h4 {
    margin-top: 0;
    color: #333;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 15px;
}

/* Users List */
.users-list {
    margin-top: 20px;
}

.input-disabled {
    background: #f5f5f5 !important;
    cursor: not-allowed !important;
}
