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

:root {
    --bg-page: #f3f5f8;
    --bg-panel: #ffffff;
    --bg-subtle: #f8fafc;
    --border-color: #d9e1ea;
    --border-strong: #c3cfdd;
    --text-primary: #1f2a37;
    --text-secondary: #5b6777;
    --text-muted: #7b8796;
    --brand: #2d5d88;
    --brand-soft: #dbe8f3;
    --cpu-color: #2d5d88;
    --memory-color: #2f6f56;
    --disk-color: #8c6a2f;
    --network-color: #5d6370;
    --success-color: #2f6f56;
    --warning-color: #8c6a2f;
    --danger-color: #8b3a3a;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.07);
}

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 24px;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
}

header {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.5rem;
    line-height: 1.3;
    color: var(--text-primary);
    font-weight: 700;
}

header .subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.header-info {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.header-info span {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-title {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.card-value {
    margin-top: 10px;
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 700;
    color: var(--text-primary);
}

.card-unit {
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.circular-progress {
    width: 98px;
    height: 98px;
    margin-top: 12px;
}

.progress-background {
    fill: none;
    stroke: #e6ebf1;
    stroke-width: 6;
}

.progress-fill {
    fill: none;
    stroke-width: 6;
    stroke-linecap: butt;
    transform-origin: 49px 49px;
    transform: rotate(-90deg);
    transition: stroke-dashoffset 0.2s linear;
}

.cpu-card .progress-fill {
    stroke: var(--cpu-color);
}

.memory-card .progress-fill {
    stroke: var(--memory-color);
}

.disk-card .progress-fill {
    stroke: var(--disk-color);
}

.network-card .progress-fill {
    stroke: var(--network-color);
}

.network-card .card-value {
    color: var(--network-color);
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 14px;
}

.chart-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
}

.chart-container h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.chart-container canvas {
    max-height: 280px;
}

.details-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.detail-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.detail-link {
    margin-top: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 7px 12px;
    cursor: pointer;
}

.detail-link:hover {
    background: #edf2f7;
    border-color: var(--border-strong);
}

.detail-card.full-width {
    grid-column: 1 / -1;
}

.detail-card h3 {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.info-item {
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.info-item .label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
}

.info-item .value {
    font-size: 0.94rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

.disk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.disk-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-subtle);
    padding: 12px;
}

.disk-item .disk-path {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.disk-item .progress-bar {
    width: 100%;
    height: 8px;
    background: #e5eaf1;
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 10px;
}

.disk-item .progress-bar-fill {
    height: 100%;
    transition: width 0.2s linear;
}

.disk-item .disk-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.process-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}

.process-table thead {
    background: #edf2f7;
}

.process-table th,
.process-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.86rem;
}

.process-table th {
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.74rem;
}

.process-table td {
    color: var(--text-secondary);
    font-weight: 600;
}

.process-table tbody tr:hover {
    background: #f4f7fb;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.modal-dialog {
    position: relative;
    width: min(980px, calc(100% - 28px));
    max-height: calc(100vh - 40px);
    overflow: hidden;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2);
}

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.modal-close:hover {
    background: #edf2f7;
}

.modal-body {
    padding: 14px 18px 18px;
    max-height: calc(100vh - 130px);
    overflow: auto;
}

.modal-body .process-table {
    margin-top: 0;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 960px) {
    body {
        padding: 14px;
    }

    .charts-section,
    .details-section {
        grid-template-columns: 1fr;
    }

    .cards-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-dialog {
        width: calc(100% - 16px);
    }
}

@media (max-width: 640px) {
    .cards-section {
        grid-template-columns: 1fr;
    }

    header {
        padding: 16px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .card {
        min-height: 170px;
    }

    .disk-grid {
        grid-template-columns: 1fr;
    }
}
