/* =========================================================
   SysPulse — Industrial Terminal
   Fonts: Syne (display) · Share Tech Mono (data)
   ========================================================= */

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Variables ── */
:root {
    --bg: #0a0c0f;
    --bg-card: #0d1015;
    --border: #1a2230;
    --border-hi: #263040;

    --accent: #1cbd34;
    --accent-dim: rgba(0, 200, 150, .12);
    --accent2: #e5a000;
    /* amber  – mid load */
    --accent3: #e54b00;
    /* red    – high load */
    --blue: #00b4e5;

    --text: #ccd8e8;
    --muted: #5f7686;
    --label: #6b7a86;

    --mono: 'Share Tech Mono', monospace;
    --sans: 'Syne', sans-serif;

    --r: 4px;
    --pad: 1.4rem;
    --gap: 1rem;
    --topbar-h: 52px;
    --footer-h: 36px;
}

/* ── Base ── */
html {
    height: 100%;
}

body {
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* ── Background grid ── */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: .3;
    pointer-events: none;
}

/* Scrolling scan line */
.scan-line {
    position: fixed;
    top: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .15;
    z-index: 1;
    animation: scan 7s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    to {
        top: 100vh;
    }
}

/* ── Top Bar ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.topbar__left,
.topbar__right {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.topbar__logo {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: .18em;
    white-space: nowrap;
}

.topbar__logo .accent {
    color: var(--accent);
}

.topbar__divider {
    color: var(--border-hi);
}

.topbar__hostname {
    font-family: var(--mono);
    font-size: .75rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*Toasty Boi(Toast Notifier)*/
.toastBiscuit {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;

    display: flex;
    flex-direction: column;
    gap: .5rem;

    pointer-events: none;
}

.toast {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;

    pointer-events: auto;

    padding: .8rem 1rem;
    min-width: 220px;

    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    border-left: 4px solid var(--accent);

    border-radius: var(--r);

    color: var(--text);
    font-family: var(--mono);
    font-size: .75rem;

    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.toast__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-hi);
    padding-right: 1rem;
    box-sizing: content-box;
}

.toast__message {
    flex: 1;
}

.toast__timer {
    position: absolute;
    left: 0;
    bottom: 0;

    height: 4px;
    width: 100%;

    background: var(--accent);

    transform-origin: left center;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(120%);
    }

    70% {
        transform: translateX(-6px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    0% {
        transform: translateX(0);
        opacity: 1;
        max-height: 150px;
        margin-bottom: 0;
        padding-top: .8rem;
        padding-bottom: .8rem;
        border-top-width: 1px;
        border-bottom-width: 1px;
    }

    60% {
        transform: translateX(120%);
        opacity: 0;
        max-height: 150px;
        margin-bottom: 0;
        padding-top: .8rem;
        padding-bottom: .8rem;
        border-top-width: 1px;
        border-bottom-width: 1px;
    }

    100% {
        transform: translateX(120%);
        opacity: 0;
        max-height: 0;
        margin-bottom: -0.5rem;
        padding-top: 0;
        padding-bottom: 0;
        border-top-width: 0;
        border-bottom-width: 0;
    }
}

/* Status pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .6rem;
    border-radius: 99px;
    border: 1px solid var(--border-hi);
    font-family: var(--mono);
    font-size: .65rem;
    letter-spacing: .12em;
    white-space: nowrap;
    transition: border-color .2s, color .2s;
}

.status-pill__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    transition: background .2s, box-shadow .2s;
}

/* States driven by JS class on #connectionStatus */
.status-online {
    color: var(--accent);
    border-color: var(--accent-dim);
}

.status-online .status-pill__dot {
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-offline {
    color: var(--accent3);
    border-color: rgba(229, 75, 0, .2);
}

.status-offline .status-pill__dot {
    background: var(--accent3);
}

.status-loading {
    color: var(--muted);
    border-color: var(--border-hi);
}

.status-loading .status-pill__dot {
    background: var(--muted);
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .35;
    }
}

.topbar__updated {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--muted);
    white-space: nowrap;
}

