/* ===========================
   RESET & BASE
=========================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: Roboto;
    background-color: #f7f9fb;
    color: #333;
}

/* ===========================
   SIDEBAR
=========================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 180px;
    height: 100vh;
    background-color: #00BCD4;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 18px;
    margin-bottom: 30px;
}

.sidebar .logo .material-icons {
    font-size: 24px;
}

.menu {
    list-style: none;
    width: 100%;
}

.menu li {
    width: 100%;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #fff;
    background-color: transparent;
}

.menu li.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.menu li:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.10);
}

.menu li .material-icons {
    font-size: 20px;
}

.menu li a,
.menu li a:link,
.menu li a:visited,
.menu li a:hover,
.menu li a:active,
.menu li a:focus {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

/* ===========================
   MAIN WRAPPER
=========================== */
.main {
    margin-left: 180px;
    position: relative;
    min-height: 100%;
}

/* ===========================
   HEADER
=========================== */

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    /* fina borda sutil */
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* sombra levemente mais suave e ampla */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    /* separa do elemento seguinte */
    margin-bottom: 12px;
}

.main-header h1 {
    font-size: 20px;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn.upgrade {
    background-color: #4A4A4A;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.icon-btn .material-icons {
    font-size: 24px;
    color: #333;
}

/* ===========================
   TOOLBAR
=========================== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
}

.toolbar-left {
    gap: 12px;
    width: 100%;
}

.toolbar-right {
    gap: 8px;
}

.toolbar-left .material-icons {
    font-size: 25px;
    color: #777;
}

.search {
    width: 100%;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    padding: 4px 0;
    font-family: Roboto, 'Helvetica Neue', sans-serif;
}

.search input {
    width: 100%;
    flex-grow: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.87);
    line-height: 32px;
    height: 32px;
    padding: 0;
}

.search input::placeholder {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.54);
}

/* ===========================
   TABLE
=========================== */
.table-wrapper {
    margin: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 16px;
    text-align: center !important;
    vertical-align: middle !important;
    font-size: 14px;
    color: #555;
}

th.sortable .arrow {
    display: none;
}

th.sortable.sorted .arrow {
    display: inline-block;
    /* volta a mostrar quando “sorted” */
}

/* hover leve nas linhas da tabela de items */
.table-wrapper tbody tr:hover {
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

thead th {
    font-weight: 500;
    color: #777;
    border-bottom: 1px solid #eee;
}

th:first-child,
td:first-child {
    width: 40px;
}

.material-icons.arrow {
    font-size: 16px;
    vertical-align: middle;
    color: #999;
}

/* ===========================
   PAGINATION
=========================== */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 20px;
    background: #fff;
    font-size: 12px;
    color: #999;
    gap: 8px;
}

.pagination select {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 6px;
    background: #fff;
    font-size: 12px;
}

.pagination .icon-btn .material-icons {
    font-size: 20px;
}

/* ===========================
   ADD CONTACT BUTTON
=========================== */
.create-quote {
    margin: 24px 0 0 28px;
    background-color: #00BCD4;
    color: #fff;
    border: none;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background-color .2s;
}

.create-quote:hover {
    background-color: #0098ad;
}

/* ===========================
   LOADER
=========================== */
#loader-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: linear-gradient(to right, #00bcd4 0%, #00bcd4 50%, #e0f7fa 100%);
    background-size: 200px 4px;
    animation: load 1.5s infinite linear;
    margin-bottom: 1rem;
}

.loader-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00bcd4;
}

@keyframes load {
    to {
        background-position: 200px 0;
    }
}

/* ===========================
   MODAL
=========================== */

#quote-view-title {
    font-size: 20px !important;
    font-weight: 400 !important;
}

#cv-name {
    font-size: 20px !important;
    font-weight: 400 !important;
}

#linked-quotes-modal h2 {
    font-size: 20px !important;
    font-weight: 400 !important;
}

#customer-modal h2 {
    font-size: 20px !important;
    font-weight: 400 !important;
}

#item-modal h2 {
    font-size: 20px !important;
    font-weight: 400 !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    /* remove o delay de visibilidade ao mostrar */
    transition: opacity 0.8s ease, visibility 0s linear 0s;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    transform: none !important;
    pointer-events: none;
    /* só atrasa a visibilidade ao ocultar */
    transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    visibility: hidden;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: auto;
    max-width: 43vw !important;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;

    transform-origin: center center;
    transition:
        transform 0.5s ease,
        opacity 0.5s ease,
        visibility 0s linear 0.5s;
}

