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

:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #0c2340;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --surface-strong: #e2e8f0;
    --text: #0f172a;
    --muted: #475569;
    --border: #dbe2ef;
    --success: #059669;
    --danger: #dc2626;
    --radius: 20px;
}

html {
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 22%),
                radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.1), transparent 24%),
                #eef4ff;
    padding: 24px 18px;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    pointer-events: none;
    z-index: -1;
}

/* override outer max width */
.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

.card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    padding: 32px;
    margin-bottom: 20px;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.header {
    display: grid;
    grid-template-columns: minmax(180px, 300px) 1fr minmax(120px, 220px);
    gap: 24px;
    align-items: center;
    padding: 28px 24px;
    border-radius: calc(var(--radius) + 4px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.88));
    border: 1px solid rgba(59, 130, 246, 0.12);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo img {
    width: 100%;
    max-width: 220px;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    padding: 18px;
    background: rgba(255,255,255,0.95);
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.header-center h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.9rem;
    line-height: 1.05;
    color: var(--primary-dark);
    letter-spacing: -0.03em;
}

.header-center .fecha {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.company-info-center {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.company-info-center strong {
    color: var(--text);
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.tab {
    padding: 14px 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.tab:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--primary-dark);
    border-color: rgba(59, 130, 246, 0.18);
}

.tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 18px 30px rgba(59, 130, 246, 0.18);
}

.tab-content {
    display: none;
}

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

.section-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary-dark);
    font-size: 1.7rem;
    margin-bottom: 22px;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: grid;
    gap: 10px;
}

label {
    font-weight: 700;
    color: var(--text);
    font-size: 0.9rem;
}

input[type='text'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='email'],
input[type='tel'],
input[type='password'],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type='text']:focus,
input[type='number']:focus,
input[type='date']:focus,
input[type='time']:focus,
input[type='email']:focus,
input[type='tel']:focus,
input[type='password']:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.08);
    background: #fff;
}

/* En móvil, tamaño de letra mínimo en inputs de fecha/hora para que iOS no haga
   zoom automático y el calendario nativo se abra correctamente. */
@media (max-width: 760px) {
    input[type='date'],
    input[type='time'] {
        font-size: 16px;
    }
}

.tipo-calculo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.btn-tipo {
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-tipo:hover {
    background: var(--surface);
    border-color: rgba(59, 130, 246, 0.16);
}

.btn-tipo.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 14px 28px rgba(59, 130, 246, 0.18);
}

.area-section {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 22px;
    display: none;
}

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

.area-section h3 {
    color: var(--primary);
    margin-bottom: 18px;
    font-size: 1.1rem;
}

.area-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.area-result {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 18px 20px;
    margin-top: 18px;
    display: none;
}

.area-result p {
    color: var(--muted);
    font-size: 0.94rem;
    margin-bottom: 8px;
}

.area-result strong {
    color: var(--success);
    font-size: 1rem;
}

.btn {
    padding: 14px 22px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.22);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(16, 185, 129, 0.18);
}

.btn-info {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.18);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(239, 68, 68, 0.18);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.btn-full {
    width: 100%;
}

table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 28px;
    background: transparent;
}

table, th, td {
    min-width: 0;
}

.table-items thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

th {
    padding: 18px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
}

th:nth-child(3),
th:nth-child(4),
th:nth-child(5) {
    text-align: right;
}

td {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: middle;
    color: var(--muted);
}

td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
    text-align: right;
}

tbody tr {
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(241, 245, 249, 0.94);
}

.empty-state {
    text-align: center;
    padding: 72px 18px;
    color: rgba(71, 85, 105, 0.55);
}

.totales {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.totales-box {
    width: 340px;
    background: rgba(255,255,255,0.98);
    padding: 22px 24px;
    border-radius: 22px;
    border: 1px solid rgba(59,130,246,0.16);
    box-shadow: 0 24px 50px rgba(59, 130, 246, 0.12);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.total-row strong {
    color: var(--text);
}

.total-final {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(59, 130, 246, 0.14);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 1rem;
}

.btn-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    flex-wrap: wrap;
}

.cotizacion-item {
    background: rgba(255, 255, 255, 0.96);
    padding: 22px 24px;
    border-radius: 20px;
    margin-bottom: 16px;
    border-left: 6px solid rgba(59, 130, 246, 0.92);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

.cotizacion-item:hover {
    transform: translateY(-1px);
}

.cotizacion-info h3 {
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
}

.cotizacion-info p {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 5px;
}

.cotizacion-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pdf-dropdown {
    position: relative;
    display: inline-flex;
}

.pdf-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
    padding: 10px;
    display: none;
    z-index: 20;
    min-width: 190px;
}

.pdf-menu.active {
    display: block;
}

.pdf-option {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-weight: 700;
    color: var(--muted);
    transition: background 0.2s ease, color 0.2s ease;
}

.pdf-option:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-dark);
}

