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

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

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    color: #6c757d;
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
    color: #495057;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: white;
}

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

.btn-login {
    padding: 12px 20px;
    font-size: 1rem;
    margin-top: 10px;
}

.login-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

/* Dashboard Screen */
.dashboard-screen {
    display: none;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

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

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Panels */
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
}

.panel-body {
    padding: 20px;
    height: 600px;
    overflow-y: auto;
}

/* User List */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-item {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.user-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.user-item.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.user-item .user-id {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.user-item .user-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

/* User Form Display */
.user-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.form-section h4 {
    color: #495057;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

/* Editable Sections */
.editable-section {
    position: relative;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.section-header h4 {
    margin: 0;
    padding: 0;
    border: none;
}

.section-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.form-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    min-height: 24px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label {
    font-weight: 500;
    color: #495057;
    min-width: 120px;
    margin-right: 15px;
    padding-top: 2px;
}

.form-row span {
    color: #6c757d;
    flex: 1;
    word-break: break-word;
}

/* Edit Inputs */
.edit-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.4;
    background: white;
    color: #495057;
    transition: border-color 0.2s ease;
}

.edit-input:focus {
    outline: none;
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-input textarea {
    resize: vertical;
    min-height: 80px;
}

textarea.edit-input {
    resize: vertical;
    min-height: 80px;
}

/* Readonly values in editing mode */
.readonly-value {
    color: #6c757d;
    flex: 1;
    word-break: break-word;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

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

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

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

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

.btn-small {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.actions {
    display: flex;
    gap: 5px;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* Data Sections */
.data-section h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
}

.data-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
}

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

.data-item .data-title {
    font-weight: 600;
    color: #495057;
}

.data-item .data-content {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.data-item .data-meta {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-top: 10px;
}

/* Profile specific styling */
.profile-item {
    border-left: 4px solid #667eea;
}

.event-item {
    border-left: 4px solid #28a745;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Empty sections */
.empty-section {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
    margin: 10px 0;
}

/* Hidden fields (shown only during editing) */
.hidden-field {
    display: none !important;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* Error */
.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

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

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

.modal-content h3 {
    margin-bottom: 15px;
    color: #495057;
}

.modal-content p {
    margin-bottom: 20px;
    color: #6c757d;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #dc3545;
}

/* JSON Viewer */
.json-viewer {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Edit Mode Styling */
.editable-section.editing {
    border-color: #667eea;
    background: #f8f9ff;
}

.edit-highlight {
    background: #fff3cd;
    border-color: #ffeaa7;
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .panel-body {
        height: auto;
        max-height: 400px;
    }
    
    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-row label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 4px;
        font-weight: 600;
    }
    
    .edit-input {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .actions {
        flex-direction: column;
        gap: 2px;
    }
    
    .data-item .data-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}