.modal:not(.hidden) {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    transition:
        transform 0.5s ease,
        opacity 0.5s ease,
        visibility 0s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #00BCD4;
    color: white;
    padding: 12px 20px;
    margin: -32px -32px 0 -32px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    font-size: 13.5px;
}


.modal-header .icon-btn .material-icons {
    /* garante que o “×” fique branco em todas as janelas de modal */
    color: white;
}

/* ===========================
   FORM LAYOUT
=========================== */
.modal-content input,
.modal-content select,
.modal-content textarea {
    width: auto;
    padding: 14px 4px 8px;
    margin-bottom: 4px;
    font-size: 15px;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    outline: none;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    border-bottom: 2px solid #00BCD4;
}

.row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.row>.form-group {
    flex: 1 1 0;
    min-width: 0;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 24px;
    font-weight: 500;
    margin-bottom: 20px;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.radio-group input[type="radio"] {
    margin: 0;
    transform: translateY(-1px);
}

.conditional-fields.hidden {
    display: none;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 24px;
}

.btn.cancel,
.btn.save {
    background: transparent;
    border: none;
    color: #00BCD4;
    padding: 12px 20px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn.cancel:hover,
.btn.save:hover {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.hidden {
    visibility: hidden;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    pointer-events: none;
    /* aguarda 0.8s antes de tornar visibility:hidden */
    transition:
        transform 0.8s ease,
        opacity 0.8s ease,
        visibility 0s linear 0.8s;
}

/* ===========================
   FLOATING LABEL SYSTEM
=========================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
    position: relative;
    /* base p/ labels flutuantes */
}

.floating-label {
    display: flex;
    width: 100%;
    font-size: 11px;
    color: #999;
    margin-left: 2px;
    height: auto;
}

/* Inputs com label animado */
.form-group:not(.no-float) .floating-label {
    position: absolute;
    left: 4px;
    top: 14px;
    font-size: 15px;
    color: #999;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Quando campo tem valor ou foco */
.form-group:not(.no-float) input:focus+.floating-label,
.form-group:not(.no-float) input:not(:placeholder-shown)+.floating-label,
.form-group:not(.no-float) textarea:focus+.floating-label,
.form-group:not(.no-float) textarea:not(:placeholder-shown)+.floating-label {
    top: -6px;
    font-size: 11px;
    color: #00BCD4;
}

/* Garantir largura total dentro das rows */
.row>.form-group>input,
.row>.form-group>select,
.row>.form-group>textarea {
    width: 100% !important;
}

/* ===========================
   COUNTRY SELECT: LABEL FIXO
=========================== */

.form-group.select-fixed .floating-label {
    position: absolute;
    left: 4px;
    top: -6px;
    font-size: 11px;
    color: #999;
    pointer-events: none;
}

.form-group.select-fixed select {
    width: 100% !important;
    padding: 14px 4px 8px;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    outline: none;
}

.form-group.select-fixed select:focus,
.form-group.select-fixed input:focus {
    border-bottom: 2px solid #00BCD4;
}

.form-group.select-fixed:focus-within .floating-label {
    color: #00BCD4;
}

/* ===========================
   TITLES INSIDE FORM
=========================== */
h4 {
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

/* ===== Unit select alinhado com Unit Price ===== */
.form-group.unit-select {
    position: relative;
}

.form-group.unit-select .floating-label {
    position: absolute;
    left: 4px;
    top: -6px;
    font-size: 11px;
    color: #999;
    pointer-events: none;
}

.form-group.unit-select select {
    width: 100% !important;
    padding: 14px 4px 8px;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    outline: none;
}

.form-group.unit-select select:focus {
    border-bottom: 2px solid #00BCD4;
}

.form-group.unit-select .add-inline {
    position: absolute;
    right: 0;
    top: -6px;
    background: none;
    border: none;
    font-size: 12px;
    color: #00BCD4;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ---------- CONTACT VIEW MODAL TWEAKS ---------- */
#cv-address {
    line-height: 1.6;
    margin-bottom: 12px;
}

#cv-phone,
#cv-email {
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Botões estilo do print 2 */
.cv-btn {
    background-color: #00BCD4;
    color: #fff;
    border: none;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
    transition: background-color .2s;
}

.cv-btn:hover {
    background-color: #0098ad;
}

/* ===== Contact view: alinhamento e ícones não selecionáveis ===== */
#cv-title-line {
    font-size: 18px;
    font-weight: bold;
}

#cv-title-line,
#cv-phone,
#cv-email,
#cv-website {
    display: flex;
    align-items: center;
    /* ou: baseline */
    gap: 6px;
    line-height: 1.6;
    margin-bottom: 8px;
}


#cv-address {
    line-height: 1.6;
    margin-bottom: 12px;
}

.cv-icon {
    user-select: none;
    pointer-events: none;
    line-height: 1;
    font-size: 16px;
    /* mesmo tamanho usado antes */
    margin-right: 0;
}

/* mantém o ícone menor mas alinhado ao topo do texto */
/* diminui o ícone e alinha pela baseline da primeira linha de texto */
#cv-address-wrap {
    /* override do inline style align-items:flex-start */
    align-items: baseline !important;
}