.refresh-btn {
    background: none;
    border: 1px solid var(--border-hi);
    border-radius: var(--r);
    color: var(--muted);
    font-size: 1rem;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color .15s, border-color .15s;
    flex-shrink: 0;
}

.refresh-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.refresh-btn:active {
    transform: rotate(180deg);
    transition: transform .2s, color .15s, border-color .15s;
}

.hamburger-btn {
    background: none;
    color: var(--muted);
    border: none;
    outline: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color .15s, border-color .15s;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    color: var(--accent);
}

.line {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    transition: transform .3s ease;
}

.hamburger-btn svg {
    transition: transform .3s ease;
    overflow: visible;
}

/* Menu open state */
.hamburger-btn.active .line1 {
    transform: translateX(3px);
}

.hamburger-btn.active .line2 {
    transform: translateX(0px);
}

.hamburger-btn.active .line3 {
    transform: translateX(-3px);
}

.hamburger-btn svg {
    transition: transform .3s ease;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 14;

    opacity: 0;
    pointer-events: none;

    transition: opacity .3s ease;
}

.drawer-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    z-index: 15;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    padding: 1rem;
}

.drawer--open {
    transform: translateX(0);
}

.drawer__nav {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.drawer__btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-family: var(--mono);
    font-size: .75rem;
    padding: .6rem .8rem;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.drawer__btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    gap: .5rem;
}

.drawer__btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    align-items: center;
}

.drawer__divider {
    border-top: 1px solid var(--border);
    margin: .5rem 0;
    align-items: center;
}

.drawer__account {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.drawer__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--mono);
    font-size: .7rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.drawer__username {
    font-family: var(--mono);
    font-size: 1.00rem;
    color: var(--text);
    flex: 1;
}

.drawer__signout {
    background: none;
    border: 1px solid var(--border-hi);
    border-radius: var(--r);
    color: var(--muted);
    font-family: var(--mono);
    font-size: .65rem;
    padding: .3rem .6rem;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    width: 100%;
    margin-top: .3rem;
}

.drawer__userinfo {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
}

.drawer__usersub {
    font-family: var(--mono);
    font-size: .6rem;
    color: var(--text);
}

.drawer__signout:hover {
    border-color: var(--accent3);
    color: var(--accent3);
}

/* ── Dashboard ── */
.dashboard {
    position: relative;
    z-index: 5;
    flex: 1;
    padding: var(--gap) 1.5rem;
    display: grid;
    align-items: start;
    grid-template-columns: repeat(3, 1fr);
    ;
    flex-direction: column;
    gap: var(--gap);
}

/*Cards*/
.hcard {
    position: relative;
    display: flex;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s;
    animation: card-in .4s ease both;
}

.hcard:nth-child(1) {
    animation-delay: .05s;
}

.hcard:nth-child(2) {
    animation-delay: .15s;
}

.hcard:hover {
    border-color: var(--border-hi);
    box-shadow: 0 0 20px rgba(0, 200, 160, .04);
}

.hcard::after {
    content: '';
    position: absolute;
    bottom: .45rem;
    right: .45rem;
    width: 7px;
    height: 7px;
    border-right: 1px solid var(--border-hi);
    border-bottom: 1px solid var(--border-hi);
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Disk Drive Layout */
#disk-drive.hcard{
    display: flex;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    order: 1;
}

.disk-drive:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.disk-drive__header {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.disk-drive__name {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--text);
    font-weight: normal;
    letter-spacing: .05em;
}

.disk-drive__health {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--muted);
    margin-left: auto;
}

.disk-drive__stats {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--muted);
    text-align: right;
    margin-top: -0.25rem;
}

