/* ==========================================
   UNIFIED PAGE STYLES
   Об'єднані стилі для всіх сторінок
   ========================================== */

/* ==========================================
   SHARED: SIGNAL INDICATORS
   ========================================== */
.signal-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}

.signal-active {
    background-color: var(--color-green-300);
}

.signal-inactive {
    background-color: var(--color-red-500);
}

body.dark-mode .signal-active {
    background-color: var(--brand-primary);
}

body.dark-mode .signal-inactive {
    background-color: var(--color-red-700);
}

/* ==========================================
   SHARED: USER AVATAR
   ========================================== */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-neutral-200);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: var(--color-neutral-600);
    font-weight: bold;
}

body.dark-mode .user-avatar {
    background-color: var(--dark-hover);
    color: var(--text-dark);
}

/* ==========================================
   SHARED: RIGHT BADGE
   ========================================== */
.right-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--color-white);
    background-color: var(--color-neutral-600);
}

.right-badge.admin { background-color: var(--color-red-600); }
.right-badge.moderator { background-color: var(--color-orange-650); }
.right-badge.user { background-color: var(--color-teal-500); }

body.dark-mode .right-badge {
    color: var(--dark);
}

/* ==========================================
   SHARED: POINT ICON
   ========================================== */
.point-icon {
    background-color: var(--color-neutral-150);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    margin-right: 5px;
}

body.dark-mode .point-icon {
    background-color: var(--light);
}

/* ==========================================
   SHARED: BORDER DASHED
   ========================================== */
.border-dashed {
    border-style: dashed !important;
}

/* ==========================================
   ENTRY DATA PAGE
   ========================================== */
.device-filters .input-group {
    min-width: 240px;
}

.device-filters .form-select {
    min-width: 180px;
}

#entry-data-root.entry-data-root .card {
    border-radius: var(--radius);
}

#entry-data-root.entry-data-root .point-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#entry-data-root.entry-data-root .point-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

#entry-data-root.entry-data-root .entry-action-btn {
    min-width: 160px;
}

/* ==========================================
   INSTITUTION PANEL
   ========================================== */
.tag-list {
    margin: 0;
}

.tag-item {
    padding: 0.25rem 0.75rem;
    background-color: var(--color-neutral-50);
    border-radius: var(--radius-sm);
}

.tag-delete-btn {
    line-height: 1;
    padding: 0.1rem 0.35rem;
}

.counter-widget .counter-meters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.counter-meter {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.counter-meter:last-child {
    border-bottom: none;
}

.counter-meter-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-neutral-50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-meter-icon img {
    max-width: 24px;
    max-height: 24px;
}

.counter-meter-reading {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
}

.counter-meter-value {
    font-weight: 600;
}

.counter-meter-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

body.dark-mode .counter-meter-icon,
body.dark-mode .tag-item {
    background-color: var(--dark-hover);
}

/* ==========================================
   DATA TABLES
   ========================================== */
.data-table,
.data-table-report,
.data-table-epoint,
.data-table-collectors,
.data-table-values,
.data-table-main,
.data-table-service,
.data-table-journal,
.data-schema-table {
    font-size: 14px;
}

.data-table-report {
    border-collapse: separate;
    border-spacing: 0;
    overflow: visible;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background-color: var(--bg-card);
    box-shadow: var(--shadow);
}

.report-page .table-responsive {
    max-height: 70vh;
    overflow: auto;
    scrollbar-width: thin;
}

.report-page .table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.report-page .table-responsive::-webkit-scrollbar-track {
    background: rgba(var(--rgb-black), 0.05);
    border-radius: var(--radius);
}

.report-page .table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--primary-hover);
    border-radius: var(--radius);
}

.report-page .table-responsive::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary);
}


.data-table th,
.data-table-report th,
.data-table-epoint th,
.data-table-collectors th,
.data-table-values th,
.data-table-main th,
.data-table-journal th {
    text-align: center;
    vertical-align: middle;
}

/* Fixed width for date/time column in report tables */
.data-table-report th:first-child,
.data-table-report td:first-child {
    min-width: 160px;
    width: 160px;
    white-space: nowrap;
    font-weight: 600;
}

