/* =========================================================================
   KALKULATOR BEBAN KELISTRIKAN & DAYA PLN (PUIL 2020)
   1. Kalkulator Beban & Hasil Analisis Teknis PUIL 2020
   2. Rekomendasi Paket Material Original SNI Siap Pasang
   3. Cetak RAB / Invoice Proyek Standar A4 / PDF
   4. Tombol Aksi Tambah Paket ke Keranjang Belanja & Konsultasi WhatsApp
   5. Tool Pintar Gratis — Homepage Lead Magnet Banner
   100% Mengadopsi Arsitektur & Estetika https://toko-kelistrikan.spi.my.id/
   ========================================================================= */

/* Body scroll lock when modal open */
body.tk-modal-open {
    overflow: hidden !important;
}

/* Modal Overlay Backdrop */
.tk-calc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 18, 31, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.tk-calc-modal-overlay.active {
    display: flex;
    animation: tkFadeIn 0.25s ease-out;
}

@keyframes tkFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Window Container */
.tk-calc-modal {
    background: #ffffff;
    width: 100%;
    max-width: 920px;
    max-height: 92vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    animation: tkSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tkSlideUp {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Modal Header */
.tk-calc-header {
    background: linear-gradient(135deg, #04121f 0%, #0d2744 100%);
    color: #ffffff;
    padding: 18px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 2px solid #f58800;
    flex-shrink: 0;
}

.tk-calc-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.tk-calc-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f58800 0%, #fbbf24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #04121f;
    font-size: 22px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245, 136, 0, 0.35);
}

.tk-calc-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.tk-calc-badge {
    background: rgba(245, 136, 0, 0.2);
    color: #fcd34d;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(245, 136, 0, 0.3);
}

.tk-calc-subbadge {
    font-size: 11px;
    color: #94a3b8;
}

.tk-calc-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.3;
}

.tk-calc-subtitle {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.4;
}

.tk-calc-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    font-size: 18px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}

.tk-calc-close:hover {
    background: rgba(245, 136, 0, 0.25);
    color: #f58800;
}

