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

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    color: #2C3E50;
    margin: 0;
    padding: 0;
}

#appContainer {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.header {
    background: #0F1724;
    color: #fff;
    padding: 0.8rem 0;
    border-bottom: 3px solid #E67E22;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #E67E22, #D35400);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

.logo-text h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}

.logo-text h1 span {
    color: #E67E22;
    font-weight: 300;
}

.logo-text .subtitle {
    font-size: 0.6rem;
    color: #6C757D;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.storage-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.7rem;
    color: #27AE60;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.btn-toggle-storage {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
}

.btn-toggle-storage:hover {
    background: #E67E22;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

.section-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #e2e8f0;
    padding: 0.4rem;
    border-radius: 16px;
    justify-content: space-between;
    overflow-x: auto;
}

.nav-btn {
    flex: 1;
    text-align: center;
    padding: 0.8rem 1.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #0f172a;
}

.nav-btn.active {
    background: #fff;
    color: #e67e22;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.section-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Tarjetas de Pasos */
.steps-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.step-card-header {
    background: #f8fafc;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-number {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.25);
}

.step-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.step-card-body {
    padding: 1.8rem;
}

.premium-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, rgba(226, 232, 240, 0) 0%, rgba(226, 232, 240, 1) 50%, rgba(226, 232, 240, 0) 100%);
    margin: 1.5rem 0;
}

/* Pantalla de Acceso */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0F1724;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1.5rem;
    transition: opacity 0.5s ease;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.5s ease;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    font-size: 2rem;
}

.login-logo h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0F1724;
}

.login-logo h2 span {
    color: #E67E22;
    font-weight: 300;
}

.login-card p {
    color: #6C757D;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.card {
    background: #fff;
    border-radius: 20px;
    padding: 1.8rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title i {
    color: #e67e22;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: #495057;
}

.form-label i {
    color: #E67E22;
    margin-right: 0.3rem;
}

.form-label .required {
    color: #E74C3C;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #E9ECEF;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    background: #fff;
    color: #343A40;
}

.form-control:focus {
    border-color: #E67E22;
    outline: none;
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.08);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C757D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #E67E22, #D35400);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #27AE60, #1E8449);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: #fff;
}

.btn-accent {
    background: linear-gradient(135deg, #3498DB, #2980B9);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #F39C12, #D68910);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #495057;
    border: 2px solid #DEE2E6;
}

.btn-outline:hover {
    background: #F1F3F5;
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.material-selector {
    display: flex;
    gap: 0.8rem;
    margin: 0.8rem 0;
    flex-wrap: wrap;
}

.material-selector select {
    flex: 2;
    min-width: 150px;
}

.material-selector input {
    flex: 1;
    min-width: 80px;
}

.materials-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0;
}

.material-card {
    background: #fff;
    border: 1px solid #E9ECEF;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.material-card:hover {
    border-color: #E67E22;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.1);
}

.material-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    color: #0F1724;
    font-size: 1rem;
}

.material-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.material-card-body {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    margin-top: 0.3rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #E9ECEF;
}

.material-price {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.material-price span {
    font-size: 0.75rem;
    color: #6C757D;
}

.material-price strong {
    font-size: 1.1rem;
    color: #E67E22;
    font-weight: 700;
}

.material-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.material-actions .form-control {
    width: 70px;
    text-align: center;
    padding: 0.4rem;
    height: 36px;
    border-radius: 6px;
}

.material-actions .btn-danger {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #ADB5BD;
}

.totales {
    background: #F8F9FA;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    border: 1px solid #E9ECEF;
}

.total-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.total-item.grand-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #E67E22;
    border-top: 2px solid #E67E22;
    padding-top: 0.5rem;
    margin-top: 0.3rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: #D4EDDA;
    color: #155724;
}

.badge-warning {
    background: #FFF3CD;
    color: #856404;
}

.badge-danger {
    background: #F8D7DA;
    color: #721C24;
}

.badge-info {
    background: #D1ECF1;
    color: #0C5460;
}

.badge-secondary {
    background: #E9ECEF;
    color: #495057;
}

.preview-card {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.preview-content {
    background: #F8F9FA;
    border-radius: 8px;
    padding: 1.2rem;
    min-height: 150px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #E9ECEF;
}

.preview-total-item {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.85rem;
}

.preview-total-item.grand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #E67E22;
    border-top: 2px solid #E67E22;
    padding-top: 0.4rem;
    margin-top: 0.2rem;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #ADB5BD;
}

