/* ========================================
   Reusable Components
   ======================================== */

/* Buttons */
.btn {
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 18px;
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md); filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--gradient-navy); color: #fff; }
.btn-gold { background: var(--gradient-gold); color: #fff; box-shadow: var(--shadow-gold); }
.btn-secondary { background: #e5eaf0; color: var(--navy); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--navy); padding: 6px 10px; }
.btn-sm { padding: 5px 10px; font-size: var(--font-size-sm); }

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-top: 3px solid rgba(245, 166, 35, 0.35);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-heading {
    margin: 0 0 12px;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e9f1;
}

/* Form Fields */
.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}

.field label {
    font-size: var(--font-size-sm);
    color: var(--muted);
    font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="password"],
input[type="email"],
select,
textarea {
    font-family: inherit;
    border: 1.5px solid #d7dee7;
    border-radius: var(--radius-md);
    padding: 8px 10px;
    font-size: var(--font-size-base);
    width: 100%;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-slow);
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2a6ab0;
    box-shadow: 0 0 0 3px rgba(42, 106, 176, 0.18);
    background: #f8fbff;
}

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

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Data Table */
.table-scroll {
    overflow: auto;
    max-height: calc(100vh - 300px);
    min-height: 180px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    min-width: 640px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table th {
    background: var(--navy-light);
    color: var(--navy);
    text-align: right;
    padding: 9px 10px;
    font-size: 0.88rem;
    font-weight: 800;
    border-bottom: 2px solid #d7e2ee;
    position: sticky;
    top: 0;
    z-index: 3;
}

.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-size: var(--font-size-base);
    vertical-align: top;
}

.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:nth-child(even) td { background: #f8fafd; }
.data-table tbody tr:hover { background: #eef5fc; }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.tabs button {
    background: none;
    border: none;
    padding: 10px 18px;
    font-family: inherit;
    font-size: var(--font-size-md);
    cursor: pointer;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition-base), border-color var(--transition-base);
}

.tabs button.active {
    color: var(--navy);
    font-weight: 700;
    border-bottom-color: var(--navy);
}

/* Tier Toggle */
.tier-toggle {
    display: flex;
    gap: 5px;
    margin-bottom: 16px;
    background: #e8edf4;
    border-radius: var(--radius-full);
    padding: 5px;
}

.tier-toggle button {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    color: #55677d;
    transition: all var(--transition-base);
}

.tier-toggle button.active {
    background: var(--gradient-navy);
    color: #fff;
    box-shadow: 0 3px 10px rgba(26, 58, 92, 0.35);
}

/* Tags/Badges */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    font-size: var(--font-size-base);
    border-inline-start-width: 4px;
    border-inline-start-style: solid;
}
.alert-info { background: var(--info-bg); color: var(--info); border-inline-start-color: var(--info); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-inline-start-color: var(--gold); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-inline-start-color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); border-inline-start-color: var(--success); }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: var(--overlay);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 8px;
    animation: fade-in 0.2s ease-out;
}

.modal {
    background: #fff;
    border-radius: var(--radius-xl);
    width: 560px;
    max-width: 94vw;
    max-height: 88vh;
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modal-pop 0.22s ease-out;
}

