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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.screen {
    display: none;
    flex-direction: column;
    height: 100vh;
}

.screen.active {
    display: flex;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 70px;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.back-btn {
    position: absolute;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.footer {
    padding: 15px 20px;
    background-color: #fff;
    border-top: 1px solid #eee;
}

.import-section {
    text-align: center;
    padding: 60px 20px;
}

.import-section h2 {
    margin-bottom: 30px;
    color: #555;
}

#excel-import {
    display: block;
    margin: 0 auto 15px;
    padding: 15px 30px;
    border: 2px dashed #667eea;
    border-radius: 10px;
    background-color: #f8f9ff;
    cursor: pointer;
    font-size: 14px;
}

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

.departments-list,
.assets-list,
.pending-list,
.legacy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.department-item,
.asset-item,
.pending-item,
.legacy-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.department-item:hover,
.asset-item:hover,
.pending-item:hover,
.legacy-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.asset-item.selected {
    border: 2px solid #28a745;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.asset-item.selected .asset-name {
    color: #155724;
    font-weight: 700;
}

.department-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.department-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

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

.status-badge.green {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.red {
    background-color: #f8d7da;
    color: #721c24;
}

.asset-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.asset-detail {
    font-size: 13px;
    color: #666;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.asset-detail span {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.footer-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.footer-btn {
    background-color: #f0f0f0;
    color: #333;
}

.footer-btn:hover {
    background-color: #e0e0e0;
}

.footer-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.footer-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

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

.footer-btn.danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

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

.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.photo-preview {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-top: 10px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.photo-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.photo-thumb:hover {
    transform: scale(1.05);
}

@media (min-width: 800px) {
    #app {
        border-radius: 10px;
        margin: 20px auto;
        min-height: calc(100vh - 40px);
    }
}