#cv-addr-icon .material-icons {
    font-size: 16px;
    /* ou o valor que você prefira */
    line-height: 1;
}

/* === Ordenação de colunas === */
th.sortable {
    cursor: pointer;
}

th.sortable .arrow {
    visibility: hidden;
    transition: transform 0.2s;
}

th.sortable.sorted .arrow {
    visibility: visible;
}

th.sortable.sorted.asc .arrow {
    transform: rotate(0deg);
}

th.sortable.sorted.desc .arrow {
    transform: rotate(180deg);
}

th.sortable.sorted {
    font-weight: bold;
}

/* Dropdown de filtro */
.filter-container {
    position: relative;
    display: inline-block;
}

#filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-top: 4px;
    list-style: none;
    padding: 4px 0;
    min-width: 120px;
    z-index: 100;
    font-size: 16px;
}

#filter-dropdown.hidden {
    display: none;
}

#filter-dropdown li {
    padding: 12px 12px;
}

#filter-dropdown li:hover {
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

/* ===== Filter Type Modal ===== */
#filter-type-modal {
    width: 300px;
    max-height: 90vh;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

#filter-type-modal .modal-header {
    background-color: #00BCD4;
    color: #fff;
    padding: 16px;
}

#filter-type-modal .modal-header h2 {
    margin: 0;
    font-size: 16px;
}

#filter-type-modal .modal-header .icon-btn .material-icons {
    color: #fff;
}

#filter-type-modal .modal-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#filter-type-modal .modal-content label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    white-space: normal;
}

#filter-type-modal input[type="radio"] {
    width: 18px;
    height: 18px;
}

#filter-type-modal .modal-actions {
    padding: 8px 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

#filter-type-modal .btn.cancel,
#filter-type-modal .btn.save {
    background: transparent;
    border: none;
    color: #00BCD4;
    font-weight: 600;
}

#filter-type-modal .btn.cancel:hover,
#filter-type-modal .btn.save:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

#filter-type-modal .modal-header {
    margin: 0;
    padding: 16px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

#filter-type-modal .modal-header h2 {
    flex: 1;
    white-space: nowrap;
}

/* Deixa labels mais coladinhos e centralizados */
#filter-type-modal .modal-content {
    /* reduz gap vertical e padding inferior */
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#filter-type-modal .modal-content label {
    /* mantém rádio e texto alinhados no meio */
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Ajusta tamanho do rádio e remove margens extras */
#filter-type-modal input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    vertical-align: middle;
}

/* Diminui o espaço acima dos botões */
#filter-type-modal .modal-actions {
    padding: 4px 16px 16px;
}

/* ===== Ajustes finais do Filter Type Modal ===== */
#filter-type-modal {
    /* reduz largura em 15% (300px → ≈255px) */
    width: calc(300px * 0.85);
}

#filter-type-modal .modal-header h2 {
    /* aumenta o tamanho da fonte de “Type” */
    font-size: 20px;
}

#filter-type-modal .modal-content {
    /* deixa os radios ainda mais juntos e reduz o padding inferior */
    gap: 16px;
    padding: 16px 16px 4px;
    padding-left: 24px;
}

#filter-type-modal .modal-actions {
    /* reduz o espaço acima dos botões */
    padding: 4px 16px 16px;
}

#filter-type-modal .modal-content label {
    font-size: 16px;
    /* aumenta tamanho do texto */
}