.modal-zoom-btn {
    position: absolute;
    top: 10px;
    left: 12px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid #d7dee7;
    background: #f4f7fa;
    color: var(--navy);
    font-size: 1rem;
    cursor: pointer;
    z-index: 5;
    transition: background 0.15s, transform 0.12s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-zoom-btn:hover {
    background: #e8eef5;
}
.modal-zoom-btn:active {
    transform: scale(0.93);
}

.modal h3 {
    flex: 0 0 auto;
    margin: 0;
    padding: 20px 22px 10px;
    color: var(--navy);
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 22px 16px;
}

.modal-wide {
    width: 92vw;
    max-width: 1200px;
}

.modal-max {
    width: 96vw !important;
    max-width: 96vw !important;
    height: 93dvh !important;
    max-height: 93dvh !important;
    overflow: hidden !important;
}

.modal-max .import-table-wrap {
    max-height: calc(93dvh - 200px) !important;
}

.import-table-wrap {
    overflow-x: auto;
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.import-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}
.import-table td {
    padding: 5px 6px;
}
.import-table input,
.import-table select,
.import-table textarea {
    font-size: 0.85rem;
    padding: 5px 6px;
    min-width: 70px;
}

.issue-note {
    color: #8a6d00 !important;
    font-size: 0.75rem;
    white-space: normal;
    max-width: 180px;
    font-weight: 600;
}

.total-badge {
    background: linear-gradient(135deg, #f5a623, #e8940a) !important;
    color: #fff !important;
    border-radius: 999px !important;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.35) !important;
    font-size: 1rem;
    font-weight: 700;
    padding: 6px 16px;
    display: inline-flex;
    align-items: center;
}

.modal-footer {
    flex: 0 0 auto;
    padding: 12px 22px;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

@media (max-width: 600px) {
    .modal-footer {
        padding: 12px 16px;
        gap: 8px;
        flex-direction: column;
    }
    .modal-footer button {
        width: 100%;
        min-width: 100%;
        flex: 1 1 auto;
        font-size: 0.92rem;
        padding: 11px 14px;
        text-align: center;
        justify-content: center;
    }
}

.modal-footer [onclick*="closeModal"],
.modal-footer [id*="cancel"],
.modal-footer [id*="no-btn"],
.modal-footer .btn-cancel {
    order: 99 !important;
}

/* Quote Modal Info Grid */
.quote-modal-info-card {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.quote-modal-info-card .info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.quote-modal-info-card .info-cell {
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quote-modal-info-card .info-cell .lbl {
    color: var(--text-secondary);
    font-size: 0.82rem;
    flex-shrink: 0;
}
@media (max-width: 520px) {
    .quote-modal-info-card .info-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* Quote Items Header & View Switcher */
.quote-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 10px;
    gap: 10px;
}
.quote-items-header h4 {
    margin: 0;
    color: var(--navy);
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.view-toggle-group {
    display: inline-flex;
    background: var(--bg-alt);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.view-toggle-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.view-toggle-btn.active {
    background: #fff;
    color: var(--navy);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 700;
}

/* Quote Items Cards (Mobile Optimized) */
.quote-items-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.quote-item-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}
.quote-item-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.quote-item-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.quote-item-index-title {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
}
.quote-item-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    background: var(--navy-light);
    color: var(--navy);
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 1px;
}
.quote-item-main-title {
    font-weight: 700;
    color: var(--navy);
    font-size: 0.92rem;
    line-height: 1.45;
}
.quote-item-qty {
    background: var(--info-bg);
    color: var(--info);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.quote-item-specs {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-md);
    padding: 8px 10px;
    margin: 6px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.quote-item-spec-line {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.quote-item-spec-line .bullet {
    color: var(--gold);
    font-size: 0.7rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.quote-item-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px dashed var(--border-light);
    margin-top: 4px;
}
.quote-item-card-bottom .price-col {
    display: flex;
    flex-direction: column;
}
.quote-item-card-bottom .price-lbl {
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 1px;
}
.quote-item-card-bottom .price-val {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}
.quote-item-card-bottom .price-col.total .price-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--success);
}

/* Quote Total Summary Bar */
.quote-modal-total-bar {
    background: linear-gradient(135deg, var(--navy-dark), var(--navy));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    box-shadow: 0 4px 14px rgba(26, 58, 92, 0.2);
}
.quote-modal-total-bar .total-label {
    font-size: 0.92rem;
    font-weight: 600;
    opacity: 0.92;
}
.quote-modal-total-bar .total-amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.3px;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop { from { transform: scale(0.92); opacity: 0.5; } to { transform: scale(1); opacity: 1; } }

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input { max-width: 280px; }

/* Action Bar (Sticky Bottom) */
.action-bar {
    position: sticky;
    bottom: 8px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e2e9f1;
    border-radius: var(--radius-xl);
    padding: 10px 14px;
    box-shadow: var(--shadow-lg);
    margin-top: 12px;
}

.action-total {
    font-weight: 800;
    font-size: var(--font-size-xl);
    color: var(--navy-dark);
    white-space: nowrap;
}
.action-total small { font-weight: 600; color: var(--muted); }

/* Big Inputs (for quote builder) */
.big-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.big-inputs .field input {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    padding: 14px;
    color: var(--navy);
}

.big-inputs .field label { text-align: center; font-size: var(--font-size-md); }

/* Inventory Cards */
.inv-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    align-items: start;
}

.inv-card {
    position: relative;
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: var(--radius-lg);
    padding: 14px 14px 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    overflow: hidden;
}

.inv-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--navy);
    opacity: 0.85;
}

.inv-card:hover {
    box-shadow: 0 6px 18px rgba(18, 41, 67, 0.13);
    transform: translateY(-1px);
}

.inv-card-head { display: flex; align-items: flex-start; gap: 8px; }
.inv-card-title { font-size: 0.95rem; color: var(--navy-dark); line-height: 1.5; flex: 1; }
.inv-card-title b { color: var(--navy); }

.inv-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--muted);
}
.inv-card-meta b { color: var(--navy-dark); font-weight: 700; }

