:root {
    --bg-color: #03080b;
    --panel-bg: #071217;
    --border-color: #113340;
    --text-primary: #33ffcc;
    --text-secondary: #5ca6b3;
    --text-highlight: #ffcc00;
    --text-danger: #ff3333;
    --text-ok: #33ff33;
    --font-stack: "Courier New", Courier, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 14px;
    line-height: 1.4;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* CRT Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 100;
}

.hmi-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100vh;
}

.panel {
    background-color: var(--panel-bg);
    border: 2px solid var(--border-color);
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0, 255, 204, 0.05);
    position: relative;
}

.panel::before, .panel::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--text-secondary);
}
.panel::before {
    top: -2px; left: -2px;
    border-right: none; border-bottom: none;
}
.panel::after {
    bottom: -2px; right: -2px;
    border-left: none; border-top: none;
}

h1, h2 {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

h1 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

h2 {
    font-size: 1rem;
}

.header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-svg {
    color: var(--text-secondary);
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border: 1px solid var(--border-color);
}

.shift-info {
    text-align: right;
}

#clock {
    font-size: 1.2rem;
    color: var(--text-highlight);
    margin-top: 5px;
    font-weight: bold;
}

/* Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 15px;
    flex-grow: 1;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.center-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Typography & Data */
ul.data-list {
    list-style: none;
}

ul.data-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(17, 51, 64, 0.5);
}

/* Ensure right alignment for values grouped with units */
.val-group {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    min-width: 60px;
}

.value-number {
    color: var(--text-highlight);
    font-weight: bold;
    font-family: monospace;
    text-align: right;
}

.value-text {
    color: var(--text-primary);
    text-align: right;
}

.unit {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-left: 3px;
}

.status-ok { color: var(--text-ok); font-weight: bold; }
.status-warn { color: var(--text-danger); font-weight: bold; }
.highlight { color: var(--text-highlight); font-weight: bold; }

/* Core Panel Specifics */
.core-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-color: var(--text-secondary);
}

.core-title {
    text-align: center;
    width: 100%;
}

.core-data-grid {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 30px;
    flex-grow: 1;
    align-items: center;
}

.core-data-item {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border: 1px solid var(--border-color);
    min-width: 140px;
}

.core-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.core-value {
    font-size: 2.8rem;
    color: var(--text-highlight);
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: baseline;
}

.laser-status {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 15px 30px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.4);
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: bold;
}

.core-graphic {
    flex-grow: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px;
}

.reactor-diagram {
    max-height: 100%;
    max-width: 100%;
    filter: drop-shadow(0 0 3px rgba(0,255,204,0.2));
}

.glow-orange {
    filter: drop-shadow(0 0 8px #ff9900);
}

.lasers line {
    filter: drop-shadow(0 0 5px #3366ff);
}

/* Grid Panel Specifics */
.grid-flex {
    display: flex;
    gap: 20px;
}

.grid-col {
    flex: 1;
}

.grid-sub {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.grid-main-val {
    font-size: 2rem;
    color: var(--text-ok);
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.5);
    display: flex;
    align-items: baseline;
}

.conn-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* Catalyzer Grid */
.cat-list {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(17, 51, 64, 0.5);
}

.cat-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    padding: 5px;
    border-bottom: 1px solid rgba(17, 51, 64, 0.5);
}

.cat-row:last-child {
    border-bottom: none;
}

.header-row {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: bold;
    background: rgba(0,0,0,0.4);
}

.header-row span {
    text-align: right;
}
.header-row span:first-child {
    text-align: left;
}

.right-align {
    text-align: right;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

.emergency-panel {
    border-color: #662222;
}

.emergency-panel h2 {
    color: #ff6666;
    border-bottom-color: #662222;
}
