/**
 * LogControl Assembler Mobile Web App Stylesheet
 */
:root {
    --asm-primary: #0284c7;
    --asm-primary-dark: #0369a1;
    --asm-bg: #0f172a;
    --asm-surface: #1e293b;
    --asm-card: #ffffff;
    --asm-text: #0f172a;
    --asm-muted: #64748b;
    --asm-border: #e2e8f0;
    --asm-green: #10b981;
    --asm-amber: #f59e0b;
    --asm-red: #ef4444;
}

.logcontrol-assembler-app {
    max-width: 540px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--asm-text);
    padding-bottom: 80px;
}

/* APP HEADER */
.app-header {
    background: #0f172a;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: #334155;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.sub-greeting {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    display: block;
}

.user-name {
    font-size: 16px;
    font-weight: 700;
}

.btn-logout {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 12px;
    padding: 6px 10px;
    border: 1px solid #475569;
    border-radius: 6px;
}

/* NAVEGAÇÃO DE ABAS MOBILE */
.app-tabs {
    display: flex;
    background: #1e293b;
    border-bottom: 2px solid #334155;
}

.tab-item {
    flex: 1;
    background: none;
    border: none;
    padding: 14px 10px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 3px solid transparent;
}

.tab-item.active {
    color: #ffffff;
    border-bottom-color: var(--asm-primary);
}

.badge-count {
    background: var(--asm-primary);
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10px;
}

/* CARDS DE ORDENS MOBILE */
.orders-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f1f5f9;
}

.mobile-order-card {
    background: #ffffff;
    border: 1px solid var(--asm-border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.status-border-scheduled { border-left: 6px solid var(--asm-primary); }
.status-border-dispatched { border-left: 6px solid #a855f7; }
.status-border-arrived, .status-border-in_assembly { border-left: 6px solid #06b6d4; }
.status-border-incident { border-left: 6px solid var(--asm-red); }

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-tag {
    font-weight: 800;
    font-size: 14px;
    color: #0f172a;
}

.customer-info h3 {
    margin: 0 0 10px 0;
    font-size: 17px;
    font-weight: 700;
}

/* BOTÕES DE CONTATO RÁPIDO */
.quick-contact-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.quick-btn {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-call { background: #e0f2fe; color: #0284c7; }
.btn-whatsapp { background: #dcfce7; color: #15803d; }
.btn-gps { background: #fef3c7; color: #b45309; }

.address-box {
    background: #f8fafc;
    border: 1px solid var(--asm-border);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.products-box {
    font-size: 13px;
    margin-bottom: 14px;
}

.mini-items-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
}

.mini-items-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed var(--asm-border);
}

.btn-manual {
    background: #f1f5f9;
    color: #334155;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #cbd5e1;
}

.order-notes-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    margin-bottom: 14px;
}

/* BOTÕES DE AÇÃO OPERACIONAL MOBILE */
.action-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.btn-action {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.btn-dispatch-action {
    background: #9333ea;
    color: #ffffff;
}

.btn-checkin-action {
    background: #0284c7;
    color: #ffffff;
}

.btn-complete-action {
    background: #10b981;
    color: #ffffff;
}

.btn-incident-action {
    background: #ef4444;
    color: #ffffff;
}

/* MODAIS MOBILE */
.modal-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-dialog-card {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--asm-border);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
}

.btn-close-app-modal {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--asm-muted);
}

/* ASSINATURA CANVAS */
.signature-canvas-wrap {
    border: 2px dashed #94a3b8;
    border-radius: 10px;
    background: #ffffff;
    touch-action: none;
    margin-top: 6px;
    overflow: hidden;
}

.signature-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 180px;
    background: #ffffff;
}

.canvas-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.btn-clear-canvas {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

.btn-photo-trigger {
    width: 100%;
    min-height: 44px;
    background: #f8fafc;
    border: 1px dashed var(--asm-primary);
    color: var(--asm-primary);
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    margin-top: 6px;
}

.preview-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.preview-photos-grid .preview-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.btn-submit-complete {
    width: 100%;
    min-height: 48px;
    background: var(--asm-green);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    margin-top: 18px;
    cursor: pointer;
}

.btn-submit-incident {
    width: 100%;
    min-height: 48px;
    background: var(--asm-red);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    margin-top: 16px;
    cursor: pointer;
}

/* SPINNER GPS */
.spinner-circle {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--asm-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 16px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-agenda-card {
    text-align: center;
    padding: 48px 20px;
    background: #ffffff;
    border-radius: 12px;
    margin: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.empty-icon {
    font-size: 42px;
}

.service-report {
    margin: 14px 0;
    padding: 12px;
    border: 1px solid var(--asm-border);
    border-radius: 8px;
    background: #f8fafc;
}

.service-report summary {
    color: var(--asm-primary-dark);
    font-weight: 700;
    cursor: pointer;
}

.service-report-content {
    padding-top: 10px;
    font-size: 13px;
}

.service-report-content p {
    margin: 8px 0;
}

.service-report-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.service-report-photos img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 6px;
}

.service-report-signature {
    display: block;
    max-width: 100%;
    max-height: 110px;
    padding: 6px;
    border: 1px solid var(--asm-border);
    background: #ffffff;
}

.service-report-incident {
    margin: 10px 0;
    padding: 8px;
    border-left: 3px solid var(--asm-red);
}

.commission-earn {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--asm-border);
    font-size: 13px;
}