/* badge de filtro */
.filter-tag {
    display: inline-flex;
    align-items: center;
    background: #e0e0e0;
    color: #333;
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 4px;
}

.filter-tag .filter-clear {
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
}

.filter-tag strong {
    font-weight: bold;
}

.filter-tag em {
    font-style: italic;
}

.filter-tag .filter-clear {
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

/* ===== Ajustes para Filter City Modal ===== */
#filter-city-modal {
    /* mesma largura do Filter Type (reduzida em 15%) */
    width: calc(300px * 0.85);
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

#filter-city-modal .modal-header {
    margin: 0;
    padding: 16px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

#filter-city-modal .modal-header h2 {
    font-size: 20px;
    flex: 1;
}

#filter-city-modal .modal-header .icon-btn .material-icons {
    /* ícone de fechar em branco */
    color: #fff;
}

#filter-city-modal .modal-content {
    padding: 16px 16px 4px;
    display: flex;
    flex-direction: column;
}

#filter-city-modal .modal-content select {
    /* ocupa toda a largura interna */
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    padding: 8px 4px;
    font-size: 14px;
    outline: none;
}

#filter-city-modal .modal-actions {
    padding: 4px 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

/* ===== Badge: impedir quebra de linha e garantir que o “×” apareça ===== */
.filter-tag {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    overflow: visible;
}

/* ===== Ajustes para Filter Country Modal ===== */
#filter-country-modal {
    width: calc(300px * 0.85);
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

#filter-country-modal .modal-header {
    margin: 0;
    padding: 16px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

#filter-country-modal .modal-header h2 {
    font-size: 20px;
    flex: 1;
}

#filter-country-modal .modal-header .icon-btn .material-icons {
    color: #fff;
}

#filter-country-modal .modal-content {
    padding: 16px 16px 4px;
    display: flex;
    flex-direction: column;
}

#filter-country-modal .modal-content select {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    padding: 8px 4px;
    font-size: 14px;
    outline: none;
}

#filter-country-modal .modal-actions {
    padding: 4px 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

/* ===== Badge: impedir quebra de linha e manter × visível ===== */
.filter-tag {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    overflow: visible;
}

/* ===== Filter Type Modal ===== */
#filter-type-modal {
    width: calc(300px * 0.85);
    max-height: 90vh;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

#filter-type-modal .modal-header {
    background-color: #00BCD4;
    color: #fff;
    padding: 16px;
}

#filter-type-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
}

#filter-type-modal .modal-header .icon-btn .material-icons {
    color: #fff;
}

#filter-type-modal .modal-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#filter-type-modal .modal-content label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #333;
    white-space: normal;
}

#filter-type-modal input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    vertical-align: middle;
}

#filter-type-modal .modal-actions {
    padding: 8px 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

#filter-type-modal .btn.cancel,
#filter-type-modal .btn.save {
    background: transparent;
    border: none;
    color: #00BCD4;
    font-weight: 600;
}

#filter-type-modal .btn.cancel:hover,
#filter-type-modal .btn.save:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* ===== Filter Price Modal (mesmo estilo de Type) ===== */
#filter-price-modal {
    width: calc(300px * 0.85);
    max-height: 90vh;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

#filter-price-modal .modal-header {
    margin: 0;
    padding: 16px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    background-color: #00BCD4;
    color: #fff;
}

#filter-price-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
}

#filter-price-modal .modal-header .icon-btn .material-icons {
    color: #fff;
}

#filter-price-modal .modal-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#filter-price-modal .modal-content input[type="number"] {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    padding: 8px 4px;
    font-size: 14px;
    outline: none;
}

#filter-price-modal .modal-actions {
    padding: 8px 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

#filter-price-modal .btn.cancel,
#filter-price-modal .btn.save {
    background: transparent;
    border: none;
    color: #00BCD4;
    font-weight: 600;
}

#filter-price-modal .btn.cancel:hover,
#filter-price-modal .btn.save:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* ===========================
   CUSTOMER FILTER MODAL
=========================== */

/* 1) Container responsivo e centralizado */
#filter-customer-modal {
    width: fit-content;
    max-width: 80vw;
    box-sizing: border-box;
    margin: 0 auto;
}

/* 2) Exibe em flex só quando visível */
#filter-customer-modal:not(.hidden) {
    display: flex;
    flex-direction: column;
}