.data-table-report thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: var(--bg-card);
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border);
    box-shadow: inset 0 -1px 0 rgba(var(--rgb-black), 0.08);
    transition: background-color 0.2s ease;
}


.data-table-report td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: var(--bg-card);
    box-shadow: 2px 0 0 rgba(var(--rgb-black), 0.05);
}


.data-table-report thead th:first-child,
.data-table-report th:first-child {
    z-index: 6;
    background-color: var(--bg-card);
    left: 0;
}

.data-table-report .table-warning td:first-child {
    background-color: var(--color-amber-100);
}

.data-table-report tbody tr:nth-child(odd) td {
    background-color: var(--bg-card);
}

.data-table-report tbody tr td {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.data-table-report td,
.data-table-report th {
    border-color: rgba(var(--rgb-black), 0.05);
}


.data-table-report .sort-indicator {
    font-size: 0.8rem;
    display: inline-block;
    min-width: 0.75rem;
}

.data-table-report tbody tr td:last-child {
    border-right: none;
}

body.dark-mode .data-table-report td:first-child,
body.dark-mode .data-table-report th:first-child {
    box-shadow: 2px 0 0 rgba(var(--rgb-black), 0.4);
}


body.dark-mode .data-table-report .table-warning td:first-child {
    background-color: var(--color-brown-850);
    color: var(--light);
}
body.dark-mode
.table > tbody > tr.table-warning {
    --bs-table-bg: var(--color-brown-900);
    --bs-table-color: var(--light);

    --bs-table-striped-bg: var(--color-brown-800);
    --bs-table-striped-color: var(--light);

    --bs-table-hover-bg: var(--color-brown-750);
    --bs-table-hover-color: var(--light);
}

body.dark-mode .report-page .table-responsive::-webkit-scrollbar-track {
    background: rgba(var(--rgb-white), 0.08);
}

body.dark-mode .report-page .table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--dm-info);
}

body.dark-mode .report-page .table-responsive::-webkit-scrollbar-thumb:hover {
    background-color: var(--dm-primary);
}

body.dark-mode .data-table-report thead th {
    background-color: var(--dark-surface);
    color: var(--light);
    border-bottom-color: rgba(var(--rgb-white), 0.1);
    box-shadow: inset 0 -1px 0 rgba(var(--rgb-black), 0.4);
}

body.dark-mode .data-table-report thead th:first-child {
    box-shadow:
        inset 0 -1px 0 rgba(var(--rgb-black), 0.4),
        2px 0 0 rgba(var(--rgb-black), 0.4);
}

/* ==========================================
   MULTI-DEREVO (TREE) STYLES
   ========================================== */
#multi-derevo ul {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
}

#multi-derevo li,
#multi-derevo .header {
    position: relative;
    padding-left: 1.2em;
}

#multi-derevo .header + ul {
    margin-left: 30px;
    padding-top: 10px;
}

#multi-derevo li {
    margin-bottom: 0.8em;
}

#multi-derevo li:before,
#multi-derevo .header:before {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    bottom: 0.5em;
    width: 15px;
    height: 0;
    border-bottom: 1px solid var(--color-neutral-850);
}

#multi-derevo li:last-child:before,
#multi-derevo .header:last-of-type:before {
    height: 25000px;
    border: 1px solid var(--color-neutral-850);
    border-width: 0 0 1px 1px;
}

#multi-derevo .p-has-headers > li {
    margin: 10px 0;
}

#multi-derevo .p-has-headers > li:before {
    content: none;
}

body.dark-mode #multi-derevo li:before,
body.dark-mode #multi-derevo .header:before {
    border-bottom-color: var(--color-neutral-150);
}

body.dark-mode #multi-derevo li:last-child:before,
body.dark-mode #multi-derevo .header:last-of-type:before {
    border-color: var(--color-neutral-150);
}

/* ==========================================
   MAP STYLES
   ========================================== */
#my-map {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