.bar--info {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

/*Responsive*/
@media (max-width: 500px) {
    :root {
        --gap: .75rem;
    }

    .hcard__icon-col {
        width: 64px;
        padding: 1rem .5rem;
    }

    .hcard__icon {
        width: 28px;
        height: 28px;
    }

    .hcard__val {
        width: 5.5rem;
        font-size: .72rem;
    }

    .topbar__updated {
        display: none;
    }
}
/*Icon Column*/
.hcard__icon-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 88px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 1.4rem .8rem;
}

.hcard__icon {
    width: 33px;
    height: 38px;
    color: var(--accent);
    transition: color .5s ease, filter .5s ease;
}

.hcard__title {
    font-family: var(--mono);
    font-size: .55rem;
    letter-spacing: .28em;
    color: var(--label);
}

/* Bar css*/
.bar--ok {
    background: linear-gradient(90deg, #60a5fa, #34d399);
}

.hcard__bar.bar--warn {
    background: linear-gradient(90deg, rgba(229, 160, 0, .55), var(--accent2));
}

.hcard__bar.bar--crit {
    background: linear-gradient(90deg, rgba(229, 60, 0, .55), var(--accent3));
}

.hcard__bar.bar--null {
    background: var(--border-hi);
}

/* Cpu heat animation*/
.heat-1 {
    color: var(--accent);
    animation: shake-2 .35s ease-in-out infinite;
}

.heat-2 {
    color: var(--accent2);
    animation: shake-2 .25s ease-in-out infinite;
}

.heat-3 {
    color: var(--accent3);
    animation: shake-3 .18s ease-in-out infinite;
}

.heat-4 {
    color: #ff2000;
    filter: drop-shadow(0 0 5px #ff2000);
    animation: shake-4 .15s ease-in-out infinite;
}

@keyframes shake-1 {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(.5px);
    }
}

@keyframes shake-2 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-1px, .5px);
    }

    75% {
        transform: translate(1px, -.5px);
    }
}

@keyframes shake-3 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-2px, 1px);
    }

    75% {
        transform: translate(2px, -1px);
    }
}

@keyframes shake-4 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(3px, 1.5px) rotate(1.5deg);
    }

    75% {
        transform: translate(3px, -1.5px) rotate(1.5deg);
    }
}

/*Metrics Col*/
.hcard__metrics {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 1.4rem 1.5rem;
    min-width: 0;
}

.hcard__row {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.hcard__label {
    font-family: var(--mono);
    font-size: .58rem;
    letter-spacing: .2em;
    color: var(--label);
    width: 2.6rem;
    flex-shrink: 0;
}

.hcard__bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    min-width: 0;
}

.hcard__bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, #60a5fa, #34d399);
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.hcard__val {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--text);
    width: 8rem;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Footer ── */
.footer {
    position: relative;
    z-index: 10;
    height: var(--footer-h);
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.footer__label {
    font-family: var(--mono);
    font-size: .58rem;
    letter-spacing: .22em;
    color: var(--label);
}

.footer__value {
    font-family: var(--mono);
    font-size: .68rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Disk card additions ── */
.disk-drive {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}

.disk-drive__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.disk-drive__sub {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--muted);
    margin-top: -.45rem;
}

.hcard__bar.bar--read {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.hcard__bar.bar--write {
    background: linear-gradient(90deg, var(--accent2), #f59e0b);
}
/* ── Disk info tiles ── */
.disk-drive__sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.disk-tiles {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .5rem;
    margin-top: .2rem;
}

.disk-tile {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .55rem .7rem;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: var(--r);
    min-width: 0;
}

.disk-tile--wide {
    grid-column: span 3;
}

.disk-tile__label {
    font-family: var(--mono);
    font-size: .55rem;
    letter-spacing: .2em;
    color: var(--label);
}

.disk-tile__value {
    font-family: var(--mono);
    font-size: .9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.disk-tile--read .disk-tile__value {
    color: var(--blue);
}

.disk-tile--write .disk-tile__value {
    color: var(--accent2);
}

@media (max-width: 500px) {
    .disk-tile {
        grid-column: span 3;
    }

    .disk-tile--wide {
        grid-column: span 6;
    }
}
/* Disk card: second row, left side, two columns wide */
#disk-drive {
    grid-column: 1 / 3;
    grid-row: 2;
}
.disk-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .2rem;
}

.disk-tile,
.disk-tile--wide {
    flex: 0 0 auto;
    min-width: 7.5rem;
}
/*Overall Card Health*/
#card-health {
    --hc: var(--accent);
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: stretch;
    flex-direction: column;
    gap: 1rem;
    padding: 1.4rem;
    min-height: 24rem;
    contain: size;            /* keep a long issue list from stretching the whole row */
    border-color: color-mix(in srgb, var(--hc) 30%, var(--border));
}

#card-health[data-state="fair"]     { --hc: #8bd32a; }
#card-health[data-state="degraded"] { --hc: var(--accent2); }
#card-health[data-state="unstable"] { --hc: #f07a1a; }
#card-health[data-state="critical"] { --hc: #e5383b; }
#card-health[data-state="offline"],
#card-health[data-state="loading"]  { --hc: var(--muted); }

.health__hero {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}

.health__emoji {
    width: 100%;
    max-height: 160px;
    overflow: visible;
    color: var(--hc);
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hc) 45%, transparent));
    transition: color .4s;
}