/* 3) Grid interno e posicionamento relativo pro dropdown */
#filter-customer-modal .modal-content {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "badges input"
        ". suggestions";
    gap: 0;
    /* sem gap horizontal nem vertical */
    align-items: center;
    padding: 0;
}

/* 4) Badges (nomes selecionados) à esquerda */
#customer-badges {
    grid-area: badges;
    margin: 0;
}

/* 5) Campo de busca à direita */
#filter-customer-input {
    grid-area: input;
    width: 100%;
}

/* 6) Dropdown de sugestões abaixo do input, sem gap */
#filter-customer-suggestions {
    grid-area: suggestions;
    position: absolute;
    top: 100%;
    /* exatamente logo abaixo do input */
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 150px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    z-index: 10012;
}

#filter-customer-suggestions:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#filter-customer-suggestions li {
    padding: 8px 12px;
    cursor: pointer;
}

#filter-customer-suggestions li:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* wrapper que une badge + input sob a mesma linha azul */
#filter-customer-modal .filter-input-wrapper {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #00BCD4;
    padding-bottom: 4px;
    margin-bottom: 0;
    /* zera margem extra */
}

/* spacing interno: badge colado no input */
#filter-customer-modal #customer-badges {
    margin-right: 4px;
}

/* input integrado ao mesmo underline */
#filter-customer-modal #filter-customer-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    margin: 0;
    /* zera margin-bottom que empurrava o dropdown */
}

/* ===========================
   CUSTOMER FILTER MODAL – badge “dentro” do search
=========================== */
#filter-customer-modal .modal-content {
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 2px solid #00BCD4;
    padding-bottom: 4px;
}

/* Faz o badge sobrepor a borda, “escondendo” o traço atrás dele */
#filter-customer-modal #customer-badges {
    background: #fff;
    margin-right: -2px;
    /* metade da espessura da borda */
    padding: 0 6px 4px;
    /* ajusta o “pé” do badge à altura da borda */
    z-index: 1;
}

/* Input ocupa o resto do espaço, sem bordas próprias */
#filter-customer-modal #filter-customer-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 4px 8px;
    margin: 0;
}

/* Dropdown posicionado normalmente */
#filter-customer-modal #filter-customer-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
}

#filter-customer-modal #filter-customer-suggestions.hidden {
    display: none;
}

#filter-customer-modal #filter-customer-suggestions li {
    padding: 8px 12px;
    cursor: pointer;
}

#filter-customer-modal #filter-customer-suggestions li:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ===== Filter Amount Modal (igual ao Price) ===== */
#filter-amount-modal {
    width: calc(300px * 0.85);
    max-height: 90vh;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

#filter-amount-modal .modal-header {
    margin: 0;
    padding: 16px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    background-color: #00BCD4;
    color: #fff;
}

#filter-amount-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
}

#filter-amount-modal .modal-header .icon-btn .material-icons {
    color: #fff;
}

#filter-amount-modal .modal-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#filter-amount-modal .modal-content input[type="number"] {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    padding: 8px 4px;
    font-size: 14px;
    outline: none;
}

#filter-amount-modal .modal-actions {
    padding: 8px 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

#filter-amount-modal .btn.cancel,
#filter-amount-modal .btn.save {
    background: transparent;
    border: none;
    color: #00BCD4;
    font-weight: 600;
}

#filter-amount-modal .btn.cancel:hover,
#filter-amount-modal .btn.save:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* -------------------------------
   Aplica só ao Date e Due Date
   ------------------------------- */
#filter-date-modal,
#filter-due_date-modal {
    max-width: 380px !important;
    width: 90% !important;
    margin: 2rem auto !important;
}

#filter-date-modal .modal-content,
#filter-due_date-modal .modal-content {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem !important;
    align-items: flex-start !important;
}

/* Cada wrapper .date-field em cada modal */
#filter-date-modal .date-field,
#filter-due_date-modal .date-field {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Label acima do input */
#filter-date-modal .date-field label,
#filter-due_date-modal .date-field label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Espaço para o ícone e estilo do input */
#filter-date-modal .date-field input[type="date"],
#filter-due_date-modal .date-field input[type="date"] {
    padding: 0.5rem 0 0.5rem 2.5rem;
    font-size: 1rem;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
}