body.dark-mode .leaflet-layer,
body.dark-mode .leaflet-control-zoom-in,
body.dark-mode .leaflet-control-zoom-out,
body.dark-mode .leaflet-control-attribution {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

body.dark-mode .leaflet-container {
    background: var(--color-black);
}

body.dark-mode .leaflet-popup-content-wrapper {
    background: var(--dark-surface);
}

/* ==========================================
   AUTH PAGES
   ========================================== */
.auth-body {
    max-width: 450px;
    margin: 0 auto;
    padding: 2rem;
}

.icon-input {
    position: relative;
}

.icon-input .form-control {
    padding-left: 2.5rem;
    padding-right: 2.8rem;
}

.icon-input > i:first-child {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
}

.toggle-password:hover {
    color: var(--primary);
}

/* ==========================================
   INSTITUTIONS TABLE
   ========================================== */
.institutions-table {
    font-size: 14px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.institutions-table th {
    text-align: center;
    vertical-align: middle;
    background: rgba(var(--rgb-blue-500), 0.1);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.institution-info {
    padding: 0.5rem 0;
}

.institution-name {
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
}

.institution-parent {
    font-size: 0.8rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: flex-start;
}

.institution-address {
    font-size: 0.8rem;
    color: var(--color-neutral-600);
    line-height: 1.2;
    font-style: italic;
    display: flex;
    align-items: flex-start;
}

body.dark-mode .institutions-table th {
    background: rgba(var(--rgb-blue-500), 0.15);
}

body.dark-mode .institution-name {
    color: var(--light);
}

body.dark-mode .institution-address {
    color: var(--text-dark);
}

/* ==========================================
   BLOCK PANEL / PARAMETER STYLES
   ========================================== */
.parameter-section {
    margin-bottom: 2rem;
}

.parameter-group-card {
    background-color: var(--color-white);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.parameter-group-card:hover {
    box-shadow: var(--shadow-lg);
}

.group-header {
    background-color: rgba(var(--rgb-blue-500), 0.1);
    padding: 1rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.group-header:hover {
    background-color: rgba(var(--rgb-blue-500), 0.2);
}

.group-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
}

.parameter-list {
    padding: 0.5rem 1rem;
}

.parameter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.parameter-item:last-child {
    border-bottom: none;
}

.param-info { flex: 1; }
.param-title { font-weight: 500; color: var(--text); margin-bottom: 0.25rem; }
.param-value { font-weight: 600; color: var(--primary); }
.param-unit { margin-left: 0.5rem; font-size: 0.875rem; opacity: 0.7; }
.param-actions { display: flex; gap: 0.5rem; }

body.dark-mode .parameter-group-card {
    background-color: var(--dark-surface);
    border: 1px solid rgba(var(--rgb-white), 0.05);
}

body.dark-mode .group-header {
    background-color: var(--dark-hover);
    border-bottom-color: rgba(var(--rgb-white), 0.1);
}

body.dark-mode .param-title {
    color: var(--light);
}

/* ==========================================
   ENERGY CLASS BADGES
   ========================================== */
.energy-class-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 0.25rem;
    color: var(--color-white);
}

.energy-class-A { background-color: var(--color-green-700); }
.energy-class-B { background-color: var(--color-lime-500); }
.energy-class-C { background-color: var(--color-yellow-500); color: var(--color-black); }
.energy-class-D { background-color: var(--color-orange-600); }
.energy-class-E { background-color: var(--color-orange-700); }
.energy-class-F { background-color: var(--color-red-750); }
.energy-class-G { background-color: var(--color-red-800); }

/* ==========================================
   TABLE SORTING
   ========================================== */
th[class*="sort-"] {
    position: relative;
    cursor: pointer;
}

th.sort-asc:after {
    content: '\f062';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 5px;
}

th.sort-desc:after {
    content: '\f063';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 5px;
}

/* ==========================================
   CUSTOM SWITCH
   ========================================== */
.custom-switch {
    position: relative;
    display: inline-block;
    min-height: 1.5rem;
    padding-left: 3.5rem;
}

.custom-control-input {
    position: absolute;
    left: 0;
    z-index: -1;
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0;
}

.custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    cursor: pointer;
}

.custom-control-label::before {
    position: absolute;
    top: 0.25rem;
    left: -3.5rem;
    display: block;
    width: 2.75rem;
    height: 1.5rem;
    content: "";
    background-color: var(--color-neutral-200);
    border: var(--color-neutral-500) solid 1px;
    border-radius: 1.5rem;
    transition: all 0.15s ease-in-out;
}

.custom-control-label::after {
    position: absolute;
    top: calc(0.25rem + 2px);
    left: calc(-3.5rem + 2px);
    width: calc(1.5rem - 4px);
    height: calc(1.5rem - 4px);
    background-color: var(--color-neutral-500);
    border-radius: 1.5rem;
    transition: all 0.15s ease-in-out;
    content: "";
}

.custom-control-input:checked~.custom-control-label::before {
    background-color: var(--color-blue-500);
    border-color: var(--color-blue-500);
}

.custom-control-input:checked~.custom-control-label::after {
    background-color: var(--color-white);
    transform: translateX(1.25rem);
}

/* ==========================================
   DEVICE STYLES
   ========================================== */
.inactive-device {
    opacity: 0.7;
}

.inactive-device.hidden {
    display: none !important;
}

.toggle-group {
    padding: 0.1rem 0.4rem;
    margin-right: 5px;
}

/* ==========================================
   FILE UPLOAD / DRAG AREA
   ========================================== */
.drag-area {
    border: 2px dashed var(--color-neutral-450);
    border-radius: 5px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
}

.drag-area.active {
    border-color: var(--primary);
    background-color: rgba(var(--rgb-brand-primary), 0.05);
}

body.dark-mode .drag-area {
    border-color: rgba(var(--rgb-white), 0.2);
}

/* ==========================================
   GALLERY
   ========================================== */
.gallery-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
}

.gallery-image:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(var(--rgb-black), 0.1);
}