.inv-card-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.3px;
}
.inv-card-price small { font-size: 0.72rem; font-weight: 600; color: var(--muted); }

.inv-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.inv-card-btns { display: flex; gap: 8px; }

/* Inactive Card */
.inv-card-off {
    opacity: 0.65;
    background: #fbfbfc;
}
.inv-card-off::before {
    background: #94a3b8;
}

/* Card Checkbox */
.inv-card-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}
.inv-card-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--navy);
    cursor: pointer;
}

/* Hidden Badge */
.inv-card-badge {
    margin-inline-start: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 2px 7px;
}

/* IP Badges */
.ip-missing {
    color: #9a3412;
    background: #ffedd5;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.ip-badge {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

/* IP Fill Banner */
.ip-fill {
    margin: 10px 0 16px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    border-radius: 12px;
    padding: 12px 16px;
}
.ip-fill-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.6;
}
.ip-fill-head > span:nth-child(2) {
    flex: 1;
    min-width: 220px;
}
.ip-fill-warn { font-size: 1.2rem; }
.ip-fill-body {
    margin-top: 12px;
    border-top: 1px dashed #fcd34d;
    padding-top: 12px;
}
.ip-fill-group { margin-bottom: 14px; }
.ip-fill-group h4 {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: var(--navy);
    font-weight: 800;
}
.ip-fill-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #fef3c7;
    font-size: 0.85rem;
}
.ip-fill-row:last-child { border-bottom: none; }
.ip-fill-name { flex: 1; min-width: 0; }
.ip-fill-row input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
}
.ip-fill-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.ip-fill-msg {
    margin: 8px 0 4px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #eef3f8;
    border: 1px solid #c7d2db;
    color: #1a3a5c;
    font-size: 0.85rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: var(--font-size-lg); font-weight: 700; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state-desc { font-size: var(--font-size-base); }

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 12px 18px;
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    pointer-events: auto;
    animation: toast-in 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.toast-success { border-right: 4px solid var(--success); color: var(--success); }
.toast-error { border-right: 4px solid var(--danger); color: var(--danger); }
.toast-info { border-right: 4px solid var(--info); color: var(--info); }

@keyframes toast-in { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Responsive Components */
@media (max-width: 700px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 8px; }
    .big-inputs { grid-template-columns: 1fr 1fr; gap: 10px; }
    .big-inputs .field input { font-size: 1.1rem; padding: 10px; }
    .modal { width: 94vw; }
    .card { padding: 16px; margin-bottom: 14px; }
    input, select, textarea { font-size: 16px !important; }
    .btn { min-height: 42px; }
    .toolbar { flex-wrap: wrap; }
    .data-table th, .data-table td { font-size: 0.78rem; padding: 6px; }
    .tabs button { padding: 8px 10px; font-size: 0.82rem; }
    .inv-cards { grid-template-columns: 1fr; gap: 12px; }
}

/* Quotes Filter Card (Exact Match to Design) */
.quotes-filters {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(18, 41, 67, 0.05);
}
.qf-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 9px;
    padding: 9px 11px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 11px;
}
.qf-row:last-child {
    margin-bottom: 0;
}
.qf-label {
    font-weight: 800;
    color: var(--navy);
    font-size: .84rem;
    margin-inline-end: 6px;
    min-width: 54px;
}
.qf-chip {
    cursor: pointer;
    border: 1px solid #ccd6e2;
    background: #fff;
    color: var(--navy);
    border-radius: 18px;
    padding: 4px 11px;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    transition: all .14s ease;
}
.qf-chip b {
    font-size: .74rem;
    background: #eef3f8;
    border-radius: 10px;
    padding: 1px 7px;
    color: #4a6a88;
    font-weight: 800;
}
.qf-chip:hover {
    background: #f2f6fa;
    border-color: #b9cadc;
}
.qf-chip.on {
    border: 2px solid var(--navy);
    background: #e9f0f9;
    padding: 3px 10px;
    box-shadow: 0 1px 4px rgba(26, 58, 92, 0.15);
}
.qf-chip.status-normal b { background: #d7ecfb; color: #23628f; }
.qf-chip.status-follow b { background: #ffe9c7; color: #8a5b00; }
.qf-chip.status-urgent b { background: #e63946; color: #fff; }
.qf-chip.status-done b { background: #d9f2e1; color: #1c7c46; }

.qf-chip.qf-pay-inst b { background: #ffe9c7; color: #8a5b00; }
.qf-chip.qf-pay-cash b { background: #e7f1ea; color: #2f8a4b; }

.qf-accounts {
    margin-inline-start: auto;
}
.qf-accounts-bar {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.qf-note {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #edf2f7;
    font-size: .82rem;
    color: #5a6b7d;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.qf-clear {
    cursor: pointer;
    border: 1px solid #ccd6e2;
    background: #fff;
    color: #8a3a3a;
    border-radius: 12px;
    padding: 2px 10px;
    font-family: inherit;
    font-size: .76rem;
    font-weight: 700;
}
.qf-clear:hover {
    background: #fdf2f2;
}
@media (max-width: 640px) {
    .qf-accounts { margin-inline-start: 0; }
    .qf-label { width: 100%; margin-bottom: 2px; }
}

/* Quotes Cards Enhanced */
.qc-status-chip {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 3px 10px;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.qc-status-badge {
    border-radius: 14px;
    padding: 3px 10px;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.qc-status-normal { background: #d7ecfb; color: #23628f; }
.qc-status-follow { background: #ffe9c7; color: #8a5b00; }
.qc-status-urgent { background: #e63946; color: #fff; }
.qc-status-done { background: #d9f2e1; color: #1c7c46; }

/* Quote export dialog */
.export-dialog-modal {
    max-height: 94vh;
    max-height: 94dvh;
}
.export-dialog-modal > h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
}
.export-dialog-modal > h3::before {
    content: "↗";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #fff;
    background: var(--gradient-navy);
    font-size: 1.15rem;
}
.export-dialog-modal .modal-body {
    padding-bottom: 18px;
}
.export-dialog {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    text-align: start;
}
.export-quote-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-inline-start: 4px solid var(--gold);
    border-radius: 12px;
    background: var(--bg-alt);
}
.export-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--navy);
    background: var(--card-bg);
    font-size: 1.35rem;
    font-weight: 800;
}
.export-summary-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.export-summary-eyebrow {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
}
.export-summary-copy strong {
    color: var(--text);
    font-size: .94rem;
}
.export-summary-copy > span:last-child {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.export-copy-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--navy) 16%, transparent);
    border-radius: 999px;
    color: var(--navy);
    background: var(--card-bg);
    font-size: .76rem;
    font-weight: 700;
}
.export-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.export-section-heading h4 {
    margin: 0 0 3px;
    color: var(--text);
    font-size: .98rem;
}
.export-section-heading p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .78rem;
}
.export-preview-count {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
}
.export-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.export-tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-secondary);
    background: var(--card-bg);
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.export-tab-btn:hover {
    transform: translateY(-1px);
    border-color: var(--navy);
}
.export-tab-btn.is-active {
    border-color: var(--navy);
    color: var(--navy);
    background: var(--navy-light);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--navy) 12%, transparent);
}
.export-tab-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: var(--text-secondary);
    background: var(--bg-alt);
    font-size: .82rem;
    font-weight: 800;
}
.export-tab-btn.is-active .export-tab-number {
    color: #fff;
    background: var(--gradient-navy);
}
.export-tab-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.export-tab-copy strong {
    overflow: hidden;
    color: inherit;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.export-tab-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: .69rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.export-preview-frame {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--bg-alt);
    box-shadow: var(--shadow-sm);
}
.export-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--card-bg);
    font-size: .72rem;
    font-weight: 700;
}
.export-preview-toolbar > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.export-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent);
}
.export-preview-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 16px;
    background: var(--bg-alt);
    scrollbar-width: none;
}
.export-preview-scale {
    display: block;
    flex: 0 0 794px;
    width: 794px;
    transform-origin: top center;
}
.export-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-alt);
}
.export-actions-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.export-actions-copy strong {
    color: var(--text);
    font-size: .88rem;
}
.export-actions-copy span {
    color: var(--text-secondary);
    font-size: .74rem;
}
.export-action-buttons {
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
}
.export-action-btn {
    justify-content: flex-start;
    min-width: 168px;
    padding: 8px 12px;
    text-align: start;
}
.export-action-btn > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.export-action-btn strong {
    font-size: .81rem;
}
.export-action-btn small {
    color: inherit;
    opacity: .78;
    font-size: .68rem;
    font-weight: 600;
}
.export-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid currentColor;
    border-radius: 9px;
    font-size: .66rem;
    font-weight: 800;
}
.export-jpg-btn {
    color: var(--navy);
    background: var(--card-bg);
    border: 1px solid var(--border);
}
@media (max-width: 700px) {
    .export-dialog {
        gap: 14px;
    }
    .export-quote-summary {
        flex-wrap: wrap;
        padding: 12px;
    }
    .export-copy-count {
        margin-inline-start: 52px;
    }
    .export-tabs {
        grid-template-columns: 1fr;
        gap: 7px;
    }
    .export-tab-btn {
        min-height: 48px;
        padding: 7px 10px;
    }
    .export-tab-copy strong {
        font-size: .8rem;
    }
    .export-preview-container {
        max-height: none;
        padding: 10px;
    }
    .export-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    .export-action-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .export-action-btn {
        min-width: 0;
        padding-inline: 8px;
    }
}
@media (max-width: 380px) {
    .export-dialog-modal > h3 {
        padding-inline: 14px;
    }
    .export-dialog-modal .modal-body {
        padding-inline: 12px;
    }
    .export-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .export-preview-container {
        padding: 7px;
    }
    .export-action-buttons {
        grid-template-columns: 1fr;
    }
}

.quote-followup-editor {
    margin-bottom: 16px;
    border-inline-start: 4px solid var(--navy);
}
.quote-followup-editor[hidden] {
    display: none;
}
.quote-followup-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.quote-followup-editor-head h3 {
    margin: 0 0 5px;
    color: var(--navy);
    font-size: 1.02rem;
}
.quote-followup-editor-head p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .84rem;
}
.quote-followup-editor-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--navy);
    background: var(--bg-alt);
    font-size: .74rem;
    font-weight: 700;
}
.quote-followup-status-field,
.quote-followup-note-field {
    margin-bottom: 14px;
}
.quote-followup-status-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}
.quote-followup-status-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.quote-followup-status-option:hover {
    transform: translateY(-1px);
}
.quote-followup-status-option.is-selected {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}
.quote-followup-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.quote-followup-note-field textarea {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--card-bg);
    color: var(--text);
    font: inherit;
}
@media (max-width: 640px) {
    .quote-followup-status-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .quote-followup-editor-head {
        flex-direction: column;
    }
}