.alert {
    padding: 18px 22px;
    border-radius: 18px;
    margin-bottom: 20px;
    font-weight: 600;
    border-left: 4px solid;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.alert-success {
    color: #065f46;
    border-left-color: var(--success);
    background: rgba(236, 253, 245, 0.96);
}

.alert-error {
    color: #991b1b;
    border-left-color: var(--danger);
    background: rgba(254, 242, 242, 0.96);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 2000;
    max-width: min(92vw, 480px);
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 600;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    color: #065f46;
    background: #ecfdf5;
    border-left: 4px solid var(--success);
}

.toast.error {
    color: #991b1b;
    background: #fef2f2;
    border-left: 4px solid var(--danger);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    width: min(96%, 540px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    margin: auto;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-header h2 {
    color: var(--primary-dark);
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
}

.modal-body {
    margin-top: 8px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--muted);
}

.modal-help {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.modal-footer {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

@media (max-width: 1080px) {
    .header {
        grid-template-columns: 1fr;
        text-align: center;
        align-items: center;
    }

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

    .form-row,
    .area-grid {
        grid-template-columns: 1fr;
    }

    .totales {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px 12px;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .card {
        padding: 22px;
    }

    .header {
        grid-template-columns: 1fr;
        padding: 20px 16px;
    }

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

    .tabs {
        gap: 10px;
        justify-content: center;
    }

    .tab {
        flex: 1 1 auto;
        min-width: 0;
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.45rem;
    }

    .form-row,
    .area-grid,
    .tipo-calculo {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .btn {
        width: 100%;
    }

    .totales-box {
        width: 100%;
        padding: 20px 18px;
    }

    .cotizacion-item {
        flex-direction: column;
        align-items: stretch;
    }

    .cotizacion-actions {
        justify-content: stretch;
    }

    .pdf-dropdown {
        flex: 1 1 100%;
        width: 100%;
        display: flex;
    }

    .pdf-dropdown > .btn {
        flex: 1 1 auto;
        width: 100%;
    }

    .pdf-menu {
        left: 0;
        right: 0;
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    body {
        padding: 14px 12px;
    }

    .header {
        gap: 18px;
        padding: 18px 14px;
    }

    .header-logo img {
        max-width: 180px;
    }

    .header-center h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .cotizacion-actions {
        justify-content: stretch;
    }

    .container,
    .card {
        max-width: 100%;
        padding: 0;
    }

    .header,
    .form-row,
    .area-grid,
    .tipo-calculo,
    .cotizacion-item,
    .totales-box {
        width: 100% !important;
        max-width: 100% !important;
    }

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

    .tabs {
        justify-content: center;
    }

    .tab {
        width: 100%;
        min-width: 0;
    }

    .form-row,
    .area-grid,
    .tipo-calculo {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .totales-box {
        width: 100% !important;
        margin: 0;
        padding: 18px 16px;
    }

    .table-items,
    .table-items thead,
    .table-items tbody,
    .table-items tr,
    .table-items th,
    .table-items td {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
    }

    .table-items thead {
        display: none;
    }

    .table-items tr {
        margin-bottom: 16px;
        padding: 16px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
        border: 1px solid rgba(15, 23, 42, 0.06);
    }

    .table-items td,
    .table-items th {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        padding: 10px 0;
        border: none;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        white-space: normal !important;
        word-break: break-word !important;
    }

    .table-items td:last-child,
    .table-items th:last-child {
        border-bottom: none;
    }

    .table-items td[data-label] {
        font-size: 0.85rem;
        color: var(--muted);
    }

    .table-items td[data-label]::before {
        content: attr(data-label) ': ';
        font-weight: 700;
        color: var(--primary-dark);
        display: block;
        margin-bottom: 8px;
    }

    .drag-handle {
        touch-action: none;
        cursor: grab;
        user-select: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 50%;
        background: rgba(59, 130, 246, 0.1);
        color: var(--primary-dark);
        font-size: 1.1rem;
        transition: transform 0.2s ease, background 0.2s ease;
        margin: 0 auto;
    }

    .drag-handle:hover,
    .drag-handle:active {
        transform: scale(1.05);
        background: rgba(59, 130, 246, 0.16);
    }

    .dragging {
        opacity: 0.75;
    }

    .drag-over {
        outline: 2px dashed var(--primary);
        outline-offset: -10px;
    }

    .table-items td > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .table-items textarea.desc-edit,
    .table-items input[type="number"],
    .table-items .btn-danger,
    .table-items .btn-secondary,
    .table-items .btn {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }
}

/* ============================================================
   ASPECTO DE APP MÓVIL (Android)
   Se aplica en pantallas táctiles hasta 768px: convierte la
   página web en una "aplicación": barra superior, navegación
   inferior, tarjetas Material y modales tipo bottom-sheet.
   ============================================================ */
@media (max-width: 768px) {
    body {
        padding: 0;
        background: #eef1f6;
    }

    body::before {
        display: none;
    }

    .container {
        padding: 12px 12px 0;
        gap: 12px;
    }

    /* ----- Barra superior tipo app ----- */
    .header {
        position: sticky;
        top: 0;
        z-index: 900;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas: 'logo title' 'actions actions';
        gap: 6px 12px;
        padding: 10px 14px;
        border-radius: 0 0 20px 20px;
        border: none;
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        box-shadow: 0 2px 14px rgba(15, 23, 42, 0.28);
    }

    .header-logo {
        grid-area: logo;
        justify-content: flex-start;
    }

    .header-logo img {
        width: 42px;
        height: 42px;
        max-width: none;
        padding: 0;
        border: none;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.2);
    }

    .header-center {
        grid-area: title;
        align-items: flex-start;
        text-align: left;
        gap: 1px;
        min-width: 0;
    }

    .header-center h1 {
        display: none;
    }

    .header-center .fecha {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.85);
        font-weight: 600;
    }

    .company-info-center {
        display: block;
        text-align: left;
        font-size: 0;
        line-height: 1.2;
    }

    #company-name-center {
        display: block;
        font-size: 1.05rem;
        font-weight: 800;
        color: #ffffff;
        line-height: 1.2;
    }

    .company-info-center p:not(#company-name-center) {
        display: none;
    }

    .header- {
        grid-area: actions;
        margin: 0;
    }

    .header- > div {
        margin-bottom: 0 !important;
    }

    /* Oculta la línea "Sesión: ..." en móvil para dejar sitio a las acciones */
    .header- > div:not(.btn-group) {
        display: none;
    }

    .header- .btn-group {
        justify-content: flex-start;
        flex-wrap: wrap;
        overflow: visible;
        gap: 6px;
        margin-top: 6px;
    }

    .header- .btn-group .btn {
        flex: 0 0 auto;
        width: auto;
        padding: 6px 12px;
        font-size: 0.72rem;
        border-radius: 999px;
        box-shadow: none;
    }

    .header- .btn-group .btn-secondary {
        background: rgba(255, 255, 255, 0.16);
        border: none;
        color: #ffffff;
    }

    /* ----- Navegación inferior tipo app ----- */
    .tabs {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        margin: 0;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        display: flex;
        justify-content: space-around;
        gap: 4px;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.1);
    }

    .tab {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 8px 2px;
        font-size: 0.6rem;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
        font-weight: 700;
        color: var(--muted);
        background: transparent;
        border: none;
        border-radius: 14px;
    }

    .tab-icon {
        font-size: 1.3rem;
        line-height: 1;
        display: block;
    }

    .tab-label {
        display: block;
    }

    .tab.active {
        background: rgba(59, 130, 246, 0.12);
        color: var(--primary);
        box-shadow: none;
    }

    /* espacio para que el contenido no quede bajo la barra inferior */
    body {
        padding-bottom: calc(74px + env(safe-area-inset-bottom));
    }

    /* ----- Tarjetas tipo Material ----- */
    .card {
        padding: 20px 16px;
        border-radius: 18px;
        background: #ffffff;
        border: none;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
        margin-bottom: 12px;
    }

    .section-title {
        font-family: inherit;
        font-size: 1.15rem;
        margin-bottom: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* ----- Botones más táctiles ----- */
    .btn {
        border-radius: 14px;
        font-size: 0.95rem;
    }

    .btn-primary {
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        box-shadow: 0 10px 24px rgba(59, 130, 246, 0.25);
    }

    /* ----- Tabla de items: tarjetas apiladas ----- */
    .table-items tr {
        border-radius: 16px;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    }

    /* ----- Toast arriba de la barra inferior ----- */
    .toast {
        bottom: calc(86px + env(safe-area-inset-bottom));
    }

    /* ----- Modales tipo bottom-sheet ----- */
    .modal {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        margin: 0;
        border-radius: 24px 24px 0 0;
        padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
        box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.2);
    }

    #modal-png .modal-content {
        width: 100% !important;
        max-width: 100% !important;
    }

    #modal-png .modal-content {
        display: flex !important;
        flex-direction: column !important;
    }

    #modal-png .modal-body {
        overflow-y: auto !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch;
    }

    #modal-png #png-footer {
        position: static !important;
        flex: 0 0 auto !important;
        padding-top: 14px !important;
        margin-top: 0 !important;
        border-top: 1px solid rgba(15,23,42,.1);
    }

    .modal-header {
        padding-top: 4px;
        margin-bottom: 14px;
    }

    .modal-header h2 {
        font-family: inherit;
        font-size: 1.2rem;
    }

    .modal-footer {
        justify-content: stretch;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
    }

    /* ----- FAB: agregar producto ----- */
    .btn-full.btn-primary {
        border-radius: 16px;
        font-size: 1rem;
        padding: 16px;
    }
}