/* Remove picker nativo */
#filter-date-modal .date-field input[type="date"]::-webkit-calendar-picker-indicator,
#filter-due_date-modal .date-field input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
}

/* Ícone calendar à esquerda */
#filter-date-modal .date-field input[type="date"]::before,
#filter-due_date-modal .date-field input[type="date"]::before {
    content: 'calendar_today';
    font-family: 'Material Icons';
    position: absolute;
    left: 0.75rem;
    top: calc(50% + 0.15rem);
    pointer-events: none;
    font-size: 1.2rem;
    color: #666;
}

/* só em styles.css, no final, para estes modals */
.date-field {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* esconde o picker nativo */
.date-field input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
}

/* input com padding mas sem ícone via ::before */
.date-field input[type="date"] {
    padding: 0.5rem 0.5rem 0.5rem 2.5rem;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
}

/* ícone real, clicável */
.icon-label {
    position: absolute;
    left: 0.75rem;
    top: calc(50% + 0.15rem);
    cursor: pointer;
    pointer-events: auto;
    color: #666;
}

/* garante que o i use Material Icons */
.icon-label .material-icons {
    font-size: 1.2rem;
    line-height: 1;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    display: flex;
    align-items: center;
    margin-bottom: .5rem;
}

.filter-list li label {
    margin-left: .5rem;
    cursor: pointer;
}

#filter-status-modal.hidden,
#filter-status-modal-overlay.hidden {
    display: none !important;
}

#filter-status-modal:not(.hidden) {
    display: inline-flex !important;
    flex-direction: column !important;
    width: auto !important;
    min-width: none !important;
}

#filter-status-modal:not(.hidden) .modal-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 0.1rem 0.1rem !important;
}

#filter-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#filter-status-list li {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
}

#filter-status-list li input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    accent-color: #00bfa5;
}

#filter-status-list li label {
    margin-left: 0.5rem;
    font-size: 0.95rem;
    color: #333;
}

#linked-quotes-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    visibility: hidden;
    transform-origin: center center;
    transition:
        transform 0.5s ease,
        opacity 0.5s ease,
        visibility 0s linear 0.8s;
    width: 90vw;
    max-width: none;
    max-height: 90vh;
    flex-direction: column;
    z-index: 1000;
}

#linked-quotes-modal:not(.hidden) {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    transition:
        transform 0.5s ease,
        opacity 0.5s ease,
        visibility 0s;
}

#linked-quotes-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.icon-btn.disabled,
.icon-btn.disabled i.material-icons {
    color: #ccc !important;
    pointer-events: none;
}

.form-group.no-float select {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    padding: 14px 4px 8px;
    font-size: 15px;
    outline: none;
}

.form-group.no-float select option {
    font-size: 15px;
    line-height: 1.6;
    padding: 10px 12px;
}

#customer-modal .form-group.no-float select {
    width: 100% !important;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    padding: 14px 4px 8px;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#customer-modal .form-group.no-float select option {
    font-size: 15px;
    line-height: 1.6;
}

.custom-select {
    position: relative;
    user-select: none;
}

.custom-select .select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 4px 8px;
    border-bottom: 1px solid #ccc;
    cursor: pointer;
}



.custom-select .options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.custom-select.open .options {
    display: block;
}

.custom-select .option {
    padding: 10px 12px;
    cursor: pointer;
}

.custom-select .option:hover {
    background: #f1f1f1;
}

.custom-select .option.selected {
    color: #00BCD4;
}

#contact-view-modal {
    z-index: 1000;
}

#edit-modal-overlay {
    z-index: 1100;
}

#customer-modal {
    z-index: 1200;
}

#quote-view-modal {
    width: 50vw;
    max-width: none;
    height: 80vh;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
}

#quote-view-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

.quote-view-header {
    display: flex;
    gap: 24px;
    padding: 12px 55px;
    align-items: flex-start;
    padding-bottom: 90px;
}

.quote-company {
    flex: 0 0 60%;
    min-width: 0;
}

.quote-customer {
    flex: 0 0 40%;
    min-width: 0;
}

.quote-company h2 {
    margin-bottom: 12px;
    font-family: Roboto !important;
    letter-spacing: 0.2px;
}

#quote-customer-block {
    font-family: Roboto !important;
    letter-spacing: 0.2px;
    font-size: 14px !important;
    color: #555 !important;
    font-weight: 100 !important;
}