.gallery-image-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.badge-main {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--success);
    color: var(--color-white);
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* ==========================================
   SETTINGS PAGE
   ========================================== */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(var(--rgb-black), 0.1);
    color: var(--primary);
}

.coords-value {
    font-size: 1.2rem;
    background-color: rgba(var(--rgb-blue-500), 0.1);
    padding: 0.5rem;
    border-radius: 5px;
    display: block;
    margin-top: 0.25rem;
}

body.dark-mode .section-title {
    border-color: rgba(var(--rgb-white), 0.1);
}

body.dark-mode .coords-value {
    background-color: rgba(var(--rgb-blue-500), 0.2);
}

/* ==========================================
   GROUPS PAGE
   ========================================== */
.group-card .card-header {
    background-color: rgba(var(--rgb-blue-500), 0.1);
    transition: all 0.3s ease;
}

.btn-link {
    color: var(--color-navy-700);
    font-weight: 600;
}

body.dark-mode .btn-link{
    color: var(--light);
}

body.dark-mode .group-card .card-header {
    background-color: var(--dark-hover);
}

body.dark-mode .group-card .btn-link {
    color: var(--light);
}

/* ==========================================
   SELECT2 STYLES
   ========================================== */
.select2-container--default .select2-selection--single {
    height: 38px;
    padding: 6px 12px;
    border: 1px solid var(--color-neutral-400);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 24px;
    color: var(--color-neutral-700);
}

.select2-dropdown {
    border: 1px solid var(--color-neutral-400);
    border-radius: 0.375rem;
}

body.dark-mode .select2-container--default .select2-selection--single,
body.dark-mode .select2-dropdown {
    background-color: var(--color-neutral-800);
    color: var(--color-neutral-400);
    border-color: var(--color-neutral-700);
}

.modal .select2-container { z-index: 1060; }
.modal .select2-dropdown { z-index: 1070; }

/* ==========================================
   SORTABLE / DRAG & DROP
   ========================================== */
.ui-sortable-helper {
    height: 57px !important;
    line-height: 57px !important;
    display: table-row !important;
    background: var(--light);
    box-shadow: 0 4px 12px rgba(var(--rgb-black), 0.15);
}

.ui-sortable-helper td {
    display: table-cell !important;
    vertical-align: middle !important;
    background: var(--light);
}

body.dark-mode .ui-sortable-helper,
body.dark-mode .ui-sortable-helper td {
    background: var(--dark);
    color: var(--text-dark);
}

/* Drag handle for table rows */
.drag-handle,
[data-drag-handle] {
    cursor: grab;
    color: var(--color-neutral-500);
    padding: 4px 8px;
    user-select: none;
    touch-action: none;
}

