@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg: #f5f2ee;
    --bg-accent: #eef2f3;
    --surface: #ffffff;
    --surface-alt: #f1f2f4;
    --text: #1a1f24;
    --muted: #5a6068;
    --accent: #1f6f78;
    --accent-strong: #0f4f56;
    --accent-warm: #d27a2b;
    --danger: #c2342d;
    --border: #e2e4e8;
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.12);
    --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.1);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
}

body.theme-dark {
    --bg: #0f1115;
    --bg-accent: #13161c;
    --surface: #171a20;
    --surface-alt: #1b2028;
    --text: #e6e9ee;
    --muted: #a5acb6;
    --accent: #5dd0c1;
    --accent-strong: #38a99b;
    --accent-warm: #f0a049;
    --danger: #e15b56;
    --border: #242a33;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Instrument Sans", "Segoe UI", sans-serif;
    background: radial-gradient(900px 600px at 90% -10%, #e6f4f1 0%, transparent 60%),
        radial-gradient(700px 500px at 10% 10%, #fff2e4 0%, transparent 55%),
        linear-gradient(180deg, #f9f8f5 0%, #f3f0ec 100%);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body.theme-dark {
    background: radial-gradient(900px 600px at 90% -10%, rgba(54, 143, 155, 0.16) 0%, transparent 60%),
        radial-gradient(700px 500px at 10% 10%, rgba(221, 137, 55, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, #0f1115 0%, #0b0d11 100%);
}

h1, h2, h3, h4 {
    font-family: "Space Grotesk", "Instrument Sans", sans-serif;
    letter-spacing: -0.02em;
    margin: 0 0 12px 0;
}

p {
    color: var(--muted);
}

/* ====== HEADER ====== */
.header {
    width: 100%;
    background: rgba(255, 255, 255, 0.82);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

body.theme-dark .header {
    background: rgba(15, 17, 21, 0.82);
}

.header .menu {
    width: 100%;
    max-width: 95vw;
    padding: 0 16px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
}

.header a {
    color: var(--text);
    text-decoration: none;
    margin: 0 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 999px;
    transition: 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header a:hover {
    background: rgba(31, 111, 120, 0.12);
    color: var(--accent-strong);
}

.logout-btn {
    background: var(--danger) !important;
    color: #fff !important;
    padding: 8px 16px !important;
}

.logout-btn:hover {
    background: #a92924 !important;
}

/* ====== PAGE CONTENT ====== */
.container {
    width: 95%;
    margin: 40px auto 60px auto;
}

.card {
    background: var(--surface);
    padding: 22px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    animation: rise-in 0.6s ease both;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
}

.status-badge.status-ok {
    background: linear-gradient(135deg, #2f9f83, #1f7a62);
}

.status-badge.status-error {
    background: linear-gradient(135deg, #e15b56, #b5423e);
}

.status-badge.status-needs_password {
    background: linear-gradient(135deg, #f0a049, #c6782a);
}

.status-text {
    font-weight: 600;
    color: var(--text);
}

button {
    padding: 12px 20px;
    margin: 10px 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: rgba(31, 111, 120, 0.4);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
/* ====== MAIN LAYOUT ====== */

.dashboard-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 20px;
}

.gauge-card {
    flex: 1 1 210px;
    min-width: 210px;
    background: var(--surface);
    padding: 18px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-sizing: border-box;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: rise-in 0.6s ease both;
}


/* ====== GAUGE ====== */

.gauge-box {
    width: 160px;
    height: 160px;
    margin: auto;
}

.gauge {
    --percent: 0deg;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background:
        conic-gradient(var(--accent) var(--percent), #e6e8ec var(--percent));
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 0 10px #f6f7f8;
}

.gauge-inner {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border);
}

.gauge-value {
    font-size: 28px;
    font-weight: bold;
}

.gauge-label {
    font-size: 14px;
    opacity: 0.7;
}
.proc-table {
    width: 100%;
    background: var(--surface);
    border-collapse: collapse;
    margin-top: 15px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: rise-in 0.6s ease both;
}

.proc-table th, .proc-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    color: var(--text);
}

.proc-table tr:hover {
    background: var(--surface-alt);
}

.proc-table th {
    background: #f7f8fa;
    font-weight: 700;
}

body.theme-dark .proc-table th {
    background: #141821;
}
.left-menu {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
}

.right-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: rgba(31, 111, 120, 0.4);
}

body.theme-dark .theme-toggle {
    background: #131821;
    border-color: #27303b;
}

input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: rgba(31, 111, 120, 0.5);
    box-shadow: 0 0 0 4px rgba(31, 111, 120, 0.12);
}

.form-box {
    width: min(620px, 100%);
    margin: 30px auto;
    background: var(--surface);
    padding: 26px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: rise-in 0.6s ease both;
}

.form-box label {
    display: block;
    margin-top: 14px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
}

.form-box textarea {
    height: 200px;
    resize: vertical;
}

.form-box button {
    margin-top: 20px;
    width: 100%;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.form-actions button {
    width: auto;
    flex: 1 1 180px;
    margin: 0;
}
}

.page-title {
    text-align: center;
    margin-bottom: 10px;
}

.progress-card {
    max-width: 980px;
    margin: 0 auto 20px auto;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--surface-alt);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    transition: width 0.2s ease;
}

.progress-meta {
    margin-top: 10px;
    font-size: 14px;
    color: var(--muted);
    word-break: break-word;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: min(380px, 92vw);
    background: var(--surface);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    text-align: left;
    animation: rise-in 0.6s ease both;
}

.auth-card h2 {
    margin-bottom: 6px;
}

.auth-card .error {
    color: var(--danger);
    font-weight: 600;
}

.auth-card button {
    width: 100%;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .header .menu {
        flex-wrap: nowrap;
    }
}

@media (max-width: 720px) {
    .gauge-box,
    .gauge {
        width: 140px;
        height: 140px;
    }

    .gauge-inner {
        width: 102px;
        height: 102px;
    }
}

@media (prefers-color-scheme: dark) {
    body:not(.theme-light) {
        --bg: #0f1115;
        --bg-accent: #13161c;
        --surface: #171a20;
        --surface-alt: #1b2028;
        --text: #e6e9ee;
        --muted: #a5acb6;
        --accent: #5dd0c1;
        --accent-strong: #38a99b;
        --accent-warm: #f0a049;
        --danger: #e15b56;
        --border: #242a33;
    }

    body:not(.theme-light) {
        background: radial-gradient(900px 600px at 90% -10%, rgba(54, 143, 155, 0.16) 0%, transparent 60%),
            radial-gradient(700px 500px at 10% 10%, rgba(221, 137, 55, 0.12) 0%, transparent 55%),
            linear-gradient(180deg, #0f1115 0%, #0b0d11 100%);
    }

    body:not(.theme-light) .header {
        background: rgba(15, 17, 21, 0.82);
    }

    body:not(.theme-light) .proc-table th {
        background: #141821;
    }
}

.form-box.form-wide {
    width: min(980px, 100%);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.file-table {
    table-layout: fixed;
}

.file-table th:first-child,
.file-table td:first-child {
    width: 90px;
}

.file-table th:nth-child(3),
.file-table td:nth-child(3) {
    width: 130px;
}

.file-table th:nth-child(4),
.file-table td:nth-child(4) {
    width: 90px;
}

.file-table th,
.file-table td {
    vertical-align: top;
}

.file-table td:nth-child(2) label {
    display: inline-block;
    word-break: break-word;
    overflow-wrap: anywhere;
}