html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
  text-align: start;
}

/* Common layout for all Society Portal pages */
.portal-common-layout {
  width: min(1100px, calc(100% - 36px));
  margin: 0 auto;
  box-sizing: border-box;
}

/* Keep Header 1 and Header 2 fixed together */

.portal-fixed-headers {
  position: sticky;
  top: 0;
  z-index: 1100;
}

html,
body {
    overscroll-behavior-y: none;
}

/* UNIVERSAL PORTAL BUTTONS — ALL SECTIONS */

.rv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.rv-btn-add,
.rv-btn-save {
    background-color: #198754;
    color: #ffffff;
}

.rv-btn-add:hover,
.rv-btn-save:hover {
    background-color: #157347;
    color: #ffffff;
}

.rv-btn-cancel {
    background-color: #6c757d;
    color: #ffffff;
}

.rv-btn-cancel:hover {
    background-color: #5c636a;
    color: #ffffff;
}

/* UNIVERSAL PORTAL TABLES — ALL SECTIONS */

.rv-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #000000;
}

.rv-table th,
.rv-table td {
    padding: 8px 12px;
    border: 1px solid #cbded2;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.rv-table thead th {
    background-color: #198754;
    color: #ffffff;
    font-weight: 600;
}

.rv-table tbody tr:nth-child(odd) {
    background-color: #edf7f1;
}

.rv-table tbody tr:nth-child(even) {
    background-color: #dcefe4;
}

.rv-table tbody tr:hover {
    background-color: #cce8d8;
}

/* Vendor Master heading */
.vendor-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* VENDOR MASTER — INPUT AND BUTTON ALIGNMENT */

.vendor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin-bottom: 8px;
}

.vendor-input {
    height: 36px;
    padding: 4px 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.vendor-toolbar .rv-btn {
    height: 36px;
    min-height: 36px;
    margin: 0;
}

/* Keep Vendor Master action column stable during editing */

.vendor-table {
    table-layout: fixed;
}

.vendor-table th:first-child {
    width: 180px;
}

.vendor-table th:last-child {
    width: 180px;
}

.vendor-table td:last-child {
    white-space: nowrap;
}

/* Vendor Master - toolbar alignment */

.vendor-toolbar {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.vendor-toolbar .vendor-add-btn {
    margin-left: auto;
}

.vendor-toolbar .vendor-back-btn {
    margin-right: 0;
}

/* Vendor Master - wider input box */
.vendor-toolbar .vendor-input {
    width: 750px;
    max-width: 60%;
    box-sizing: border-box;
}

/* Common Electricity Reports Dropdown */

.elec-reports-menu summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.elec-reports-menu summary::-webkit-details-marker {
    display: none;
}

.elec-reports-menu summary::after {
    content: ">";
    font-size: 12px;
    font-weight: 700;
}

.elec-reports-menu[open] summary::after {
    content: "⌄";
}

.elec-reports-menu:not([open]) > .elec-subnav {
    display: none;
}

.elec-subnav {
    padding: 8px 5px 8px 12px;
    font-size: inherit;
    font-weight: 500;
    white-space: nowrap;
    
}


/* ELECTRICITY CONSUMPTION REPORT */

.elec-report-filter {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: #f4faf6;
    border: 1px solid #d3e6d9;
    border-radius: 7px;
    margin-bottom: 14px;
    font-size: 12px;
}

.elec-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.elec-filter-field label {
    font-weight: 600;
    color: #405448;
}

.elec-filter-field input,
.elec-filter-field select {
    height: 34px;
    padding: 5px 9px;
    border: 1px solid #b9d5c5;
    border-radius: 5px;
    background: white;
    color: #202a24;
    font: inherit;
}

.elec-consumer-filter {
    flex: 1;
    min-width: 230px;
}

.elec-preview-btn {
    height: 34px;
    padding: 0 17px;
    border: 0;
    border-radius: 5px;
    background: #198754;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.elec-report-results {
    background: white;
    padding: 12px;
    border: 1px solid #d8e4dc;
    border-radius: 7px;
    font-size: 12px;
}

.elec-report-results h3,
.elec-report-results h4 {
    text-align: left;
    color: #17633c;
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 700;
}

.elec-report-period {
    margin: 0 0 10px;
}

.elec-excel-btn {
    background: #198754;
    color: white;
    padding: 7px 14px;
    border: 1px solid #198754;
    border-radius: 5px;
    font-weight: 600;
    margin-bottom: 10px;
}

.elec-excel-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.elec-report-table-scroll {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 14px;
}

.elec-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.elec-report-table th,
.elec-report-table td {
    padding: 6px 8px;
    border: 1px solid #dce6df;
    white-space: nowrap;
}

.elec-report-table th {
    background: #198754;
    color: white;
    font-weight: 600;
    text-align: center;
}

.elec-report-table td:nth-child(n+4) {
    text-align: right;
}

.elec-report-table tbody tr:nth-child(odd) {
    background: #f8fcf9;
}

.elec-report-table tbody tr:nth-child(even) {
    background: #eaf5ed;
}

.elec-report-table tfoot {
    background: #dceee2;
    font-weight: 700;
}

.elec-summary-heading {
    margin-top: 12px !important;
}


/* COMMON ELECTRICITY PAGE LAYOUT */

.elec-layout {
    display: flex;
    gap: 12px;
    padding: 10px;
    font-size: 12px;
    color: #202a24;
    height: calc(100vh - 145px);
    min-height: 0;
    overflow: hidden;
}

.elec-sidebar {
    width: 175px;
    flex: 0 0 175px;
    background: #edf5ef;
    border: 1px solid #d4e4d8;
    border-radius: 7px;
    padding: 9px;
    overflow-y: auto;
}

.elec-nav {
    display: block;
    padding: 10px 9px;
    margin-bottom: 6px;
    border-radius: 5px;
    color: #234936;
    text-decoration: none;
    font-weight: 600;
}

.elec-nav:hover,
.elec-nav.active {
    background: #198754;
    color: white;
}

.elec-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.elec-heading {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 9px;
    color: #185c39;
}

@media (max-width: 950px) {
    .elec-layout {
        flex-direction: column;
    }

    .elec-sidebar {
        width: 100%;
        flex-basis: auto;
    }
}