.drag-handle:hover,
[data-drag-handle]:hover {
    color: var(--color-neutral-700);
}

.drag-handle:active,
[data-drag-handle]:active {
    cursor: grabbing;
}

/* Dragging state for table rows */
tr.dragging,
.table tr.dragging,
.table-striped tr.dragging,
.table-hover tr.dragging {
    opacity: 0.85;
    background-color: var(--color-amber-50) !important;
    box-shadow: 0 4px 12px rgba(var(--rgb-black), 0.15);
    outline: 2px solid var(--color-amber-500);
    outline-offset: -2px;
}

tr.dragging td,
.table tr.dragging td {
    background-color: var(--color-amber-50) !important;
}

body.dark-mode .drag-handle,
body.dark-mode [data-drag-handle] {
    color: var(--color-neutral-600);
}

body.dark-mode .drag-handle:hover,
body.dark-mode [data-drag-handle]:hover {
    color: var(--color-neutral-500);
}

body.dark-mode tr.dragging,
body.dark-mode .table tr.dragging,
body.dark-mode .table-striped tr.dragging {
    background-color: rgba(var(--rgb-amber-500), 0.3) !important;
    outline-color: var(--color-amber-500);
}

body.dark-mode tr.dragging td,
body.dark-mode .table tr.dragging td {
    background-color: rgba(var(--rgb-amber-500), 0.3) !important;
}

/* ==========================================
   EDIT FORM
   ========================================== */