#quote-customer-block strong {
    font-weight: 600 !important;
}

.printing-pdf .quote-customer strong {
    font-weight: 600 !important;
}

#quote-view-content .quote-company {
    font-family: Roboto !important;
    letter-spacing: 0.2px;
    font-size: 14px !important;
    color: #555 !important;
}

.company-name h2 {
    padding-left: 55px;
    padding-top: 32px;
    font-family: Open Sans !important;
    font-size: 30px !important;
}

.quote-number h2 {
    padding-left: 55px;
}

.quote-name h4 {
    padding-left: 55px;
    color: gray;
    padding-bottom: 50px;
}

.printing-pdf .quote-number h2 {
    padding-left: 55px;
    margin-bottom: 0 !important;
}

.printing-pdf .quote-name h4 {
    padding-left: 55px;
    color: gray;
    padding-bottom: 50px;
    margin-top: 0 !important;
}

.quote-table-title {
    width: calc(100% + 110px);
    margin-left: -55px;
    margin-right: -55px;
    background: lightgreen;
    box-sizing: border-box;
    vertical-align: middle;
}

.quote-table-title td {
    text-align: left;
    vertical-align: middle;
    align-items: center;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.quote-table-title h4 {
    margin: 0;
    text-align: left;
    vertical-align: middle;
    padding-left: 55px;
    padding-right: 0;
    padding-top: 5px;
    padding-bottom: 5px;
}

.printing-pdf .quote-table-title {
    position: relative;
    box-sizing: border-box;
}

.printing-pdf .quote-table-title::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-55px - var(--pdf-margin));
    right: calc(-55px - var(--pdf-margin));
    background: lightgreen;
    pointer-events: none;
    z-index: -1000;
}

.printing-pdf .quote-table-title td::after {
    text-align: left;
    vertical-align: middle;
    align-items: center;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.printing-pdf .quote-table-title {
    border-collapse: collapse;
    border-spacing: 0;
}

.printing-pdf .quote-table-title td {
    padding-top: 5px;
    padding-bottom: 5px;
    vertical-align: middle;
}

.printing-pdf .quote-footer {
    display: none !important;
}

.printing-pdf .quote-table-title h4 {
    margin: 0;
    padding: 5px 0 5px 55px;
    line-height: 1;
}


.items-table {
    padding-right: 55px !important;
    box-sizing: border-box !important;
}

.quote-table th {
    padding: 12px 10px;
}

.quote-table td {
    padding: 4px 10px !important;
}

.quote-table th:first-child,
.quote-table td:first-child {
    width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left !important;
    padding-left: 55px !important;
}

.quote-table th:nth-child(2),
.quote-table td:nth-child(2) {
    width: 10%;
    text-align: right !important;
}

.quote-table th:nth-child(n+3),
.quote-table td:nth-child(n+3) {
    width: 20%;
}

.quote-table th:nth-child(3),
.quote-table td:nth-child(3) {
    text-align: left !important;
}

.quote-table th:nth-child(4),
.quote-table td:nth-child(4) {
    text-align: right !important;
    padding-right: 55px !important;
}

.quote-table-space {
    padding: 10px;
}

.quote-table-sum {
    display: flex;
    flex-direction: row;
}

.quote-table-sum h4 {
    display: flex;
    flex-direction: row;
}

.quote-table-sum-1 {
    width: 60%;
    padding-top: 5px;
    padding-bottom: 5px;
}

.quote-table-sum-2 {
    width: 20%;
    padding: 5px 10px;
    background: lightgreen;
    font-weight: bold;
}

.quote-table-sum-3 {
    width: 20%;
    text-align: right;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 0 !important;
    padding-right: 55px;
    margin-right: -55px;
    background: lightgreen;
    font-weight: bold;
}

.quote-table-space {
    display: flex;
    flex-direction: row;
    padding: 0;
    border-top: 1px solid #eee;
}

.quote-table-space-1 {
    width: 60%;
}

.quote-table-space-2 {
    width: 20%;
    padding: 5px 10px;
    font-size: 14px;
    color: #555;
}

.quote-table-space-3 {
    width: 20%;
    text-align: right;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 0;
    padding-right: 55px;
    font-size: 14px;
    color: #555;
}

.quote-table-newspace {
    display: flex;
    flex-direction: row;
    padding: 0;
}

.quote-table-newspace-1 {
    width: 60%;
}

.quote-table-newspace-2 {
    width: 20%;
    padding: 5px 10px;
    font-size: 14px;
    color: #555;
}

.quote-table-newspace-3 {
    width: 20%;
    text-align: right;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 0;
    padding-right: 55px;
    font-size: 14px;
    color: #555;
}

.printing-pdf .quote-table-newspace-3 {
    padding-right: 50px !important;
}

.quote-message {
    margin-top: 45px;
    padding: 10px 55px;
}

.quote-message textarea {
    width: 100%;
    margin-top: 15px;
    overflow: hidden;
}

.quote-block1>table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    font-weight: 100 !important;
}