/* Modal Body (Scrollable) */
.tk-calc-body {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.tk-calc-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.tk-calc-section-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tk-calc-section-title span {
    color: #f58800;
}

.tk-calc-reset-link {
    background: none;
    border: none;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.tk-calc-reset-link:hover {
    color: #e11d48;
    background: #ffe4e6;
}

.tk-calc-section-desc {
    font-size: 11.5px;
    color: #64748b;
    margin: 2px 0 12px 0;
    line-height: 1.45;
}

/* Appliance Grid */
.tk-appliance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.tk-appliance-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.tk-appliance-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

.tk-appliance-card.has-qty {
    border-color: #f58800;
    background: #fffbeb;
    box-shadow: 0 0 0 1px #f58800;
}

.tk-appliance-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 0%;
}

.tk-appliance-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.tk-appliance-text {
    min-width: 0;
    flex: 1 1 0%;
    overflow: hidden;
}

.tk-appliance-name {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 2px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.tk-appliance-watt {
    font-size: 11px;
    font-weight: 700;
    color: #d97706;
    margin: 0;
    line-height: 1.2;
    display: block;
}

/* Stepper Counter Widget */
.tk-counter-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 9px;
    border: 1px solid #cbd5e1;
    box-sizing: border-box;
}

.tk-appliance-card.has-qty .tk-counter-wrap {
    background: #ffffff;
    border-color: #fcd34d;
}

.tk-btn-step {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    border-radius: 7px;
    border: none;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    line-height: 1;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.tk-btn-step:active {
    transform: scale(0.92);
}

.tk-btn-step.tk-btn-minus:hover {
    background: #fee2e2;
    color: #dc2626;
}

.tk-btn-step.tk-btn-plus {
    background: #f58800;
    color: #ffffff;
}

.tk-btn-step.tk-btn-plus:hover {
    background: #e07b00;
}

.tk-step-input {
    width: 28px;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    text-align: center;
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
    appearance: textfield;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.tk-step-input::-webkit-outer-spin-button,
.tk-step-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tk-step-input:hover {
    background: rgba(245, 136, 0, 0.08);
}

.tk-step-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #f58800;
    box-shadow: 0 0 0 2px rgba(245, 136, 0, 0.25);
}

.tk-step-val {
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
}

/* Extra Parameters: Lampu & Custom Watt */
.tk-calc-extras {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 18px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.tk-extra-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tk-extra-desc {
    min-width: 0;
    flex: 1;
}

.tk-extra-label {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.tk-extra-sub {
    font-size: 11px;
    color: #64748b;
}

.tk-extra-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tk-slider {
    width: 100px;
    accent-color: #f58800;
    cursor: pointer;
}

.tk-extra-val {
    font-size: 12px;
    font-weight: 900;
    color: #0f172a;
    min-width: 44px;
    text-align: right;
}

.tk-input-number {
    width: 80px;
    padding: 6px 8px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 800;
    color: #0f172a;
    text-align: right;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.tk-input-number:focus {
    border-color: #f58800;
}

.tk-unit {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

/* Result Dashboard (Dark Theme High-End PUIL 2020) */
.tk-calc-result-box {
    background: linear-gradient(135deg, #04121f 0%, #0d2744 100%);
    border-radius: 20px;
    padding: 20px;
    color: #ffffff;
    border: 1px solid #1e293b;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35);
    margin-bottom: 22px;
}

.tk-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 6px;
}

.tk-result-badge-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fcd34d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tk-result-df {
    font-size: 11px;
    color: #94a3b8;
}

.tk-result-df strong {
    color: #ffffff;
}

.tk-result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.tk-result-card {
    background: rgba(15, 30, 49, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    box-sizing: border-box;
}

.tk-res-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.tk-res-label.text-amber { color: #f59e0b; }
.tk-res-label.text-emerald { color: #10b981; }
.tk-res-label.text-orange { color: #f58800; }

.tk-res-val {
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
    color: #ffffff;
    margin: 3px 0 2px 0;
}

.tk-res-val.text-amber { color: #fbbf24; }
.tk-res-val.text-emerald { color: #34d399; }
.tk-res-val.text-orange { color: #f58800; }

.tk-res-sub {
    font-size: 10px;
    color: #64748b;
    line-height: 1.25;
}

.tk-cable-banner {
    background: rgba(15, 30, 49, 0.65);
    border: 1px dashed rgba(245, 136, 0, 0.4);
    border-radius: 12px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.tk-cable-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e2e8f0;
}

.tk-cable-val {
    color: #fcd34d !important;
}

.tk-cable-note {
    font-size: 10.5px;
    color: #94a3b8;
    font-style: italic;
}

/* =========================================================================
   BAGIAN 2: REKOMENDASI PAKET MATERIAL ORIGINAL SNI SIAP PASANG
   ========================================================================= */
.tk-calc-package-section {
    margin-top: 10px;
    padding-top: 6px;
}

.tk-package-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tk-package-subtotal-box {
    text-align: right;
    flex-shrink: 0;
}

.tk-subtotal-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.3px;
    display: block;
}

.tk-subtotal-val {
    font-size: 16px;
    font-weight: 900;
    color: #dc2626;
    margin-top: 2px;
}

.tk-package-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tk-package-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.tk-package-card:hover {
    border-color: #f58800;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px -3px rgba(245, 136, 0, 0.15);
}

.tk-package-card-top {
    margin-bottom: 12px;
}

.tk-package-img-box {
    height: 110px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.tk-package-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
}

.tk-package-card:hover .tk-package-img-box img {
    transform: scale(1.05);
}

.tk-package-role-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #f58800;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.tk-package-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tk-package-card-bottom {
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.tk-package-qty-label {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
}

.tk-package-qty-label strong {
    color: #0f172a;
    font-weight: 800;
}

.tk-package-price-val {
    font-size: 13px;
    font-weight: 900;
    color: #0f172a;
}

/* =========================================================================
   FOOTER MODAL KALKULATOR
   ========================================================================= */
.tk-calc-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.tk-calc-footer-left,
.tk-calc-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tk-calc-btn-wa {
    background: #16a34a;
    color: #ffffff;
    font-weight: 800;
    font-size: 12.5px;
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.tk-calc-btn-wa:hover {
    background: #15803d;
    color: #ffffff;
}

.tk-calc-btn-invoice {
    background: #0f172a;
    color: #fcd34d;
    font-weight: 800;
    font-size: 12.5px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid #1e293b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.tk-calc-btn-invoice:hover {
    background: #1e293b;
    color: #ffffff;
}

.tk-calc-btn-cart {
    background: #f58800;
    color: #04121f;
    font-weight: 900;
    font-size: 12.5px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(245, 136, 0, 0.3);
}

.tk-calc-btn-cart:hover {
    background: #e07b00;
    color: #04121f;
    transform: translateY(-1px);
}

.tk-calc-btn-cart.loading {
    opacity: 0.75;
    cursor: wait;
}

.tk-calc-btn-cart.success {
    background: #16a34a;
    color: #ffffff;
}

.tk-calc-btn-close {
    background: #ffffff;
    color: #475569;
    font-weight: 700;
    font-size: 12.5px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}

.tk-calc-btn-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* =========================================================================
   MODAL INVOICE / ESTIMASI RAB PROYEK
   ========================================================================= */
.tk-invoice-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 18, 31, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000000;
    display: none;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    box-sizing: border-box;
}

.tk-invoice-modal-overlay.active {
    display: flex;
    animation: tkFadeIn 0.2s ease-out;
}

.tk-invoice-modal-wrapper {
    width: 100%;
    max-width: 920px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Top Action Bar (no-print) */
.tk-invoice-action-bar {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 18px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    flex-wrap: wrap;
}

.tk-invoice-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tk-invoice-bar-icon {
    width: 38px;
    height: 38px;
    background: #f58800;
    color: #04121f;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
}

.tk-invoice-bar-title {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

.tk-invoice-bar-desc {
    font-size: 11px;
    color: #94a3b8;
}

.tk-invoice-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tk-inv-btn {
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 14px;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.tk-inv-btn-edit {
    background: #1e293b;
    color: #fcd34d;
}

.tk-inv-btn-edit.active {
    background: #334155;
    color: #38bdf8;
}

.tk-inv-btn-wa {
    background: #16a34a;
    color: #ffffff;
}

.tk-inv-btn-wa:hover {
    background: #15803d;
}

.tk-inv-btn-print {
    background: #f58800;
    color: #04121f;
    font-weight: 900;
}

.tk-inv-btn-print:hover {
    background: #e07b00;
}

.tk-inv-btn-close {
    background: #1e293b;
    color: #cbd5e1;
    font-size: 14px;
    padding: 8px 12px;
}

.tk-inv-btn-close:hover {
    background: #334155;
    color: #ffffff;
}

/* Lembar Kertas Faktur A4 (#printable-invoice) */
.tk-printable-invoice {
    background: #ffffff;
    color: #0f172a;
    border-radius: 20px;
    padding: 36px 40px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    border: 1px solid #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    box-sizing: border-box;
}

/* Kop Surat */
.tk-inv-kop {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.tk-inv-kop-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.tk-inv-logo-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #04121f 0%, #1e293b 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.tk-inv-brand-name {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    color: #04121f;
    letter-spacing: -0.5px;
    margin: 0 0 2px 0;
    line-height: 1;
}

.tk-inv-brand-sub {
    font-size: 11px;
    font-weight: 700;
    color: #f58800;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.tk-inv-brand-addr {
    font-size: 10.5px;
    color: #475569;
    margin: 0;
    line-height: 1.4;
}

.tk-inv-kop-meta {
    text-align: right;
    flex-shrink: 0;
}

.tk-inv-status-badge {
    display: inline-block;
    background: #0f172a;
    color: #fcd34d;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.tk-inv-meta-row {
    font-size: 11.5px;
    color: #64748b;
    margin-bottom: 2px;
}

.tk-inv-meta-row strong,
.tk-inv-meta-row span {
    color: #0f172a;
}

.tk-inv-meta-sub {
    font-size: 9.5px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Data Klien & Keterangan Proyek */
.tk-inv-client-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 18px;
    font-size: 12px;
}

.tk-inv-col-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.tk-inv-client-name {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
}

.tk-inv-client-phone {
    font-size: 11.5px;
    color: #475569;
    margin-bottom: 2px;
}

.tk-inv-client-addr {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    white-space: pre-line;
}

.tk-inv-project-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 11.5px;
    color: #334155;
    line-height: 1.45;
    font-style: italic;
}

.tk-inv-input {
    width: 100%;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 6px;
    outline: none;
}

.tk-inv-input:focus {
    border-color: #f58800;
}

/* Tabel Invoice */
.tk-inv-table-wrap {
    margin-bottom: 20px;
    overflow-x: auto;
}

.tk-inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.tk-inv-table th {
    background: #f1f5f9;
    color: #334155;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 1.5px solid #cbd5e1;
}

.tk-inv-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.tk-inv-table .col-no { width: 40px; text-align: center; }
.tk-inv-table .col-desc { text-align: left; }
.tk-inv-table .col-brand { width: 120px; text-align: center; }
.tk-inv-table .col-qty { width: 60px; text-align: center; }
.tk-inv-table .col-price { width: 110px; text-align: right; }
.tk-inv-table .col-subtotal { width: 120px; text-align: right; }

.tk-inv-item-name {
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 2px;
}

.tk-inv-item-role {
    font-size: 10.5px;
    color: #f58800;
    font-weight: 700;
}

.tk-inv-item-sku {
    font-size: 9.5px;
    color: #94a3b8;
    font-family: monospace;
}

.tk-inv-badge-brand {
    background: #f1f5f9;
    color: #475569;
    font-size: 9.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* Ringkasan Biaya & Pembayaran */
.tk-inv-summary-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding-top: 16px;
    border-top: 1.5px solid #e2e8f0;
    margin-bottom: 24px;
    font-size: 11.5px;
}

.tk-inv-payment-title {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: #1e293b;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tk-inv-bank-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 8px;
}

.tk-inv-notes {
    font-size: 10px;
    color: #64748b;
    line-height: 1.4;
}

.tk-inv-totals-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tk-inv-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #475569;
}

.tk-inv-total-row.text-emerald {
    color: #16a34a;
    font-weight: 600;
}

.tk-inv-grand-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1.5px solid #e2e8f0;
    padding-top: 10px;
    margin-top: 4px;
    font-size: 13.5px;
    font-weight: 900;
    color: #0f172a;
}

.tk-inv-grand-price {
    font-size: 18px;
    font-weight: 900;
    color: #dc2626;
}

/* Kolom Tanda Tangan */
.tk-inv-signatures {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 11.5px;
}

.tk-inv-sign-role {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tk-inv-sign-space {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 11px;
    font-style: italic;
}

.tk-inv-sign-name {
    font-weight: 800;
    color: #0f172a;
    border-top: 1px solid #cbd5e1;
    display: inline-block;
    padding-top: 4px;
    min-width: 160px;
}

/* =========================================================================
   TOAST NOTIFIKASI TAMBAH KE KERANJANG
   ========================================================================= */
.tk-cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 14px 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    z-index: 1000001;
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: inherit;
    font-size: 12.5px;
    animation: tkSlideUp 0.25s ease-out;
}

.tk-cart-toast-msg {
    font-weight: 700;
}

.tk-cart-toast-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tk-cart-toast-btn {
    background: #f58800;
    color: #04121f;
    font-weight: 900;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 11.5px;
    white-space: nowrap;
}

.tk-cart-toast-btn:hover {
    background: #e07b00;
    color: #04121f;
}

.tk-cart-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.tk-cart-toast-close:hover {
    color: #ffffff;
}

/* =========================================================================
   ATURAN CETAK (@media print)
   ========================================================================= */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        overflow: visible !important;
    }

    /* Sembunyikan elemen non-faktur */
    body > *:not(#tk-invoice-modal) {
        display: none !important;
    }

    .no-print,
    .tk-invoice-action-bar {
        display: none !important;
    }

    #tk-invoice-modal {
        position: static !important;
        background: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 0 !important;
        display: block !important;
        overflow: visible !important;
    }

    .tk-invoice-modal-wrapper {
        max-width: 100% !important;
        margin: 0 !important;
    }

    .tk-printable-invoice {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* =========================================================================
   TOOL PINTAR GRATIS — HOMEPAGE LEAD MAGNET BANNER
   ========================================================================= */
.tk-lead-magnet-section {
    width: 100%;
    max-width: 1200px;
    margin: 18px auto 28px;
    padding: 0 16px;
    box-sizing: border-box;
    position: relative;
    z-index: 20;
}

.tk-lead-magnet-card {
    background: linear-gradient(135deg, #04121f 0%, #0f1e31 50%, #10243e 100%);
    border: 1px solid rgba(71, 85, 105, 0.75);
    border-radius: 22px;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 18px 40px -10px rgba(4, 18, 31, 0.35);
    box-sizing: border-box;
}

.tk-lead-magnet-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
}

.tk-lead-magnet-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f58800 0%, #fbbf24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #04121f;
    font-size: 26px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(245, 136, 0, 0.35);
}

.tk-lead-magnet-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.tk-lead-magnet-badge {
    background: #fbbf24;
    color: #04121f;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    display: inline-block;
}

.tk-lead-magnet-subtag {
    color: #fde68a;
    font-size: 11.5px;
    font-weight: 700;
}

.tk-lead-magnet-title {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    margin: 0 0 5px 0;
    line-height: 1.35;
}

.tk-lead-magnet-desc {
    font-size: 12.5px;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.5;
    max-width: 620px;
}

.tk-lead-magnet-desc strong {
    color: #f58800;
    font-weight: 700;
}

.tk-lead-magnet-btn {
    background: #f58800;
    color: #04121f;
    font-weight: 900;
    font-size: 13.5px;
    padding: 13px 24px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(245, 136, 0, 0.4);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    line-height: 1;
}

.tk-lead-magnet-btn:hover {
    background: #e07b00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 136, 0, 0.5);
    color: #04121f;
}

/* =========================================================================
   HEADER BUTTONS (DESKTOP NAV & DRAWER MOBILE)
   ========================================================================= */

/* Desktop Header Kalkulator Listrik Button (Persis toko-kelistrikan.spi.my.id) */
.tk-desktop-nav-calc-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-left: 10px !important;
    padding: 6px 14px !important;
    border-radius: 9999px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    background: #fffbeb !important;
    color: #78350f !important;
    border: 1px solid #fcd34d !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.08) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
}

.tk-desktop-nav-calc-btn:hover {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #451a03 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.2) !important;
}

.tk-desktop-nav-calc-btn .bolt {
    color: #d97706 !important;
    font-weight: 900 !important;
    font-size: 13px !important;
    line-height: 1 !important;
}

.tk-desktop-nav-calc-btn .txt {
    font-size: 12px !important;
    font-weight: 700 !important;
}

@media only screen and (max-width: 1024px) {
    .tk-desktop-nav-calc-btn {
        display: none !important;
    }
}

/* Sembunyikan tombol kalkulator pada header mobile (karena sudah tersedia di menu navigasi) */
.tk-mobile-header-calc-btn {
    display: none !important;
}

/* Tombol Kalkulator Beban Listrik pada Drawer Menu Navigasi Mobile */
.tk-mobile-drawer-calc-wrap {
    padding: 10px 16px 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.tk-mobile-drawer-calc-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 800;
    background: linear-gradient(135deg, #04121f 0%, #0d2744 100%);
    color: #ffffff;
    border: 1px solid rgba(245, 136, 0, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(4, 18, 31, 0.15);
}

.tk-mobile-drawer-calc-btn:hover,
.tk-mobile-drawer-calc-btn:active {
    background: linear-gradient(135deg, #f58800 0%, #e07b00 100%);
    color: #04121f;
    border-color: #f58800;
}

.tk-drawer-calc-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tk-drawer-calc-left .bolt {
    font-size: 17px;
    line-height: 1;
}

.tk-drawer-puil-badge {
    font-size: 10px;
    background: #f58800;
    color: #04121f;
    font-weight: 900;
    padding: 3px 7px;
    border-radius: 6px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.tk-mobile-drawer-calc-btn:hover .tk-drawer-puil-badge,
.tk-mobile-drawer-calc-btn:active .tk-drawer-puil-badge {
    background: #04121f;
    color: #fcd34d;
}

/* =========================================================================
   RESPONSIF MOBILE & TABLET (MEDIA QUERIES)
   ========================================================================= */
@media (max-width: 1024px) {
    .tk-desktop-nav-calc-btn {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .tk-calc-result-box {
        padding: 14px;
    }
    .tk-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tk-lead-magnet-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }
    .tk-lead-magnet-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .tk-calc-modal-overlay {
        padding: 10px 8px;
    }
    /* Tinggi Modal Mobile Lebih Pendek & Pas di Layar */
    .tk-calc-modal {
        max-height: 84vh !important;
        border-radius: 18px;
        margin: auto;
    }
    .tk-calc-header {
        padding: 10px 14px;
    }
    .tk-calc-icon-badge {
        width: 34px;
        height: 34px;
        font-size: 16px;
        border-radius: 10px;
    }
    .tk-calc-title h3 {
        font-size: 14px;
    }
    .tk-calc-subtitle {
        display: none;
    }
    .tk-calc-close {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
    .tk-calc-body {
        padding: 10px 12px;
    }
    .tk-calc-section-title {
        font-size: 12.5px;
    }
    .tk-calc-section-desc {
        font-size: 10.5px;
        margin-bottom: 8px;
    }
    .tk-appliance-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-bottom: 10px;
    }
    .tk-appliance-card {
        padding: 7px 10px;
        border-radius: 11px;
    }
    .tk-appliance-icon {
        font-size: 17px;
    }
    .tk-appliance-name {
        font-size: 11.5px;
    }
    .tk-appliance-watt {
        font-size: 10px;
    }
    .tk-btn-step {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
        font-size: 13px;
    }
    .tk-step-val {
        font-size: 11px;
        width: 16px;
        min-width: 16px;
    }
    .tk-calc-extras {
        grid-template-columns: 1fr;
        padding: 8px 10px;
        gap: 8px;
        margin-bottom: 10px;
        border-radius: 12px;
    }
    .tk-extra-label {
        font-size: 11px;
    }
    .tk-extra-sub {
        font-size: 10px;
    }
    .tk-slider {
        width: 80px;
    }
    .tk-calc-result-box {
        padding: 12px;
        border-radius: 14px;
        margin-bottom: 10px;
    }
    .tk-result-header {
        padding-bottom: 8px;
        margin-bottom: 10px;
    }
    .tk-result-badge-title {
        font-size: 11px;
    }
    .tk-result-df {
        font-size: 10px;
    }
    .tk-result-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-bottom: 8px;
    }
    .tk-result-card {
        padding: 7px 9px;
        border-radius: 10px;
    }
    .tk-res-label {
        font-size: 8.5px;
    }
    .tk-res-val {
        font-size: 14.5px;
        margin: 2px 0 1px 0;
    }
    .tk-res-sub {
        font-size: 8.5px;
    }
    .tk-cable-banner {
        padding: 7px 10px;
        font-size: 10.5px;
        border-radius: 8px;
        gap: 4px;
    }
    .tk-calc-package-section {
        margin-top: 4px;
    }
    .tk-package-header {
        margin-bottom: 8px;
    }
    .tk-subtotal-label {
        font-size: 9.5px;
    }
    .tk-subtotal-val {
        font-size: 13.5px;
    }
    /* Compact Horizontal Cards untuk Paket Material di Mobile */
    .tk-package-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .tk-package-card {
        flex-direction: row;
        align-items: center;
        padding: 8px 10px;
        gap: 10px;
        border-radius: 12px;
    }
    .tk-package-card-top {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
        margin-bottom: 0;
    }
    .tk-package-img-box {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
        margin-bottom: 0;
        padding: 4px;
        border-radius: 8px;
    }
    .tk-package-role-tag {
        font-size: 9px;
        margin-bottom: 2px;
    }
    .tk-package-title {
        font-size: 11px;
        line-height: 1.25;
    }
    .tk-package-card-bottom {
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        padding-top: 0;
        border-top: none;
        flex-shrink: 0;
        border-left: 1px solid #f1f5f9;
        padding-left: 8px;
    }
    .tk-package-qty-label {
        font-size: 10px;
    }
    .tk-package-price-val {
        font-size: 11.5px;
    }
    .tk-calc-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 8px;
    }
    .tk-calc-footer-left,
    .tk-calc-footer-right {
        width: 100%;
        flex-direction: column;
        gap: 6px;
    }
    .tk-calc-btn-wa,
    .tk-calc-btn-invoice,
    .tk-calc-btn-cart,
    .tk-calc-btn-close {
        width: 100%;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
        padding: 8px 12px;
        font-size: 11.5px;
        border-radius: 10px;
    }
    .tk-invoice-modal-wrapper {
        max-height: 86vh;
    }
    .tk-printable-invoice {
        padding: 16px 12px;
        border-radius: 14px;
    }
    .tk-inv-kop {
        flex-direction: column;
        gap: 10px;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    .tk-inv-kop-meta {
        text-align: left;
    }
    .tk-inv-client-section,
    .tk-inv-summary-section,
    .tk-inv-signatures {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .tk-calc-modal {
        max-height: 82vh !important;
    }
    .tk-lead-magnet-section {
        margin: 10px auto 16px;
        padding: 0 10px;
    }
    .tk-lead-magnet-card {
        padding: 14px;
        border-radius: 14px;
    }
    .tk-lead-magnet-title {
        font-size: 15px;
    }
    .tk-lead-magnet-desc {
        font-size: 11px;
    }
    .tk-cart-toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 10px 14px;
        font-size: 11.5px;
    }
}