.edit-form {
    background-color: var(--light);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.edit-form.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

body.dark-mode .edit-form {
    background-color: var(--dark);
}

/* ==========================================
   LOADING OVERLAY
   ========================================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--rgb-black), 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

/* ==========================================
   MISC STYLES
   ========================================== */
.info-label { font-weight: 600; color: var(--text-muted); }
.info-value { font-weight: 500; color: var(--text); margin-left: 5px; }

.tariff-price { font-weight: bold; font-size: 1.1rem; color: var(--text); }
.tariff-date { font-size: 0.95rem; color: var(--color-neutral-600); }
.tariff-badge { background-color: var(--primary); color: var(--color-white); padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; }

.service-card {
    border-left: 4px solid var(--info);
    background-color: var(--color-neutral-50);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.service-card:hover {
    box-shadow: 0 4px 10px rgba(var(--rgb-black), 0.1);
    transform: translateY(-2px);
}

body.dark-mode .service-card {
    background-color: var(--dark-surface);
    border-color: var(--primary);
}

.text-default { color: var(--text); }
body.dark-mode .text-default { color: var(--text-dark); }

body.dark-mode .breadcrumb { background-color: var(--dark-surface); }
body.dark-mode hr { border-color: rgba(var(--rgb-white), 0.1); }

.justify-text { text-align: justify; text-justify: inter-word; }

/* ==========================================
   PUBLIC DASHBOARD
   ========================================== */
.card-header-custom {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-header-custom .widget-title {
    font-weight: 600;
}

.public-dashboard-page .consumption-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.public-dashboard-page .consumption-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.public-dashboard-page .consumption-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.public-dashboard-page .consumption-item:first-child {
    padding-top: 0;
}

.public-dashboard-page .consumption-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.public-dashboard-page .consumption-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.public-dashboard-page .consumption-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.public-dashboard-page .consumption-values .badge {
    font-size: 0.7rem;
    font-weight: 500;
}

.public-dashboard-page .weather-info {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-top: 0.5rem;
}

.public-dashboard-page .weather-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.public-dashboard-page .weather-item h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.public-dashboard-page .dashboard-map {
    height: 480px;
    width: 100%;
}

.public-dashboard-page .institution-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 1rem 1rem;
    font-size: 0.9rem;
}

.public-dashboard-page .institution-list-item {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

body.dark-mode .public-dashboard-page .institution-list-item {
    border-color: rgba(var(--rgb-white), 0.08);
    background: var(--dark-surface);
}

.public-dashboard-page .indoor-temp-table {
    max-height: 40vh;
    overflow-y: auto;
}

.public-dashboard-page .indoor-temp-table th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.public-dashboard-page .loading-overlay {
    background: transparent;
    pointer-events: none;
}

body.dark-mode .public-dashboard-page .indoor-temp-table th {
    background: var(--dark-surface);
}

body.dark-mode .card-header-custom {
    border-bottom-color: rgba(var(--rgb-white), 0.1);
}

body.dark-mode .public-dashboard-page .consumption-item {
    border-bottom-color: rgba(var(--rgb-white), 0.08);
}

@media (max-width: 992px) {
    .public-dashboard-page .dashboard-map,
    .public-dashboard-page .chart-container,
    .public-dashboard-page .indoor-temp-table {
        height: 380px;
    }
}

@media (max-width: 768px) {
    .public-dashboard-page .dashboard-map,
    .public-dashboard-page .chart-container,
    .public-dashboard-page .indoor-temp-table {
        height: 320px;
    }

    .public-dashboard-page .weather-info {
        flex-direction: column;
        gap: 0.75rem;
    }
}
.paragraph-indent { text-indent: 40px; margin-bottom: 1em; }

.point-card { transition: all 0.2s ease; border-radius: 0.5rem; }
.point-card:hover { box-shadow: 0 4px 8px rgba(var(--rgb-black), 0.15); transform: translateY(-2px); }

.form-info { border-left: 4px solid var(--info); padding: 15px; margin-bottom: 20px; border-radius: 0 4px 4px 0; }

#id_energy_point_list,
#id_virtual_point_list { height: 200px; }

.map-container-300 { height: 300px; }
.map-container-600 { height: 600px; }

.spacer-140 { height: 140px; }
.spacer-report { height: 150px; }

.controller-panel p img { max-width: 25px; height: auto; }

/* ==========================================
   ENERGY REPORT TABLE
   ========================================== */
.energy-report-table .col-index {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.energy-report-table .col-institution {
    width: 300px;
    min-width: 260px;
}

.energy-report-table .rotated-header {
    width: 48px;
    min-width: 48px;
    vertical-align: bottom;
    padding: 0 4px;
}

.energy-report-table .rotated-header > div {
    height: 140px;
    position: relative;
}

.energy-report-table .rotated-header span {
    position: absolute;
    width: 140px;
    left: 50%;
    bottom: 6px;
    transform-origin: left bottom;
    transform: rotate(-90deg);
    white-space: nowrap;
}

/* ==========================================
   ENTRY REPORT TABLE
   ========================================== */
.entry-report-table .col-index {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.entry-report-table .col-institution,
.entry-report-table .col-user {
    width: 300px;
    min-width: 260px;
}

.entry-report-table .col-block {
    min-width: 200px;
}

.entry-report-table .rotated-header {
    width: 48px;
    min-width: 48px;
    vertical-align: bottom;
    padding: 0 4px;
}

.entry-report-table .rotated-header > div {
    height: 140px;
    position: relative;
}

.entry-report-table .rotated-header span {
    position: absolute;
    width: 140px;
    left: 50%;
    bottom: 6px;
    transform-origin: left bottom;
    transform: rotate(-90deg);
    white-space: nowrap;
}

/* ==========================================
   INDICATOR REPORT TABLE
   ========================================== */
.indicator-report-table .col-index {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.indicator-report-table .col-action {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.indicator-report-table .col-institution {
    width: 300px;
    min-width: 260px;
}

.indicator-report-table .col-block {
    width: 170px;
    min-width: 170px;
}

.indicator-report-table .col-ep {
    width: 200px;
    min-width: 200px;
}

.indicator-report-table .col-device {
    width: 200px;
    min-width: 200px;
}

.indicator-report-table .col-serial {
    width: 150px;
    min-width: 150px;
}

.indicator-report-table .rotated-header {
    width: 48px;
    min-width: 48px;
    vertical-align: bottom;
    padding: 0 4px;
}

.indicator-report-table .rotated-header > div {
    height: 140px;
    position: relative;
}

.indicator-report-table .rotated-header span {
    position: absolute;
    width: 140px;
    left: 50%;
    bottom: 6px;
    transform-origin: left bottom;
    transform: rotate(-90deg);
    white-space: nowrap;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .parameter-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .param-actions {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-end;
    }
}