.quote-block1 th,
.quote-block1 td {
    
    text-align: left !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    padding: 0px 0px !important;
    font-weight: 100 !important;
}

.quote-block1 th {
    width: 10ch !important;
    min-width: 10ch !important;
    max-width: 10ch !important;
}

.quote-block1 td {
    width: auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.quote-block1 {
    width: 75%;
}

.printing-pdf * {
    transition: none !important;
    animation: none !important;
}

.printing-pdf #quote-view-modal,
.printing-pdf #quote-view-modal-overlay {
    position: fixed !important;
    left: -99999px !important;
    top: 0 !important;
}

.printing-pdf {
    text-align: inherit;
    padding-right: 0;
    font-family: Roboto !important;
}

.printing-pdf h1,
.printing-pdf h2,
.printing-pdf h3,
.printing-pdf h4 {
    font-weight: 700 !important;
}

.printing-pdf .company-name h2 {
    padding-left: 55px;
    padding-top: 32px;
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.83em 0;
    font-family: Open Sans !important;
}

.printing-pdf .company-name {
    font-family: Open Sans !important;
}

.printing-pdf #company-name {
    font-family: Open Sans !important;
}

.printing-pdf h1 {
    font-size: 2em;
    font-weight: bold;
    margin: 0.67em 0;
}

.printing-pdf h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.83em 0;
}

.printing-pdf h3 {
    font-size: 1.17em;
    font-weight: bold;
    margin: 1em 0;
}

.printing-pdf h4 {
    font-size: 1em;
    font-weight: bold;
    margin: 1.33em 0;
}

.printing-pdf {
    --pdf-margin: 32pt;
}

.printing-pdf .quote-table-title {
    width: calc(100% + 110px + (var(--pdf-margin) * 2)) !important;
    margin-left: calc(-55px - var(--pdf-margin)) !important;
    margin-right: calc(-55px - var(--pdf-margin)) !important;
}

.printing-pdf .items-table {
    padding-right: 0 !important;
}

.printing-pdf .quote-table-sum-3 {
    position: relative;
    padding-right: 45px !important;
    margin-right: 0 !important;
}

.printing-pdf .quote-table-sum-3::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    right: calc(-55px - var(--pdf-margin));
    background: lightgreen;
    pointer-events: none;
    z-index: 0;
    padding-right: 0 !important;
    margin-right: 0 !important;
}

#quote-view-modal {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

#quote-view-modal .modal-header {
    flex: 0 0 auto;
    margin: 0 !important;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

#quote-view-modal .modal-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

#quote-view-content {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#quote-view-content .items-table {
    width: 100%;
    table-layout: fixed;
}

#quote-view-modal .modal-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 !important;
}

#quote-view-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

#quote-view-content>* {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

#quote-view-content> :last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

#quote-view-content table {
    width: 100% !important;
    border-collapse: collapse;
}

#quote-view-modal.modal {
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
}

#quote-view-modal {
    gap: 0 !important;
}

#quote-view-modal .modal-content {
    padding-top: 20px;
}

#quote-view-modal .modal-content>*:first-child {
    margin-top: 20px;
}

.quote-footer {
    margin-top: 24px;
    padding: 12px 55px;
}

.quote-footer-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0 0 8px 0;
}

.quote-footer-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    font-size: 12px;
    color: #444;
    text-align: center;
    margin-bottom: 4px;
}

.quote-footer-info .sep {
    opacity: 0.6;
}

.quote-footer-brand {
    text-align: center;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-bottom: 50px;
}

.quote-footer-line {
    white-space: pre-wrap;
    word-break: break-word;
}

#quote-message-text {
    border: none;
    resize: none;
    outline: none;
    width: 100%;
    background: transparent;
}