* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f4f9;
    margin: 0;
    padding: 16px;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

h2 {
    margin: 0 0 20px;
    text-align: center;
    color: #333;
}

.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-btn, .action-btn {
    padding: 14px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.menu-btn:active, .action-btn:active {
    transform: scale(0.98);
    background: #0056b3;
}

.user-info {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 10px;
}

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    margin-right: 8px;
    color: #007bff;
}

.refresh-btn {
    background: none;
    border: none;
    font-size: 24px;
    margin-left: auto;
    cursor: pointer;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #007bff;
    cursor: pointer;
}

.task-card h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.task-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    background: #eee;
    margin: 6px 0;
}

.task-status.new { background: #ffc107; color: #333; }
.task-status.work { background: #17a2b8; color: white; }
.task-status.completed { background: #28a745; color: white; }
.task-status.rejected { background: #dc3545; color: white; }
.task-status.transferred { background: #6c757d; color: white; }

.task-address {
    font-size: 14px;
    color: #555;
    word-break: break-word;
}

.detail-block {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.detail-label {
    font-weight: bold;
    margin-bottom: 6px;
}

.task-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.action-btn.reject { background: #dc3545; }
.action-btn.transfer { background: #6c757d; }
.action-btn.accept { background: #17a2b8; }

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

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 20px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
}

textarea, input[type="file"] {
    width: 100%;
    padding: 10px;
    margin: 8px 0 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

.stub-content {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

img {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
}

.detail-block img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: 8px;
    cursor: pointer;
}

/* Стили для информационного модального окна */
.modal-content.info-modal {
    text-align: center;
}
.modal-content.success {
    border-top: 6px solid #28a745;
}
.modal-content.error {
    border-top: 6px solid #dc3545;
}
.modal-content.info {
    border-top: 6px solid #007bff;
}
#infoModalMessage {
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.4;
}
#infoModalOkBtn {
    width: 100%;
    margin-top: 10px;
}

/* Мини-бар статистики на главном экране */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 30px;
}

.stats-badges {
    display: flex;
    gap: 10px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 18px;
    font-weight: bold;
    font-size: 16px;
    color: white;
    padding: 0 8px;
}

.stat-badge.new { background: #ffc107; color: #333; }
.stat-badge.work { background: #17a2b8; }
.stat-badge.completed { background: #28a745; }

.user-info {
    display: flex;
    gap: 12px;
    font-size: 14px;
}

/* Фильтр в списке задач */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.filter-btn {
    background: #e9ecef;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #007bff;
    color: white;
}

.filter-btn:active {
    transform: scale(0.95);
}

/* Дополнительные стили, добавленные для улучшения интерфейса */
.detail-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
}

.detail-row .detail-label {
    font-weight: bold;
    min-width: 70px;
    color: #555;
}

/* Lightbox */
#lightboxModal {
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightboxModal .close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    border: none;
}

#lightboxImage {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
}

/* Улучшенный заголовок страницы с задачей */
.page-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;
    font-size: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.back-btn {
    font-size: 28px;
    line-height: 1;
    padding: 4px 8px;
}

/* Splash screen */
#splashScreen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #f4f4f9;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s;
}
.splash-content { text-align: center; }
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ddd;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Публичный режим */
.public-header {
    background: #ffc107;
    color: #333;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: bold;
}
.public-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}