html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    background: #f8fafc;
    color: #1e293b;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 1400px;
}

.app-header .navbar {
    background: #ffffff !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    min-height: 76px;
}

.brand-logo {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
    background: transparent !important;
}

.brand-text {
    line-height: 1.1;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: #64748b;
}

.navbar .nav-link {
    color: #334155 !important;
    font-weight: 500;
    border-radius: 10px;
    padding: 0.55rem 0.8rem !important;
}

    .navbar .nav-link:hover {
        background: #eff6ff;
        color: #1d4ed8 !important;
    }

.app-main {
    padding-top: 8px;
    flex: 1;
}

.app-footer {
    padding: 18px 0 26px;
    margin-top: auto;
}

.footer-text {
    color: #64748b;
    font-size: 0.92rem;
    text-align: center;
}

h1, h2, h3, h4, h5 {
    color: #0f172a;
    font-weight: 700;
}

.card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    background: #ffffff;
}

.card-body {
    padding: 1.25rem;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}

    .btn-primary:hover {
        background: #1d4ed8;
        border-color: #1d4ed8;
    }

.btn-outline-secondary {
    border-color: #cbd5e1;
    color: #334155;
}

    .btn-outline-secondary:hover {
        background: #f1f5f9;
        color: #0f172a;
        border-color: #cbd5e1;
    }

.btn-outline-primary {
    border-color: #93c5fd;
    color: #1d4ed8;
}

    .btn-outline-primary:hover {
        background: #eff6ff;
        color: #1d4ed8;
        border-color: #60a5fa;
    }

.btn-success {
    background: #16a34a;
    border-color: #16a34a;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

    .table thead th {
        border-bottom: 1px solid #e2e8f0;
        color: #475569;
        font-size: 0.88rem;
        font-weight: 700;
        background: #f8fafc;
    }

    .table td {
        color: #1e293b;
    }

.form-label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.45rem;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    min-height: 42px;
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12);
}

.badge {
    padding: 0.55em 0.8em;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.alert {
    border-radius: 12px;
    border: 0;
}

.display-6 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
}

.text-muted {
    color: #64748b !important;
}

a {
    text-decoration: none;
}

    a:hover {
        text-decoration: none;
    }

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

    .section-header .title-block {
        margin-bottom: 0;
    }

        .section-header .title-block p {
            margin: 0.35rem 0 0;
            color: #64748b;
        }

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #64748b;
}