.health__emoji .st {
    opacity: 0;
    transition: opacity .35s ease;
}

#card-health[data-state="healthy"]  .st--healthy,
#card-health[data-state="fair"]     .st--fair,
#card-health[data-state="degraded"] .st--degraded,
#card-health[data-state="unstable"] .st--unstable,
#card-health[data-state="critical"] .st--critical,
#card-health[data-state="offline"]  .st--critical {
    opacity: 1;
}

.health__emoji .occ rect,
.health__emoji .occ circle {
    fill: var(--bg-card);     /* hides lines behind the hands */
}

.health__emoji .thumb {
    transform-origin: 284px 168px;
    transition: transform .6s cubic-bezier(.34, 1.56, .64, 1);
}

#card-health[data-state="healthy"]  .thumb { transform: rotate(0deg); }
#card-health[data-state="fair"]     .thumb { transform: rotate(32deg); }
#card-health[data-state="degraded"] .thumb,
#card-health[data-state="loading"]  .thumb { transform: rotate(90deg); }
#card-health[data-state="unstable"] .thumb { transform: rotate(148deg); }
#card-health[data-state="critical"] .thumb,
#card-health[data-state="offline"]  .thumb { transform: rotate(180deg); }

.health__label {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--hc);
}

.health__sub {
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--muted);
}

/* issues box */
.health__issues {
    flex: 1 1 0;
    min-height: 3.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.health__issues-head {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: .6rem;
    letter-spacing: .2em;
    color: var(--label);
}

.health__list {
    list-style: none;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding-right: .3rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-hi) transparent;
}

.issue {
    --sev: var(--blue);
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-left: 3px solid var(--sev);
    border-radius: var(--r);
    font-family: var(--mono);
    font-size: .8rem;
}

.issue--info     { --sev: var(--blue); }
.issue--warning  { --sev: var(--accent2); }
.issue--critical { --sev: #e5383b; }
.issue--none     { --sev: var(--accent); display: block; color: var(--muted); }

.issue__sev {
    font-size: .58rem;
    letter-spacing: .15em;
    color: var(--sev);
    border: 1px solid var(--sev);
    border-radius: 3px;
    padding: .1rem .3rem;
}

.issue__src {
    font-size: .58rem;
    letter-spacing: .15em;
    color: var(--label);
}

/* footer tiles */
.health__footer {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    padding-top: .9rem;
    border-top: 1px solid var(--border);
}

.health-tile {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .55rem .7rem;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: var(--r);
    min-width: 0;
}

.health-tile__label {
    font-family: var(--mono);
    font-size: .55rem;
    letter-spacing: .2em;
    color: var(--label);
}

.health-tile__value {
    font-family: var(--mono);
    font-size: .9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════════════════════
   Sign-in, dialogs, user management and card detail views
   ════════════════════════════════════════════════════════════════ */
[hidden] { display: none !important; }

/* while signed out, hide the dashboard completely (not just blur it) */
body.is-locked .dashboard,
body.is-locked .footer,
body.is-locked .drawer,
body.is-locked .topbar__right,
body.is-locked .hamburger-btn { visibility: hidden; }

/* ── shared controls ── */
.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--label);
}

