:root {
    --green-main:  #16a34a;
    --green-dark:  #14532d;
    --green-light: #dcfce7;
    --pk-green:    #01411C;
    --pk-white:    #ffffff;
}
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: #f0fdf4;
    min-height: 100vh;
}
h1, h2, h3, .urdu-label { font-family: 'Baloo Bhai 2', sans-serif; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: var(--green-main); border-radius: 10px; }

/* ══════════════════════════════════════════
   HERO HEADER
══════════════════════════════════════════ */
.hero-bg {
    background: linear-gradient(135deg, #01411C 0%, #16a34a 50%, #065f46 100%);
    position: relative;
    overflow: hidden;
}
.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-icon-box {
    width: 3rem; height: 3rem;
    background: rgba(255,255,255,.18);
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hero-badge {
    background: rgba(255,255,255,.15);
    border-radius: 999px;
    padding: .3rem .85rem;
    font-size: .75rem;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

/* ══════════════════════════════════════════
   CUSTOM CARD  (replaces Tailwind .card)
══════════════════════════════════════════ */
.bjli-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #f0fdf4;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
    overflow: hidden;
}
.bjli-card-header {
    padding: .875rem 1.25rem;
    border-radius: 0; /* card already clips */
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.bjli-card-header.green-grad {
    background: linear-gradient(to right, #01411C, #16a34a);
    color: #fff;
}
.bjli-card-header.slate-grad {
    background: linear-gradient(to right, #334155, #475569);
    color: #fff;
    font-size: .78rem;
}
.bjli-card-header.row-grad {
    background: linear-gradient(to right, #15803d, #16a34a);
    color: #fff;
    justify-content: space-between;
}
.bjli-card-body { padding: 1.25rem; }

/* ══════════════════════════════════════════
   COMPANY BUTTONS
══════════════════════════════════════════ */
.company-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: .75rem .5rem;
    border-radius: .75rem;
    border: 2px solid transparent;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s, outline .2s;
    width: 100%;
}
.company-btn:hover {
    border-color: #4ade80;
    background: #f0fdf4;
}
.company-btn.selected-co {
    background: #f0fdf4;
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}
.company-logo-circle {
    width: 2.5rem; height: 2.5rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: .75rem; font-weight: 900;
    box-shadow: 0 2px 6px rgba(0,0,0,.22);
    flex-shrink: 0;
}
.company-name-label { font-weight: 700; font-size: .72rem; color: #1f2937; }
.company-prov-label  { font-size: .65rem; color: #6b7280; line-height: 1.3; }

/* ══════════════════════════════════════════
   SELECTED COMPANY INFO BOX
══════════════════════════════════════════ */
.sci-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: .75rem;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.company-badge {
    display: inline-flex; align-items: center;
    padding: .3rem .85rem;
    border-radius: 999px;
    font-size: .75rem; font-weight: 700;
    color: #fff;
}

/* ══════════════════════════════════════════
   TOGGLE SWITCH
══════════════════════════════════════════ */
.toggle-wrap { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.toggle-sw {
    position: relative;
    display: inline-block;
    width: 42px; height: 24px;
    flex-shrink: 0;
}
.toggle-sw input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #e5e7eb;
    border-radius: 24px;
    transition: .3s;
}
.toggle-slider::before {
    position: absolute; content: "";
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-sw input:checked + .toggle-slider { background: var(--green-main); }
.toggle-sw input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ══════════════════════════════════════════
   QUICK DAYS BUTTONS
══════════════════════════════════════════ */
.quick-day-btn {
    padding: .2rem .6rem;
    background: #dcfce7;
    color: #15803d;
    border: none;
    border-radius: .375rem;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.quick-day-btn:hover { background: #bbf7d0; }

/* ══════════════════════════════════════════
   ADD ROW BUTTON
══════════════════════════════════════════ */
.add-row-btn {
    width: 100%;
    border: 2px dashed #86efac;
    background: #f0fdf4;
    color: #15803d;
    font-weight: 700;
    padding: 1rem;
    border-radius: .75rem;
    display: flex; align-items: center; justify-content: center;
    gap: .5rem;
    transition: border-color .2s, background .2s;
    cursor: pointer;
    font-size: .95rem;
}
.add-row-btn:hover { border-color: #16a34a; background: #dcfce7; }

/* ══════════════════════════════════════════
   CALCULATE BUTTON
══════════════════════════════════════════ */
.calc-btn {
    width: 100%;
    background: linear-gradient(to right, #01411C, #16a34a);
    border: none;
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
    padding: 1.1rem;
    border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    gap: .75rem;
    cursor: pointer;
    transition: opacity .2s, box-shadow .2s, transform .1s;
    box-shadow: 0 4px 16px rgba(1,65,28,.35);
}
.calc-btn:hover:not(:disabled) {
    background: linear-gradient(to right, #02591f, #15803d);
    box-shadow: 0 6px 24px rgba(1,65,28,.45);
}
.calc-btn:active:not(:disabled) { transform: scale(.99); }
.calc-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ══════════════════════════════════════════
   GRAND TOTAL CARD
══════════════════════════════════════════ */
.grand-card {
    background: linear-gradient(135deg, #01411C, #16a34a);
    border-radius: 1.25rem;
    color: #fff;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
}
.grand-card::after {
    content: '⚡';
    position: absolute; right: 1rem; bottom: -1rem;
    font-size: 7rem; opacity: .07; line-height: 1;
    pointer-events: none;
}
.grand-sub-box {
    background: rgba(255,255,255,.12);
    border-radius: .75rem;
    padding: .75rem;
}

/* ══════════════════════════════════════════
   CUSTOM TABS  (not Bootstrap tabs)
══════════════════════════════════════════ */
.tab-bar { padding: .75rem; border-bottom: 1px solid #f3f4f6; display: flex; flex-wrap: wrap; gap: .35rem; }
.tab-btn {
    padding: .4rem .9rem;
    border-radius: .5rem;
    font-size: .78rem; font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    color: #6b7280;
    background: transparent;
    border: none;
}
.tab-btn.active { background: var(--green-main); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ══════════════════════════════════════════
   RESULT PANEL
══════════════════════════════════════════ */
#resultPanel { display: none; }
#resultPanel.active { display: block; animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════════════
   ACTION BUTTONS
══════════════════════════════════════════ */
.action-btns { display: flex; gap: .75rem; }
.action-btn-print {
    flex: 1;
    background: #334155; color: #fff; border: none;
    font-weight: 700; padding: .75rem 1rem; border-radius: .75rem;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    font-size: .875rem; cursor: pointer; transition: background .2s;
}
.action-btn-print:hover { background: #1e293b; }
.action-btn-copy {
    flex: 1;
    background: #059669; color: #fff; border: none;
    font-weight: 700; padding: .75rem 1rem; border-radius: .75rem;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    font-size: .875rem; cursor: pointer; transition: background .2s;
}
.action-btn-copy:hover { background: #047857; }

/* ══════════════════════════════════════════
   APPLIANCE ROW
══════════════════════════════════════════ */
.appliance-row { animation: slideIn .35s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.appliance-row.removing { animation: slideOut .3s ease forwards; }
@keyframes slideOut { to { opacity: 0; transform: translateX(60px); max-height: 0; margin: 0; padding: 0; overflow: hidden; } }

.remove-row-btn {
    width: 1.75rem; height: 1.75rem;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    border: none; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .7rem; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.remove-row-btn:hover { background: #ef4444; }

/* ══════════════════════════════════════════
   FORM SELECTS & INPUTS
══════════════════════════════════════════ */
.bjli-select, .bjli-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: .55rem .75rem;
    font-size: .875rem;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
    color: #111827;
}
.bjli-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2316a34a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    padding-right: 2.25rem;
}
.bjli-select:focus, .bjli-input:focus {
    outline: none;
    border-color: var(--green-main);
    box-shadow: 0 0 0 3px rgba(22,163,74,.18);
}
.bjli-select:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}
.bjli-input-watt {
    width: 100%;
    border: 2px solid #4ade80;
    border-radius: .5rem;
    padding: .45rem .5rem;
    font-size: .9rem; font-weight: 700;
    text-align: center;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.bjli-input-watt:focus { outline: none; border-color: var(--green-main); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.bjli-input-ro {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: .45rem .5rem;
    font-size: .75rem;
    text-align: center;
    background: #f3f4f6;
    color: #9ca3af;
}
.bjli-input-usage {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: .55rem .5rem;
    font-size: .875rem; font-weight: 600;
    text-align: center;
    transition: border-color .2s, box-shadow .2s;
}
.bjli-input-usage:focus { outline: none; border-color: var(--green-main); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.bjli-input-ls {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: .55rem .5rem;
    font-size: .875rem; font-weight: 600;
    text-align: center;
    transition: border-color .2s, box-shadow .2s;
}
.bjli-input-ls:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }

/* ══════════════════════════════════════════
   WATT SETTINGS BOX
══════════════════════════════════════════ */
.watt-box {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: .75rem;
    padding: .875rem;
}
.watt-editable-badge {
    font-size: .65rem;
    background: #fef3c7;
    color: #92400e;
    padding: .1rem .5rem;
    border-radius: 999px;
}

/* ══════════════════════════════════════════
   RANGE SLIDER
══════════════════════════════════════════ */
input[type=range] {
    -webkit-appearance: none;
    width: 100%; height: 6px;
    border-radius: 5px;
    background: #dcfce7;
    outline: none;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--green-main);
    cursor: pointer;
    box-shadow: 0 0 0 3px #bbf7d0;
}
input[type=range]::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--green-main);
    cursor: pointer;
    border: none;
}

/* ══════════════════════════════════════════
   TYPE NOTE
══════════════════════════════════════════ */
.type-note {
    margin-top: .4rem;
    font-size: .7rem;
    color: #2563eb;
    background: #eff6ff;
    padding: .4rem .75rem;
    border-radius: .5rem;
    display: flex; align-items: flex-start; gap: .4rem;
}

/* ══════════════════════════════════════════
   PER-ROW RESULT
══════════════════════════════════════════ */
.row-result-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: .75rem;
    padding: .6rem 1rem;
    display: flex; align-items: center; justify-content: space-between;
}

/* ══════════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════════ */
.prog-bar { height: 8px; border-radius: 999px; background: #dcfce7; overflow: hidden; flex: 1; }
.prog-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #16a34a, #22c55e); transition: width .6s ease; }

/* ══════════════════════════════════════════
   TABLE ROWS
══════════════════════════════════════════ */
.table-row:hover { background: #f0fdf4 !important; }
.table-row:nth-child(even) { background: #fafafa; }

/* ══════════════════════════════════════════
   SPINNER
══════════════════════════════════════════ */
.spin { animation: spinAnim 1s linear infinite; display: inline-block; }
@keyframes spinAnim { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   SAVING TIPS
══════════════════════════════════════════ */
.tip-card {
    border-radius: .75rem;
    padding: .75rem;
    display: flex; gap: .6rem;
    font-size: .78rem;
}

/* ══════════════════════════════════════════
   TOAST  (pure JS, no Bootstrap toast)
══════════════════════════════════════════ */
.bjli-toast {
    position: fixed; top: 1.25rem; right: 1.25rem;
    color: #fff; padding: .75rem 1.25rem;
    border-radius: .75rem; box-shadow: 0 8px 24px rgba(0,0,0,.2);
    z-index: 9999; font-size: .875rem;
    display: flex; align-items: center; gap: .5rem;
    max-width: 22rem; animation: fadeIn .25s ease;
}

/* ══════════════════════════════════════════
   LOADER SPAN POSITIONING
══════════════════════════════════════════ */
.select-wrap { position: relative; }
.select-loader {
    position: absolute; right: 2.2rem; top: 50%; transform: translateY(-50%);
}

/* ══════════════════════════════════════════
   SLAB / FIXED REF HEADERS
══════════════════════════════════════════ */
.ref-section-title {
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: #4b5563;
    display: flex; align-items: center; gap: .35rem;
    margin-bottom: .5rem;
}
.slab-ref-head th { background: #f0fdf4; color: #166534; font-size: .65rem; text-transform: uppercase; }
.fixed-ref-head th { background: #eff6ff; color: #1d4ed8; font-size: .65rem; text-transform: uppercase; }

/* ══════════════════════════════════════════
   MISC UTILITIES (Bootstrap gaps)
══════════════════════════════════════════ */
.space-y > * + * { margin-top: 1.25rem; }
.lh-tight { line-height: 1.25; }

/* ══════════════════════════════════════════
   PRINT
══════════════════════════════════════════ */
@media print {
    .no-print { display: none !important; }
    .bjli-card { box-shadow: none; border: 1px solid #ddd; }
    body { background: #fff; }
    #printBillSection { display: block !important; }
}