.quote-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.comment-history-item:last-child {
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.quote-lines-wrapper {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.quote-lines-table {
    width: 100%;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
    table-layout: fixed;
    background: #fff;
}

    .quote-lines-table thead th {
        background: #f8fafc;
        color: #475569;
        font-size: 0.88rem;
        font-weight: 700;
        border-bottom: 1px solid #dee2e6 !important;
    }

    .quote-lines-table th,
    .quote-lines-table td {
        vertical-align: middle;
        border-right: 1px solid #dee2e6 !important;
        border-bottom: 1px solid #dee2e6 !important;
        background: #fff;
    }

        .quote-lines-table th:last-child,
        .quote-lines-table td:last-child {
            border-right: 0 !important;
            text-align: center;
        }

    .quote-lines-table tbody tr:last-child td {
        border-bottom: 0 !important;
    }

    .quote-lines-table input.form-control {
        min-width: 0;
    }

    .quote-lines-table .btn-outline-danger {
        min-width: 36px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

.card h2,
.card h5 {
    margin-bottom: 1rem;
}

.navbar-brand,
.navbar-brand img {
    background: transparent !important;
    box-shadow: none !important;
}

.action-icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .action-icon-btn i {
        font-size: 0.95rem;
        line-height: 1;
    }

.table-footer-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.table-footer-summary {
    color: #64748b;
    font-size: 0.9rem;
}

.table-footer-pagination {
    display: flex;
    justify-content: center;
}

.table-footer-page-size {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

    .table-footer-page-size label {
        margin-bottom: 0;
        color: #475569;
        font-weight: 600;
        font-size: 0.9rem;
    }

    .table-footer-page-size .form-select {
        width: auto;
        min-width: 90px;
    }

.pagination {
    margin-bottom: 0;
}

    .pagination .page-link {
        border-radius: 10px;
        margin: 0 2px;
    }

/* =========================
   TOM SELECT / CLIENTE
   ========================= */

select.customer-select.ts-hidden-accessible,
select.customer-select.tomselected {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ts-wrapper.form-select,
.ts-wrapper.customer-select {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0 !important;
    padding: 0 !important;
}

.ts-wrapper {
    width: 100%;
}

    .ts-wrapper.single {
        width: 100%;
    }

        .ts-wrapper.single .ts-control {
            min-height: 42px;
            border: 1px solid #cbd5e1;
            border-radius: 10px;
            padding: 0.375rem 2.2rem 0.375rem 0.75rem;
            box-shadow: none;
            background-color: #fff;
            display: flex;
            align-items: center;
            flex-wrap: nowrap;
            gap: 0;
            position: relative;
            overflow: hidden;
        }

            .ts-wrapper.single .ts-control input {
                flex: 1 1 auto !important;
                width: auto !important;
                min-width: 0 !important;
                border: 0 !important;
                box-shadow: none !important;
                background: transparent !important;
                margin: 0 !important;
                padding: 0 !important;
                color: #1e293b;
                font-size: 1rem;
                line-height: 1.5;
            }

                .ts-wrapper.single .ts-control input::placeholder {
                    color: #64748b;
                    opacity: 1;
                }

        .ts-wrapper.single.has-items .ts-control input::placeholder {
            color: transparent !important;
        }

        .ts-wrapper.single.has-items .ts-control input {
            min-width: 1px !important;
        }

        .ts-wrapper.single .item {
            flex: 0 1 auto;
            max-width: 100%;
            margin: 0 !important;
            padding: 0 !important;
            background: transparent !important;
            color: #1e293b;
            font-size: 1rem;
            line-height: 1.5;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .ts-wrapper.single .ts-control::after {
            content: "";
            position: absolute;
            top: 50%;
            right: 0.85rem;
            transform: translateY(-35%);
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            border-top: 6px solid #64748b;
            pointer-events: none;
        }

        .ts-wrapper.focus .ts-control,
        .ts-wrapper.single.focus .ts-control {
            border-color: #60a5fa;
            box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12);
        }

.ts-dropdown {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    margin-top: 0.25rem;
    overflow: hidden;
    z-index: 30;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
}

    .ts-dropdown .option {
        padding: 0.55rem 0.75rem;
        cursor: pointer;
        color: #334155;
    }

        .ts-dropdown .option:hover,
        .ts-dropdown .active {
            background-color: #eff6ff;
            color: #1d4ed8;
        }

    .ts-dropdown .no-results,
    .no-results {
        padding: 0.55rem 0.75rem;
        color: #64748b;
    }

.quote-row,
.quote-row td,
.customer-row,
.customer-row td {
    cursor: pointer !important;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

    .quote-row:hover td,
    .customer-row:hover td {
        background-color: #eef6ff !important;
    }

    .quote-row:hover,
    .customer-row:hover {
        box-shadow: inset 0 0 0 9999px rgba(37, 99, 235, 0.03);
    }

@media (max-width: 768px) {
    .table-footer-bar {
        grid-template-columns: 1fr;
    }

    .table-footer-summary,
    .table-footer-pagination,
    .table-footer-page-size {
        justify-content: center;
        text-align: center;
    }
}

/* =========================
   LANDING QONVOK
   ========================= */

    .landing-hero {
        position: relative;
        overflow: hidden;
        border-radius: 28px;
        padding: 5rem 3rem;
        background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 48%, #6d28d9 100%);
        color: #ffffff;
        box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    }

    .landing-hero-bg {
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at top right, rgba(255,255,255,0.20), transparent 34%), radial-gradient(circle at bottom left, rgba(96,165,250,0.22), transparent 32%);
        pointer-events: none;
    }

    .landing-hero > .row {
        position: relative;
        z-index: 1;
    }

    .landing-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.45rem 0.8rem;
        border-radius: 999px;
        background: rgba(255,255,255,0.12);
        border: 1px solid rgba(255,255,255,0.20);
        color: #dbeafe;
        font-weight: 700;
        font-size: 0.88rem;
        margin-bottom: 1.25rem;
    }

    .landing-title {
        color: #ffffff;
        font-size: clamp(2.4rem, 5vw, 4.6rem);
        line-height: 1.02;
        letter-spacing: -0.05em;
        margin-bottom: 1.3rem;
    }

    .landing-subtitle {
        color: #dbeafe;
        font-size: 1.15rem;
        line-height: 1.7;
        max-width: 640px;
        margin-bottom: 1.8rem;
    }

    .landing-form {
        display: flex;
        gap: 0.75rem;
        align-items: center;
        flex-wrap: wrap;
    }

    .landing-input {
        min-height: 52px;
        border-radius: 14px;
        border: 1px solid rgba(255,255,255,0.28);
        max-width: 320px;
    }

    .landing-cta {
        min-height: 52px;
        border-radius: 14px;
        padding: 0 1.25rem;
        background: #ffffff;
        color: #1d4ed8;
        border: 0;
        font-weight: 800;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.20);
    }

        .landing-cta:hover {
            background: #eff6ff;
            color: #1e40af;
        }

    .landing-form-note {
        color: #bfdbfe;
        font-size: 0.92rem;
        margin-top: 0.9rem;
        margin-bottom: 0;
    }

    .landing-preview-card {
        background: rgba(255,255,255,0.94);
        border: 1px solid rgba(255,255,255,0.35);
        border-radius: 24px;
        color: #0f172a;
        box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
        overflow: hidden;
        transform: rotate(1deg);
    }

    .landing-preview-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.2rem;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
    }

        .landing-preview-header span {
            width: 10px;
            height: 10px;
            display: inline-block;
            border-radius: 999px;
            background: #cbd5e1;
            margin-right: 0.25rem;
        }

        .landing-preview-header small {
            color: #64748b;
            font-weight: 700;
        }

    .landing-preview-body {
        padding: 1.4rem;
    }

    .landing-preview-top {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1.4rem;
    }

        .landing-preview-top h3 {
            margin: 0;
            font-size: 1.35rem;
        }

    .landing-status {
        align-self: flex-start;
        padding: 0.45rem 0.75rem;
        border-radius: 999px;
        background: #dbeafe;
        color: #1d4ed8;
        font-weight: 800;
        font-size: 0.8rem;
    }

    .landing-preview-line {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #e2e8f0;
        padding: 0.8rem 0;
    }

        .landing-preview-line span {
            color: #64748b;
        }

    .landing-progress {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        margin: 1.4rem 0;
    }

        .landing-progress div {
            padding: 0.8rem;
            border-radius: 14px;
            background: #f1f5f9;
            color: #64748b;
            font-weight: 700;
            font-size: 0.85rem;
            text-align: center;
        }

            .landing-progress div.active {
                background: #eff6ff;
                color: #1d4ed8;
            }

        .landing-progress i {
            display: block;
            font-size: 1.2rem;
            margin-bottom: 0.25rem;
        }

    .landing-message {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 1rem;
    }

        .landing-message p {
            margin: 0.4rem 0 0;
            color: #475569;
        }

    .landing-section {
        padding: 5rem 0 1rem;
    }

    .landing-section-heading {
        max-width: 780px;
        margin: 0 auto 2.5rem;
        text-align: center;
    }

        .landing-section-heading span {
            color: #2563eb;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-size: 0.8rem;
        }

        .landing-section-heading h2 {
            font-size: clamp(2rem, 4vw, 3rem);
            letter-spacing: -0.04em;
            margin: 0.5rem 0 1rem;
        }

        .landing-section-heading p {
            color: #64748b;
            font-size: 1.08rem;
            line-height: 1.7;
        }

    .landing-feature-card {
        height: 100%;
        padding: 1.5rem;
        border-radius: 22px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    }

        .landing-feature-card i {
            font-size: 2rem;
            color: #2563eb;
        }

        .landing-feature-card h3 {
            font-size: 1.15rem;
            margin: 1rem 0 0.6rem;
        }

        .landing-feature-card p {
            color: #64748b;
            margin: 0;
            line-height: 1.6;
        }

    .landing-solution {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 28px;
        padding: 3rem;
        margin-top: 4rem;
    }

    .landing-mini-card {
        height: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1.2rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 18px;
    }

        .landing-mini-card i {
            font-size: 1.6rem;
            color: #2563eb;
        }

        .landing-mini-card strong {
            color: #0f172a;
            font-size: 1rem;
        }

        .landing-mini-card span {
            color: #64748b;
            line-height: 1.5;
        }

    .landing-audience-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.9rem;
    }

        .landing-audience-grid div {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            padding: 1rem;
            text-align: center;
            font-weight: 800;
            color: #334155;
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
        }

    .landing-final-cta {
        margin: 5rem 0 2rem;
        padding: 3rem;
        border-radius: 28px;
        background: linear-gradient(135deg, #eff6ff, #f5f3ff);
        border: 1px solid #dbeafe;
        text-align: center;
    }

        .landing-final-cta h2 {
            font-size: clamp(2rem, 4vw, 3rem);
            letter-spacing: -0.04em;
        }

        .landing-final-cta p {
            color: #64748b;
            font-size: 1.1rem;
            margin-bottom: 1.5rem;
        }

    .landing-form-center {
        justify-content: center;
    }

    .landing-final-cta .landing-cta {
        background: #2563eb;
        color: #ffffff;
    }

        .landing-final-cta .landing-cta:hover {
            background: #1d4ed8;
            color: #ffffff;
        }

    .landing-final-cta .landing-input {
        border-color: #cbd5e1;
    }

    @media (max-width: 992px) {
        .landing-hero {
            padding: 3.5rem 1.5rem;
        }

        .landing-preview-card {
            transform: none;
        }

        .landing-audience-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .landing-solution {
            padding: 2rem;
        }
    }

    @media (max-width: 576px) {
        .landing-form,
        .landing-form-center {
            flex-direction: column;
            align-items: stretch;
        }

        .landing-input {
            max-width: 100%;
        }

        .landing-audience-grid {
            grid-template-columns: 1fr;
        }

        .landing-progress {
            grid-template-columns: 1fr;
        }
    }

.landing-legal-footer {
    padding: 2rem 0 1rem;
    color: #64748b;
    font-size: 0.92rem;
    text-align: center;
}

    .landing-legal-footer a {
        color: #2563eb;
        font-weight: 700;
    }