/* UI / UX Premium para Taller 360 - App-like Overhaul */

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --primary: #3b82f6;
    --pwa-vh: 100vh;
    --surface: #ffffff;
    --background: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

html, body {
    height: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

#pwa-app-root {
    height: 100%;
    height: 100dvh;
    height: var(--pwa-vh, 100vh);
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.pt-safe {
    padding-top: var(--safe-top);
}

.pb-safe {
    padding-bottom: var(--safe-bottom);
}

/* Main App Container Tweak */
body {
    background-color: var(--background);
    color: var(--text-main);
}

/* Transitions */
.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* App-style Form Containers */
.app-form-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 30px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.dark .app-form-card {
    background-color: #1e293b;
    border-color: rgba(255,255,255,0.05);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

.app-input-group {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
}

.app-input-group:last-child {
    border-bottom: none;
}

.app-input-group:focus-within {
    background-color: rgba(59, 130, 246, 0.03);
}

.app-input-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    margin-right: 16px;
    font-size: 1.1rem;
}

.app-input-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.app-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    padding: 0;
    outline: none;
}

.app-input::placeholder {
    color: #cbd5e1;
    font-weight: 500;
}

/* Status Badges */
.badge-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-draft {
    background: #f1f5f9;
    color: #475569;
}

.badge-diagnosing {
    background: #dbeafe;
    color: #1e40af;
}

.badge-waiting_parts {
    background: #fef3c7;
    color: #92400e;
}

.badge-in_progress {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-done {
    background: #dcfce7;
    color: #166534;
}

/* FAB Center Alignment */
#btn-create-order {
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
    border: 4px solid var(--surface);
}

/* Dark Mode Overrides */
.dark {
    --surface: #1e293b;
    --background: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
}

/* Glass Effect */
.glass-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: calc(var(--safe-top) + 8px);
    padding-bottom: 8px;
}

.dark .glass-header {
    background: rgba(15, 23, 42, 0.8);
}

@keyframes bounce-subtle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.animate-bounce-subtle {
    animation: bounce-subtle 0.3s ease-in-out;
}

/* Modal UI Premium */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--surface);
    width: 100%;
    max-width: 360px;
    border-radius: 32px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.qty-modal-content {
    padding: 32px 24px;
    text-align: center;
}

.qty-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 24px 0;
}

.qty-btn {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--background);
    color: var(--text-main);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-btn-plus {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 8px 15px -3px rgba(59, 130, 246, 0.3);
}

.qty-val {
    font-size: 32px;
    font-weight: 800;
    min-width: 60px;
    color: var(--text-main);
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 24px 24px;
}

.btn-modal {
    padding: 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.btn-modal-cancel {
    background: var(--background);
    color: var(--text-muted);
}

.btn-modal-confirm {
    background: var(--primary);
    color: white;
}