.auth-card input,
.modal input,
.modal select {
    background: var(--bg);
    border: 1px solid var(--border-hi);
    border-radius: var(--r);
    color: var(--text);
    font-family: var(--mono);
    font-size: .85rem;
    letter-spacing: normal;
    text-transform: none;
    padding: .55rem .7rem;
    min-width: 0;
}

.auth-card input:focus,
.modal input:focus,
.modal select:focus { outline: none; border-color: var(--accent); }

.check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--mono);
    font-size: .75rem;
    color: var(--muted);
    cursor: pointer;
}
.check input { accent-color: var(--accent); }

.btn {
    background: none;
    border: 1px solid var(--border-hi);
    border-radius: var(--r);
    color: var(--text);
    font-family: var(--mono);
    font-size: .78rem;
    padding: .55rem .9rem;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { border-color: var(--accent); color: var(--accent); }
.btn--primary:hover:not(:disabled) { background: var(--accent-dim); }
.btn--danger { color: #e5383b; border-color: rgba(229, 56, 59, .5); }
.btn--danger:hover:not(:disabled) { border-color: #e5383b; color: #e5383b; background: rgba(229, 56, 59, .1); }
.btn--small { padding: .3rem .55rem; font-size: .68rem; }
.btn.is-busy { opacity: .6; pointer-events: none; }

.form-msg { font-family: var(--mono); font-size: .75rem; min-height: 1em; }
.form-msg--error { color: #ff6b6b; }
.form-msg--ok { color: var(--accent); }
.muted { color: var(--muted); }

/* ── sign-in screen ── */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(6, 8, 10, .96);
}
.auth-card {
    width: min(380px, 100%);
    display: flex;
    flex-direction: column;
    gap: .9rem;
    padding: 1.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.auth-card__logo { font-family: var(--sans); font-weight: 800; letter-spacing: .2em; font-size: 1.05rem; color: var(--text); }
.auth-card__logo .accent { color: var(--accent); }
.auth-card__title { margin: 0; font-family: var(--sans); font-size: 1.35rem; color: var(--text); }
.auth-card__hint { margin: 0; font-family: var(--mono); font-size: .72rem; line-height: 1.5; color: var(--muted); }

/* ── dialogs ── */
.modal {
    margin: auto;            /* his global reset removes the dialog's built-in centering */
    padding: 0;
    border: 1px solid var(--border-hi);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    width: min(760px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
}
.modal--sm { width: min(420px, calc(100vw - 2rem)); }
.modal--wide { width: min(980px, calc(100vw - 2rem)); }
.modal[open] { display: flex; }
.modal::backdrop { background: rgba(4, 6, 8, .78); }

.modal__panel { display: flex; flex-direction: column; width: 100%; min-height: 0; max-height: calc(100vh - 2rem); }
.modal__head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
}
.modal__head h2 {
    flex: 1;
    margin: 0;
    font-family: var(--sans);
    font-size: 1rem;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.modal__close {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--muted);
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.modal__close:hover { color: var(--text); border-color: var(--border-hi); }
.modal__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.2rem;
    overflow-y: auto;
    min-height: 0;
}
.modal > .modal__panel > .form-msg { padding: .5rem 1.2rem 0; }

/* ── tables (users, processes) ── */
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .78rem; }
.dtable th {
    text-align: left;
    font-weight: 400;
    font-size: .58rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--label);
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--border);
}
.dtable td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dtable th.num, .dtable td.num { text-align: right; white-space: nowrap; }
.users-table tr.is-disabled td { opacity: .55; }
.users-actions, .users-status { white-space: nowrap; }
.users-status > * { margin-right: .6rem; }
.status-on { color: var(--accent); }
.status-off { color: #e5383b; }
.users-actions > * { margin-right: .4rem; }
.users-actions input { width: 11rem; padding: .3rem .5rem; font-size: .72rem; }
.badge {
    margin-left: .5rem;
    padding: .1rem .35rem;
    border: 1px solid var(--accent);
    border-radius: 3px;
    color: var(--accent);
    font-size: .55rem;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.users-new h3 { margin: 0 0 .6rem; font-family: var(--mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--label); font-weight: 400; }
.users-new__row { display: flex; flex-wrap: wrap; gap: .5rem; }
.users-new__row input { flex: 1 1 10rem; }

/* ── clickable cards ── */
[data-detail] { cursor: pointer; }
[data-detail]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── detail view ── */
.ranges { display: flex; gap: .25rem; }
.ranges button {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--muted);
    font-family: var(--mono);
    font-size: .7rem;
    padding: .3rem .6rem;
    cursor: pointer;
}
.ranges button:hover { color: var(--text); border-color: var(--border-hi); }
.ranges button.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

.dview { display: flex; flex-direction: column; gap: 1.2rem; }
.dsection { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 1.3rem; border-bottom: 1px solid var(--border); }
.dsection:last-child { border-bottom: none; padding-bottom: 0; }
.dsection > h2 { margin: 0; font-family: var(--sans); font-size: 1rem; letter-spacing: .06em; }
.dsection > h2 .muted { font-family: var(--mono); font-size: .7rem; letter-spacing: normal; }

.dtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.dtile {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .55rem .7rem;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: var(--r);
    min-width: 0;
}
.dtile--wide { grid-column: span 2; }
.dtile__label { font-family: var(--mono); font-size: .55rem; letter-spacing: .2em; color: var(--label); }
.dtile__value { font-family: var(--mono); font-size: .9rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dchart h3 { margin: 0 0 .4rem; font-family: var(--mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 400; color: var(--label); }
.dchart__legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .4rem; font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.dchart__legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; }
.dchart__note { padding: 1rem; border: 1px dashed var(--border-hi); border-radius: var(--r); font-family: var(--mono); font-size: .75rem; color: var(--muted); }

.chart { position: relative; width: 100%; }
.chart canvas { display: block; }
.chart__tip {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    padding: .4rem .6rem;
    background: var(--bg);
    border: 1px solid var(--border-hi);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: .72rem;
    white-space: nowrap;
}
.chart__tip-time { color: var(--muted); margin-bottom: .2rem; }
.chart__dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .4rem; }

.dcores { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem 1rem; }
.dcore { display: grid; grid-template-columns: 2rem 1fr 2.6rem; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .7rem; }
.dcore__label { color: var(--label); }
.dcore__val { text-align: right; }

.dissues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }

.dtile--wide .dtile__value { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 500px) {
    .modal__head { flex-wrap: wrap; }
    .dtable th, .dtable td { padding: .45rem .35rem; }
    .hide-sm { display: none; }
    .modal__body { padding: .9rem; }
}

/* ════════════════════════════════════════════════════════════════
   Responsive dashboard (his original grid was always 3 columns,
   which crushes every card on tablets and phones)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .dashboard { grid-template-columns: repeat(2, 1fr); }
    #disk-drive,
    #card-health { grid-column: 1 / 3; grid-row: auto; }
    #card-health { contain: none; min-height: 0; }
    .health__issues { flex: 0 1 auto; }
    .health__list { max-height: 15rem; }
}

@media (max-width: 700px) {
    .dashboard { grid-template-columns: 1fr; padding-left: .9rem; padding-right: .9rem; }
    #card-cpu, #card-mem, #disk-drive, #card-health { grid-column: 1; }
    .health__label { font-size: 1.25rem; }
    .health__footer { grid-template-columns: 1fr 1fr; }
    .health__footer .health-tile:first-child { grid-column: 1 / 3; }
}
