body.page {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #020817;
    color: #e5e7eb;
    overflow-x: hidden;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #141c2e;
    border-bottom: 1px solid #798296;
    position: relative;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    height: 48px;
    width: auto;
}

.title h1 {
    margin: 0;
    font-size: 18px;
}

.title p {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-issues-pill {
    --issues-coral: #f87171;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 8px;
    border-radius: 9999px;
    border: 1px solid var(--issues-coral);
    background: #141c2e;
    box-sizing: border-box;
    color: var(--issues-coral);
    font-family: system-ui, "Segoe UI", -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.header-issues-pill__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--issues-coral);
}

.header-issues-pill__svg {
    width: 18px;
    height: 18px;
    display: block;
    color: var(--issues-coral);
}

.header-issues-pill__text {
    color: var(--issues-coral);
    white-space: nowrap;
}

.status {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status--ok {
    color: #22c55e;
}

.status--down {
    color: #ef4444;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: currentColor;
    display: inline-block;
}

.status-dot--heartbeat {
    animation: mqtt-heartbeat 1.2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
}

@keyframes mqtt-heartbeat {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
    }
    35% {
        transform: scale(1.35);
        box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
    }
    55% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.header-dropdown-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-dropdown-icon {
    font-size: 10px;
    color: #9ca3af;
    line-height: 1;
}

.header-dropdown {
    font-family: inherit;
    font-size: 18px;
    font-weight: 400;
    color: #e5e7eb;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    appearance: none;
    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='%239ca3af' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 18px;
}

.header-dropdown option {
    background: #1e293b;
    color: #e5e7eb;
}

.header-dropdown option:disabled {
    color: #6b7280;
}

.btn {
    border-radius: 9999px;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

.btn--primary {
    background: linear-gradient(to right, #22c55e, #16a34a);
    color: #020617;
    font-weight: 600;
}

.btn--download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 8px 12px;
    background: #059669;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

.btn--download:hover {
    background: #047857;
}

.header-welcome {
    font-size: 16px;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 6px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.btn--secondary {
    background: #020817;
    color: #e5e7eb;
    border: 1px solid #1e293b;
}

.btn--small {
    padding: 4px 10px;
    font-size: 12px;
}

.grid {
    display: grid;
    grid-template-columns: 2.2fr 2.3fr 2.5fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "left middle right"
        "chart chart chart";
    grid-auto-rows: minmax(80px, auto);
    gap: 16px;
    padding: 16px 24px 24px;
    align-items: stretch;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.column--left {
    grid-area: left;
}

.column--middle {
    grid-area: middle;
    /* Keep Shelly growth inside the top row — never paint over the chart. */
    min-height: 0;
    overflow: hidden;
}

.column--right {
    grid-area: right;
}

.vitals-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Rows: LWT/EWT | Ambient | Shelly pair — last row fills leftover column height. */
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.vitals-card--wide {
  grid-column: 1 / -1;
}

.room-sensor-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: #0b1224;
  min-width: 0;
  position: relative;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.room-sensor-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.room-sensor-card__title {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-sensor-card__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.room-sensor-card__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: currentColor;
}

.room-sensor-card__status--online {
  color: #22c55e;
}

.room-sensor-card__status--offline {
  color: #ef4444;
}

.room-sensor-card__reading {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-height: 28px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.room-sensor-card__temp {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.room-sensor-card__humidity {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

.room-sensor-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  min-height: 18px;
}

.room-sensor-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
}

.room-sensor-card__meta--battery {
  flex-shrink: 0;
}

.room-sensor-card__meta--wifi {
  margin-left: auto;
  flex-shrink: 0;
  color: #cbd5e1;
}

.room-sensor-card__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.room-sensor-card__icon--wifi {
  width: 16px;
  height: 16px;
  color: #cbd5e1;
}

.vitals-card {
  position: relative;
}

.vitals-card__inactive-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: not-allowed;
  border-radius: inherit;
}

.vitals-card__inactive-overlay[data-tooltip]:not([data-tooltip=""])::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 10px;
  background: #374151;
  color: #f3f4f6;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  border-radius: 6px;
  border: 1px solid #4b5563;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 3;
}

.vitals-card__inactive-overlay[data-tooltip]:not([data-tooltip=""]):hover::after {
  opacity: 1;
}

.vitals-card--disabled .vitals-card__inactive-overlay {
  display: block;
}

.vitals-card--disabled {
  background: #1f2937;
  border-color: #374151;
}

.vitals-card--disabled .metric-value,
.vitals-card--disabled .metric-label {
  color: #9ca3af;
}

.vitals-card--disabled .sp-btn {
  background: #374151;
  border-color: #4b5563;
  color: #6b7280;
  cursor: not-allowed;
}

.metric-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.metric-line+.metric-line {
    margin-top: 10px;
}

.metric-label {
    color: #9ca3af;
}

.metric-value {
    font-weight: 700;
    font-size: 12px;
}

.metric-value--cyan {
    color: #22d3ee;
}

.metric-value--green {
    color: #34d399;
}

.metric-value--blue {
    color: #60a5fa;
}

.metric-value--orange {
    color: #fb923c;
}

.metric-value--muted {
    color: #9ca3af;
    font-weight: 600;
}

.metric-ambient-reading {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.metric-ambient-sep {
    color: #9ca3af;
    font-weight: 600;
}

.metric-block--sp {
    border-top: 1px solid #113770;
    padding-top: 8px;
    margin-top: 8px;
}

.sp-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-controls--below {
    margin-top: 8px;
    justify-content: flex-start;
    justify-content: space-between;
}

.sp-btn-group {
    display: flex;
    gap: 8px;
}

.apply-btn {
    border-radius: 6px;
    border: 1px solid #2563eb;
    background: #0b1224;
    color: #93c5fd;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    min-width: 120px;
    text-align: center;
}

.confirm-panel {
    margin-top: 8px;
    border-top: 1px solid #1e293b;
    padding-top: 8px;
}

.confirm-message {
    font-size: 12px;
    color: #fbbf24;
    margin-bottom: 8px;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.confirm-btn {
    width: 100%;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid transparent;
    cursor: pointer;
}

.confirm-btn--ok {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
    color: #86efac;
}

.confirm-btn--cancel {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.sp-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid #1f2937;
    background: #0b1224;
    color: #e5e7eb;
    cursor: pointer;
}

.card {
    background: #050b19;
    border-radius: 10px;
    border: 1px solid #1e293b;
    padding: 10px 14px;
}

.card-header {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-header--icon {
    color: #e5e7eb;
}

.header-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    stroke: #9ca3af;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.power-card {
    grid-column: 1 / 2;
}

.mode-card {
    grid-column: 1 / 2;
}

.faults-card,
.power-kwh-card,
.loading-card,
.runhours-card {
    grid-column: 3 / 4;
}

.faults-card--units {
    min-height: 168px;
}

.unit-fault-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.unit-fault-row {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 10px 14px;
    font-size: 13px;
}

.unit-fault-row__name {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.unit-fault-row__status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.unit-fault-row__icon {
    width: 18px;
    height: 18px;
    display: block;
}

.unit-fault-row__detail {
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

.unit-fault-row--ok .unit-fault-row__name,
.unit-fault-row--ok .unit-fault-row__icon--ok {
    color: #22c55e;
}

.unit-fault-row--fault .unit-fault-row__name,
.unit-fault-row--fault .unit-fault-row__icon--fault,
.unit-fault-row--fault .unit-fault-row__detail {
    color: #f87171;
}

.chart-card {
    grid-area: chart;
    min-height: 150px;
}

.chart-card--triple-axis {
    /* Hug the chart only — no huge empty area below */
    min-height: 0;
    height: auto;
    padding: 10px 14px 14px;
    overflow: visible;
    align-self: start;
}

.chart-interval-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.btn--chart-interval {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
    font-weight: 700;
    min-width: 52px;
    padding: 6px 14px;
}

.btn--chart-interval:hover:not(.btn--chart-interval-active) {
    background: #334155;
    color: #f8fafc;
}

.chart-interval-toolbar .btn.btn--chart-interval.btn--chart-interval-active,
.chart-interval-toolbar .btn.btn--chart-interval.btn--chart-interval-active:hover {
    background: linear-gradient(to right, #22c55e, #16a34a);
    color: #020617;
    border-color: #16a34a;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.chart-card--triple-axis .chart-wrap--triple {
    margin: 0;
    flex-shrink: 0;
}

.chart-data-table-wrap {
    margin-top: 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
}

.chart-data-table-scroll {
    max-height: 320px;
    overflow: auto;
}

.chart-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.chart-data-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.chart-data-table th,
.chart-data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #1e293b;
    white-space: nowrap;
}

.chart-data-table th {
    background: #1e293b;
    color: #f8fafc;
    font-weight: 700;
}

.chart-data-table th.chart-data-table__col-temp {
    color: #dc2626;
}

.chart-data-table th.chart-data-table__col-tonnage {
    color: #60a5fa;
}

.chart-data-table th.chart-data-table__col-power {
    color: #16a34a;
}

.chart-data-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.45);
}

.chart-data-table td {
    color: #e2e8f0;
}

.chart-data-table__cell-temp {
    color: #fecaca;
}

.chart-data-table__cell-tonnage {
    color: #93c5fd;
}

.chart-data-table__cell-power {
    color: #86efac;
}

.btn--chart-table {
    min-width: 64px;
}

.power-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.08em;
    width: calc(100% + 12px);
    display: block;
    border: 1px solid #111827;
    box-sizing: border-box;
    font-size: 13px;
    margin-left: -6px;
    margin-right: -6px;
}

.power-status--on {
    background: #08b545;
    color: #f9fafb;
}

.power-status--off {
    background: #0b1224;
    color: #9ca3af;
}

.mode-toggle {
    display: flex;
    background: #1f2937;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    width: 100%;
}

.mode-form {
    flex: 1;
    margin: 0;
}

.toggle {
    flex: 1;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #111827;
    background: #0b1224;
    color: #9ca3af;
    padding: 7px 0;
    font-size: 12px;
    cursor: pointer;
}

.toggle--active {
    background: #2563eb;
    color: white;
    border-color: #1d4ed8;
}

.toggle--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tile {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    padding: 8px 10px;
    border: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tile span:first-child {
    font-size: 11px;
    color: #9ca3af;
}

.value {
    font-size: 14px;
    font-weight: 600;
}

.value-with-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.value-with-buttons button {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
    cursor: pointer;
}

.fault {
    font-size: 13px;
    margin: 4px 0 0;
}

.fault--ok {
    color: #22c55e;
}

.fault--active {
    color: #f97316;
    word-break: break-word;
}

.faults-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.faults-card__title {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.fault-reset-form {
    margin-top: 8px;
}

.fault-reset-form--header {
    margin-top: 0;
    flex-shrink: 0;
    align-self: flex-start;
}

.btn--fault-reset {
    background: #dc2626 !important;
    color: #fef2f2 !important;
    border: 1px solid #b91c1c !important;
    font-weight: 600;
}

.btn--fault-reset:hover {
    background: #b91c1c !important;
    border-color: #991b1b !important;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.hidden {
    display: none;
}

.modal {
    background: #020817;
    border-radius: 12px;
    border: 1px solid #1e293b;
    padding: 16px 18px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

.modal-title {
    margin: 0 0 4px;
    font-size: 16px;
}

.modal-description {
    margin: 0 0 12px;
    font-size: 13px;
    color: #9ca3af;
}

.modal-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.modal-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #9ca3af;
}

.modal-fields input[type="date"] {
    background: #020817;
    border-radius: 6px;
    border: 1px solid #1f2937;
    padding: 6px 8px;
    color: #e5e7eb;
    font-size: 12px;
}

.modal-option {
    grid-column: 1 / -1;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    color: #e5e7eb;
    font-size: 12px;
    line-height: 1.35;
}

.modal-option input[type="radio"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.stat-row,
.loading-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.loading-row {
    margin-top: 8px;
}

.progress {
    margin-top: 4px;
    width: 100%;
    height: 8px;
    border-radius: 9999px;
    background: #020617;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #6366f1, #a855f7);
}

/* Do not set a global canvas height — it squashes multi-axis charts. Size per wrapper. */
canvas {
    width: 100%;
    max-width: 100%;
    display: block;
}

/* Combined metrics chart: one fixed plot height — fills this box (no tiny chart in tall card) */
.chart-wrap--triple {
    width: 100%;
    height: 520px;
    min-height: 520px;
    max-height: 520px;
    position: relative;
    box-sizing: border-box;
    display: block;
    overflow: visible;
}

.chart-wrap--triple canvas {
    width: 100% !important;
    height: 520px !important;
    max-height: 520px !important;
    min-height: 520px !important;
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-template-areas:
            "left"
            "middle"
            "right"
            "chart";
    }
    .column--left,
    .column--middle,
    .column--right,
    .chart-card {
        grid-column: auto;
        grid-area: auto;
    }
    .column--left { grid-area: left; }
    .column--middle {
        grid-area: middle;
        overflow: visible;
    }
    .column--right { grid-area: right; }
    .chart-card { grid-area: chart; }
    .vitals-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        height: auto;
        flex: none;
    }

    .room-sensor-card {
        height: auto;
    }
    .fcu-main {
        padding: 16px 8px;
    }
    .fcu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
    }
}

.fcu-main {
    padding: 24px;
    min-height: 60vh;
}

.fcu-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.fcu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    background: #3D3D3D;
    border: 1px solid #4a4a4a;
    border-radius: 10px;
    overflow: hidden;
}

.fcu-card-title {
    margin: 0;
    padding: 14px 16px 10px;
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.fcu-card-line {
    width: 100%;
    margin: 0;
    border: none;
    height: 1px;
    background: #7A7A7A;
}

.fcu-card-temp {
    margin: 0;
    padding: 12px 16px;
    font-size: 14px;
    color: #FFFFFF;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.fcu-on-btn {
    width: calc(100% - 24px);
    margin: 0 12px 14px;
    padding: 10px 16px;
    border: 1px solid #339966;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: #33CC33;
    color: #FFFFFF;
}

.fcu-on-btn:hover {
    background: #2db82d;
}

.fcu-card--disabled {
    opacity: 0.7;
    pointer-events: none;
    background: #2d2d2d;
    border-color: #3a3a3a;
}

.fcu-card--disabled .fcu-card-title,
.fcu-card--disabled .fcu-card-temp {
    color: #9ca3af;
}

.fcu-card--disabled .fcu-card-line {
    background: #5a5a5a;
}

.fcu-on-btn--off {
    background: #4a4a4a;
    border-color: #5a5a5a;
    color: #9ca3af;
    cursor: not-allowed;
}

.page--login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar--login {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 16px;
}

.login-header__left {
    justify-self: start;
    display: flex;
    align-items: center;
}

.login-header__center {
    justify-self: center;
    text-align: center;
}

.login-header__right {
    justify-self: end;
    min-width: 0;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 48px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #050b19;
    border-radius: 10px;
    border: 1px solid #1e293b;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
}

.login-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #fecaca;
    margin: 0;
}

.login-alert p {
    margin: 0;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #9ca3af;
}

.login-field__label {
    font-weight: 600;
    color: #e5e7eb;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #020817;
    color: #e5e7eb;
    font-family: inherit;
    font-size: 14px;
}

.login-input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.login-submit {
    margin-top: 4px;
    width: 100%;
    padding: 10px 16px;
    justify-content: center;
}

.header-logout-form {
    margin: 0;
    display: inline-flex;
}

/* Mobile overrides placed at end so they win in cascade */
@media (max-width: 600px) {
    .top-bar {
        padding: 8px 12px;
        flex-wrap: wrap;
    }
    .logo-title {
        gap: 8px;
    }
    .logo-image {
        height: 40px;
    }
    .title h1 {
        font-size: 16px;
    }
    .title p {
        font-size: 11px;
    }
    .header-dropdown-wrap {
        position: static;
        transform: none;
        margin-top: 6px;
    }
    .header-dropdown {
        font-size: 14px;
    }
    .top-actions {
        margin-left: auto;
    }
    .btn--download {
        padding: 6px 8px;
        font-size: 10px;
    }
    .fcu-main {
        padding: 16px 8px;
    }
    .fcu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
        column-gap: 12px;
        row-gap: 12px;
    }
    .fcu-card {
        box-sizing: border-box;
    }
    .fcu-card-temp {
        font-size: 12px;
        padding: 10px 8px;
    }
    .fcu-on-btn {
        font-size: 12px;
        padding: 8px 10px;
    }
    .top-bar--login {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
    }
    .login-header__right {
        display: none;
    }

    .grid {
        padding: 12px 6px 18px;
    }

    .chart-card--triple-axis {
        padding: 6px 2px 8px;
    }

    .chart-wrap--triple {
        height: 320px;
        min-height: 320px;
        max-height: 320px;
    }

    .chart-wrap--triple canvas {
        height: 320px !important;
        max-height: 320px !important;
        min-height: 320px !important;
    }
}