.empty-state i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    color: #DEE2E6;
}

.empty-state h3 {
    color: #6C757D;
}

.form-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 100px;
}

.footer {
    background: #0F1724;
    color: rgba(255, 255, 255, 0.7);
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 3px solid #E67E22;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-brand i {
    font-size: 1.2rem;
    color: #E67E22;
}

.footer-brand span {
    font-weight: 700;
    color: #fff;
}

.footer-brand span small {
    font-weight: 300;
    color: #6C757D;
}

.historial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.historial-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #E9ECEF;
    border-left: 4px solid #E67E22;
    transition: all 0.3s;
}

.historial-card:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.historial-card .card-header {
    margin-bottom: 0.3rem;
    padding-bottom: 0;
    border-bottom: none;
}

.historial-card .card-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.historial-card .cliente {
    color: #6C757D;
    font-size: 0.85rem;
}

.historial-card .total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #E67E22;
}

.historial-card .fecha {
    font-size: 0.75rem;
    color: #ADB5BD;
}

.historial-card .card-actions {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #E9ECEF;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.config-card {
    background: #F8F9FA;
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid #E9ECEF;
}

.config-card h4 {
    margin-bottom: 0.8rem;
    color: #0F1724;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-card h4 i {
    color: #E67E22;
}

.config-card .config-option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-card .radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.2rem 0;
}

.config-card .radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #E67E22;
}

.config-card .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    border-bottom: 1px solid #E9ECEF;
}

.config-card .stat-item:last-child {
    border-bottom: none;
}

.historial-controls {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.historial-controls .search-group {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.historial-controls .search-group i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #ADB5BD;
}

.historial-controls .search-group input {
    padding-left: 2.2rem;
}

.historial-controls .filter-group {
    display: flex;
    gap: 0.5rem;
}

.historial-controls .filter-group select {
    min-width: 100px;
}

.historial-controls .actions-group {
    display: flex;
    gap: 0.5rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 36, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem 0.8rem;
    border-bottom: 2px solid #E9ECEF;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0F1724;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.modal-header h3 i {
    color: #E67E22;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #F1F3F5;
    color: #6C757D;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #E74C3C;
    color: #fff;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.2rem 1.5rem;
}

.modal-body p {
    color: #495057;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0.3rem 0;
}

.modal-body .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid #E9ECEF;
}

.modal-body .detail-row:last-child {
    border-bottom: none;
}

.modal-footer {
    padding: 0.8rem 1.5rem 1.2rem;
    border-top: 2px solid #E9ECEF;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex: 1;
    justify-content: center;
    min-width: 80px;
}

.security-box {
    padding: 0.2rem 0;
}

.security-box .form-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
}

.multiplicador-btn.active {
    background: linear-gradient(135deg, #E67E22, #D35400);
    color: #fff;
    border-color: #E67E22;
}

@media (min-width: 1025px) {
    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 850px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .preview-card {
        position: static;
    }

    .desktop-only {
        display: none !important;
    }
}

@media (max-width:768px) {
    .container {
        padding: 0 1rem;
    }

    .header .container {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        text-align: center;
    }

    .logo {
        justify-content: center;
    }

    .header-actions {
        justify-content: center;
    }

    .section-nav {
        justify-content: center;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .nav-btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .nav-btn span {
        display: none;
    }

    .nav-btn i {
        font-size: 1rem;
        margin: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .form-label {
        text-align: center;
    }

    .card {
        padding: 1rem;
    }

    .card-title {
        justify-content: center;
        text-align: center;
    }

    .material-selector {
        flex-direction: column;
    }

    .material-selector select,
    .material-selector input {
        width: 100% !important;
        text-align: center;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .form-control,
    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .step-card-header {
        padding: 0.8rem 1rem;
        gap: 0.6rem;
    }

    .step-card-header h3 {
        font-size: 1rem;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .step-card-body {
        padding: 1rem;
    }

    .step-card {
        margin-bottom: 1rem;
    }

    .historial-grid {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .security-box .form-row {
        grid-template-columns: 1fr;
    }

    .totales {
        text-align: center;
    }
}