*{box-sizing:border-box}body{margin:0;font-family:Segoe UI,Arial,sans-serif;background:#f5f7fa;color:#17202a}.hidden{display:none!important}.login{min-height:100vh;display:grid;place-items:center;background:#111820}.login-card{width:min(420px,92vw);background:#fff;padding:38px;border-radius:18px}.login input{width:100%;padding:14px;margin:7px 0;border:1px solid #d7dce2;border-radius:9px}.login button,.primary{width:100%;padding:14px;border:0;border-radius:9px;background:#17202a;color:white;font-weight:700;margin-top:10px}.shell{display:grid;grid-template-columns:245px 1fr;min-height:100vh}aside{background:#111820;color:#c8d0d9;padding:25px 15px;display:flex;flex-direction:column}.logo{font-weight:800;color:#fff;padding:0 12px 25px}.logo small{display:block;color:#8391a1;letter-spacing:.2em}nav button{width:100%;border:0;background:none;color:inherit;text-align:left;padding:11px 13px;border-radius:8px;margin:2px 0}nav button.active,nav button:hover{background:#202a35;color:#fff}.foot{margin-top:auto;border-top:1px solid #29323d;padding:16px 10px}.foot button{float:right;background:none;border:0;color:#9ca8b5}main{padding:28px 34px;min-width:0}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}header h1{margin:0}header p,.muted{color:#758190;margin:5px 0}.live{font-size:12px;font-weight:700;color:#16875d}.card,table,.intro,.backuphead{background:#fff;border:1px solid #e4e8ed;border-radius:14px}.card{padding:20px}.top{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:14px}.visual{display:flex;align-items:center;gap:20px}.visual h3{margin:0 0 8px}.visual strong{display:block;font-size:25px}.visual span,.visual small{display:block;color:#6e7a89;margin-top:4px}.ring{--p:50;width:100px;height:100px;border-radius:50%;background:conic-gradient(#246bfd calc(var(--p)*1%),#e9edf3 0);display:grid;place-items:center;flex:0 0 auto}.ring:before{content:"";width:76px;height:76px;background:#fff;border-radius:50%;grid-area:1/1}.ring div{z-index:1;text-align:center;grid-area:1/1}.ring b{display:block;font-size:20px}.ring small{font-size:10px}.section{margin:28px 2px 12px}.section h2{margin:0}.section p,.intro p{color:#6f7b8b;margin:5px 0}.disks{display:grid;grid-template-columns:1fr 1fr;gap:14px}.disk{display:flex;background:#fff;border:1px solid #e4e8ed;border-radius:14px;padding:18px;gap:16px}.diskpic{font-size:35px;color:#738196}.diskbody{flex:1}.diskhead{display:flex;justify-content:space-between;gap:12px}.diskhead h3{margin:0 0 3px}.diskhead small,.disk td small,td small{display:block;color:#8a95a4;font-size:11px}.diskhead strong{font-size:22px}.progress{height:8px;background:#edf0f4;border-radius:8px;margin:14px 0;overflow:hidden}.progress i{display:block;height:100%;background:#246bfd}.disk.danger .progress i{background:#d92d20}.numbers{display:flex;justify-content:space-between;font-size:12px}.numbers span{color:#778391}.disk p{font-size:12px;line-height:1.45;color:#5e6978;margin:11px 0 0}.warning{margin-top:10px;color:#b54708;font-size:12px}.intro{padding:22px;margin-bottom:14px}.intro h2{margin:0}table{width:100%;border-collapse:collapse;overflow:hidden}th,td{text-align:left;padding:12px 14px;border-bottom:1px solid #edf0f3;font-size:13px;vertical-align:top}th{color:#687483;background:#fafbfc}.tag{display:inline-block;background:#eef4ff;color:#246bfd;padding:4px 7px;border-radius:7px;font-size:11px}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:7px}.ok{background:#22a06b}.bad{background:#d92d20}.off{background:#98a2b3}.edit{border:1px solid #dbe1e8;background:#fff;border-radius:7px;padding:6px 9px}.extgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.extgrid h3{margin:0}.extgrid p{font-size:12px;color:#5f6b7a}.backuphead{display:grid;grid-template-columns:1fr 1fr;gap:15px;padding:22px;margin-bottom:14px}.backuphead h2{margin:4px 0}.backuphead span,.backuphead small{color:#6f7b8b}.checks label{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid #edf0f3}.checks label div{flex:1}.checks em{float:right;font-style:normal;color:#246bfd;font-size:12px}.checks small{display:block;color:#7d8897;margin-top:4px}.blocked{opacity:.5}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}.stats div{background:#fff;border:1px solid #e4e8ed;border-radius:14px;padding:18px}.stats small{color:#788494}.stats b{display:block;font-size:27px;margin-top:5px}.charttop{display:flex;justify-content:space-between}.charttop h2{margin:0}.charttop p{color:#6f7b8b}.linechart{height:270px;position:relative;margin-top:10px}.linechart svg{width:100%;height:235px;overflow:visible}.linechart polyline{stroke:#246bfd;stroke-width:2}.linechart line{stroke:#dfe5ec;stroke-width:1}.axis{display:flex;justify-content:space-between;color:#8a95a4;font-size:11px}.empty{text-align:center;color:#7d8897;padding:50px}.ua{max-width:380px;overflow-wrap:anywhere}.alarm{margin-bottom:10px;border-left:4px solid #f79009}.alarm.critical{border-left-color:#d92d20}@media(max-width:1050px){.top,.extgrid{grid-template-columns:1fr 1fr}.disks{grid-template-columns:1fr}}@media(max-width:720px){.shell{grid-template-columns:1fr}aside{display:none}main{padding:16px}.top,.extgrid,.stats,.backuphead{grid-template-columns:1fr}.visual{justify-content:flex-start}}

.project-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:12px;margin:18px 0}
.project-backup{display:block;border:1px solid #e5e7eb;border-radius:16px;padding:16px;background:#fff}
.project-title{display:flex;gap:12px;align-items:flex-start}.project-title input{margin-top:5px}
.project-title b{display:block;font-size:16px}.project-title small{display:block;color:#667085;margin-top:5px;line-height:1.4}
.project-backup details{margin:12px 0 0 28px}.project-backup summary{cursor:pointer;color:#2563eb}
.project-backup ul{padding-left:18px}.project-backup li{margin:7px 0}.project-backup li small{display:block;color:#667085}
.schedule-head{display:flex;justify-content:space-between;gap:20px;align-items:center}
.schedule-list{display:grid;gap:12px;margin:18px 0}.schedule-row-v6{border:1px solid #e5e7eb;border-radius:14px;padding:14px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.schedule-row-v6 input[type=time],.schedule-row-v6 input[type=number],.schedule-row-v6 select{padding:8px;border:1px solid #d0d5dd;border-radius:8px}
.schedule-row-v6 input[type=number]{width:70px}.schedule-row-v6 details{width:100%}.schedule-projects{display:flex;gap:12px;flex-wrap:wrap;padding-top:10px}
.switchline{white-space:nowrap}
@media(max-width:800px){.schedule-head{align-items:flex-start;flex-direction:column}.project-grid{grid-template-columns:1fr}}
.v7actions{margin-left:auto;display:flex;gap:8px}.v7actions button{padding:8px 12px;border:1px solid #d0d5dd;border-radius:9px;background:#fff}.dochead{display:flex;justify-content:space-between;gap:20px}.mdview,.v7alarm pre{white-space:pre-wrap;overflow:auto}.mdview{max-height:70vh}.v7alarm{border-top:1px solid #e5e7eb;padding:14px 0}.v7alarm small{display:block;color:#667085;margin:4px 0}
.v72table{display:grid;margin-top:16px}.v72tr{display:grid;grid-template-columns:110px 1.25fr 2fr 150px 120px;gap:14px;padding:13px 8px;border-top:1px solid #e5e7eb;align-items:start}.v72tr.head{background:#f8fafc}.v72tr small,.v72proc small{display:block;color:#667085;margin-top:4px}.v72tr.unknown{border-left:4px solid #d92d20;background:#fff7f6}.v72group{margin-top:22px}.v72proc{display:grid;grid-template-columns:14px 1.6fr 1fr;gap:12px;padding:13px 0;border-top:1px solid #e5e7eb}.v72dot{width:10px;height:10px;border-radius:50%;margin-top:5px;background:#12b76a}.v72dot.warning{background:#f79009}.v72dot.critical{background:#d92d20}.v72proc code{display:block;color:#667085;margin-top:5px}.dochead .primary{width:auto!important;min-width:130px!important;height:42px!important;padding:0 18px!important;align-self:flex-start!important}@media(max-width:1000px){.v72tr{grid-template-columns:90px 1fr}.v72tr>*:nth-child(n+3){grid-column:2}.v72proc{grid-template-columns:14px 1fr}.v72proc>div:last-child{grid-column:2}}.terminal-auth{max-width:760px}.terminal-auth-row,.terminal-input-row,.terminal-toolbar{display:flex;gap:10px;align-items:center}.terminal-auth-row input{max-width:240px}.terminal-toolbar{background:#101828;color:#fff;padding:10px 12px;border-radius:12px 12px 0 0}.terminal-toolbar span{margin-right:auto}.terminal-toolbar button{background:#344054;color:#fff;border:0;border-radius:7px;padding:7px 10px}.webterm{margin:0;background:#050b14;color:#d1fadf;min-height:520px;max-height:65vh;overflow:auto;padding:16px;font:14px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap}.terminal-input-row{background:#101828;padding:10px;border-radius:0 0 12px 12px}.terminal-input-row textarea{flex:1;min-height:70px;background:#0c111d;color:#fff;border:1px solid #344054;border-radius:8px;padding:10px;font-family:ui-monospace,Consolas,monospace}.terminal-input-row .primary,.terminal-auth-row .primary{width:auto!important;min-width:120px!important}
/* TERM_FILES_V83 */
.term-files{background:#f8fafc;border:1px solid #d0d5dd;padding:10px 12px}.term-files-head,.term-file{display:flex;gap:10px;align-items:center}.term-files-head{margin-bottom:6px}.term-files-head b{margin-right:auto}.term-files-head button,.term-file button{border:1px solid #d0d5dd;background:#fff;border-radius:7px;padding:5px 9px}.term-file{padding:8px 0;border-top:1px solid #e5e7eb}.term-file>div{flex:1;min-width:0}.term-file small{display:block;color:#667085;overflow-wrap:anywhere;margin-top:2px}

/* BILLING_V9 */
.term-files{margin-top:0;border-radius:12px}.term-history-title{margin-top:22px}.billing-note{color:#667085}

/* ===== SCUBIS BILLING MODALS v1.1 ===== */

.billing-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.billing-modal {
    width: min(680px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.25);
}

.billing-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid #e5e7eb;
}

.billing-modal-head h2 {
    margin: 0;
    font-size: 24px;
}

.billing-modal-head > button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #f3f4f6;
    font-size: 25px;
    cursor: pointer;
}

.billing-modal-body {
    padding: 24px 26px 26px;
}

.billing-user-caption {
    margin-bottom: 22px;
}

.billing-user-caption b {
    display: block;
    font-size: 18px;
}

.billing-user-caption span {
    display: block;
    margin-top: 4px;
    color: #667085;
}

.billing-form {
    display: grid;
    gap: 18px;
}

.billing-form label {
    display: grid;
    gap: 7px;
}

.billing-form label > span {
    font-weight: 600;
}

.billing-form input,
.billing-form select {
    width: 100%;
    box-sizing: border-box;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #fff;
    font: inherit;
}

.billing-form input[readonly] {
    background: #f8fafc;
    color: #667085;
}

.billing-inline {
    display: grid;
    grid-template-columns: minmax(100px,1fr) 90px auto;
    gap: 8px;
}

.billing-inline button {
    white-space: nowrap;
}

.billing-check {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
}

.billing-check input {
    width: auto;
    min-height: auto;
}

.billing-usage {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    margin-top: 24px;
}

.billing-usage > div {
    padding: 14px;
    background: #f8fafc;
    border-radius: 10px;
}

.billing-usage small,
.billing-usage b {
    display: block;
}

.billing-usage small {
    color: #667085;
    margin-bottom: 5px;
}

.billing-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.billing-modal-actions button {
    min-width: 110px;
}

@media (max-width: 700px) {
    .billing-modal-backdrop {
        padding: 10px;
        align-items: flex-start;
    }

    .billing-modal {
        margin-top: 10px;
        max-height: calc(100vh - 20px);
    }

    .billing-inline {
        grid-template-columns: 1fr 80px;
    }

    .billing-inline button {
        grid-column: 1 / -1;
    }

    .billing-usage {
        grid-template-columns: 1fr;
    }
}


.billing-group-limit {
    padding: 16px;
    border-radius: 10px;
    background: #f8fafc;
}

.billing-group-limit small,
.billing-group-limit b,
.billing-group-limit span {
    display: block;
}

.billing-group-limit b {
    font-size: 22px;
    margin: 4px 0;
}

.billing-group-limit span {
    color: #667085;
}

.billing-members {
    display: grid;
    gap: 8px;
}

.billing-members-title {
    font-weight: 600;
    margin-bottom: 3px;
}

.billing-member {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px !important;
    padding: 11px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    cursor: pointer;
}

.billing-member input {
    width: auto;
    min-height: auto;
}

.billing-member b,
.billing-member small {
    display: block;
}

.billing-member small {
    color: #667085;
    margin-top: 2px;
}

.billing-member em {
    font-style: normal;
    color: #667085;
}


/* Billing modal secondary button */
.billing-modal-actions > button:not(.primary) {
    min-height: 48px;
    padding: 0 24px;

    background: #ffffff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;

    color: #1d2939;
    font: inherit;
    font-weight: 600;

    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.billing-modal-actions > button:not(.primary):hover {
    background: #f8fafc;
    border-color: #98a2b3;
}

.billing-modal-actions > button:not(.primary):focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(152,162,179,.18);
}

.billing-modal-actions > .primary {
    min-height: 48px;
    border-radius: 10px;
    font-weight: 700;
}


/* =========================================================
   SCUBIS CONTROL THEME v1
   ========================================================= */

:root {
    --sc-bg: #f4f7fb;
    --sc-panel: #ffffff;
    --sc-panel-2: #f8fafc;
    --sc-text: #172033;
    --sc-muted: #667085;
    --sc-border: #e5e7eb;
    --sc-input: #ffffff;
    --sc-hover: #f2f4f7;
    --sc-shadow: rgba(15,23,42,.10);
}

html[data-theme="dark"] {
    --sc-bg: #0b1018;
    --sc-panel: #131a25;
    --sc-panel-2: #192231;
    --sc-text: #e8edf5;
    --sc-muted: #98a2b3;
    --sc-border: #293446;
    --sc-input: #101722;
    --sc-hover: #1d2838;
    --sc-shadow: rgba(0,0,0,.35);
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] main {
    background: var(--sc-bg);
    color: var(--sc-text);
}

html[data-theme="dark"] header,
html[data-theme="dark"] .card,
html[data-theme="dark"] table,
html[data-theme="dark"] .billing-modal {
    background: var(--sc-panel);
    color: var(--sc-text);
}

html[data-theme="dark"] .intro,
html[data-theme="dark"] .section {
    color: var(--sc-text);
}

html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] .billing-user-caption span {
    color: var(--sc-muted);
}

html[data-theme="dark"] table th {
    color: var(--sc-muted);
}

html[data-theme="dark"] table td,
html[data-theme="dark"] table th,
html[data-theme="dark"] .billing-modal-head,
html[data-theme="dark"] .billing-modal-actions {
    border-color: var(--sc-border);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: var(--sc-input);
    color: var(--sc-text);
    border-color: var(--sc-border);
}

html[data-theme="dark"] input[readonly] {
    background: var(--sc-panel-2);
    color: var(--sc-muted);
}

html[data-theme="dark"] .billing-usage > div,
html[data-theme="dark"] .billing-group-limit,
html[data-theme="dark"] .billing-grace-info {
    background: var(--sc-panel-2);
}

html[data-theme="dark"] .billing-member {
    border-color: var(--sc-border);
}

html[data-theme="dark"] .billing-modal-head > button,
html[data-theme="dark"] .billing-modal-actions > button:not(.primary) {
    background: var(--sc-panel-2);
    color: var(--sc-text);
    border-color: var(--sc-border);
}

html[data-theme="dark"] .billing-modal-actions > button:not(.primary):hover {
    background: var(--sc-hover);
}

html[data-theme="dark"] .tag {
    border-color: var(--sc-border);
}

.sc-theme-toggle {
    border: 1px solid var(--sc-border);
    background: var(--sc-panel);
    color: var(--sc-text);
    border-radius: 10px;
    min-height: 38px;
    padding: 0 13px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
}

.sc-theme-toggle:hover {
    background: var(--sc-hover);
}


/* =========================================================
   SCUBIS CONTROL DARK THEME FIX v2
   ========================================================= */

html[data-theme="dark"] body {
    background: #0b1018 !important;
    color: #e8edf5 !important;
}

/* Основные поверхности */
html[data-theme="dark"] main,
html[data-theme="dark"] #content,
html[data-theme="dark"] .page {
    background: #0b1018 !important;
    color: #e8edf5 !important;
}

html[data-theme="dark"] header,
html[data-theme="dark"] .top,
html[data-theme="dark"] .intro,
html[data-theme="dark"] .card,
html[data-theme="dark"] .section,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .visual {
    background: #141b27 !important;
    color: #e8edf5 !important;
    border-color: #2b3648 !important;
}

/* Белые карточки, которые строятся динамически */
html[data-theme="dark"] #content > div,
html[data-theme="dark"] #content > section {
    border-color: #2b3648;
}

/* Текст */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong,
html[data-theme="dark"] b {
    color: #f3f6fb;
}

html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] span {
    border-color: #2b3648;
}

/* Таблицы */
html[data-theme="dark"] table {
    background: #141b27 !important;
    color: #e8edf5 !important;
}

html[data-theme="dark"] table tr {
    background: #141b27 !important;
}

html[data-theme="dark"] table tr:hover td {
    background: #192333 !important;
}

html[data-theme="dark"] table th {
    background: #192333 !important;
    color: #aeb9ca !important;
    border-color: #2b3648 !important;
}

html[data-theme="dark"] table td {
    background: #141b27 !important;
    color: #e8edf5 !important;
    border-color: #2b3648 !important;
}

/* Формы */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #101722 !important;
    color: #edf2f8 !important;
    border-color: #344055 !important;
}

html[data-theme="dark"] button:not(.primary) {
    border-color: #344055;
}

/* Backup/project cards */
html[data-theme="dark"] .backup-card,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .storage-card {
    background: #141b27 !important;
    color: #e8edf5 !important;
    border-color: #2b3648 !important;
}

/* Billing */
html[data-theme="dark"] .billing-modal {
    background: #141b27 !important;
}

html[data-theme="dark"] .billing-usage > div,
html[data-theme="dark"] .billing-grace-info,
html[data-theme="dark"] .billing-individual-note,
html[data-theme="dark"] .billing-group-readonly {
    background: #192333 !important;
    border-color: #2b3648 !important;
}

.billing-final-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.billing-final-grid > label {
    display: grid;
    gap: 7px;
}

.billing-final-grid > label > span {
    font-weight: 600;
}

.billing-grace-info {
    padding: 12px 14px;
    border-radius: 10px;
}

.billing-grace-info small,
.billing-grace-info b {
    display: block;
}

.billing-grace-info b {
    margin-top: 5px;
}

.billing-individual-note,
.billing-group-readonly {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.billing-group-readonly-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.billing-group-readonly-head small,
.billing-group-readonly-head b {
    display: block;
}

.billing-group-readonly-head b {
    margin-top: 4px;
}

.billing-group-tree {
    display: grid;
    gap: 6px;
    margin-top: 15px;
}

.billing-tree-user {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    gap: 9px;
    align-items: center;
    padding: 8px 0;
}

.billing-tree-user small {
    display: block;
    margin-top: 2px;
}

.billing-group-note {
    margin: 14px 0 0;
    font-size: 13px;
}

/* Modal compact */
.billing-modal {
    width: min(720px, 100%);
}

@media (max-width: 700px) {
    .billing-final-grid {
        grid-template-columns: 1fr;
    }

    .billing-group-readonly-head {
        display: grid;
    }
}


/* =========================================================
   SCUBIS DARK THEME v3 — graphite
   ========================================================= */

html[data-theme="dark"] {
    --sc-bg:       #111722;
    --sc-sidebar:  #151c27;
    --sc-header:   #171f2c;
    --sc-panel:    #1a2331;
    --sc-panel-2:  #202b3b;
    --sc-panel-3:  #263244;

    --sc-text:     #edf2f8;
    --sc-muted:    #9aa8bb;
    --sc-border:   #344154;
    --sc-input:    #151d29;
}

/* Общий фон */
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] main,
html[data-theme="dark"] #content,
html[data-theme="dark"] .page {
    background: var(--sc-bg) !important;
    color: var(--sc-text) !important;
}

/* Sidebar */
html[data-theme="dark"] aside,
html[data-theme="dark"] nav {
    background: var(--sc-sidebar) !important;
}

/* Верхние заголовки страниц */
html[data-theme="dark"] header {
    background: var(--sc-header) !important;
    border-color: var(--sc-border) !important;
}

/* Основные панели */
html[data-theme="dark"] .card,
html[data-theme="dark"] .intro,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .visual {
    background: var(--sc-panel) !important;
    color: var(--sc-text) !important;
    border-color: var(--sc-border) !important;
}

/* ВАЖНО: убираем белые динамические карточки */
html[data-theme="dark"] #content [style*="background:#fff"],
html[data-theme="dark"] #content [style*="background: #fff"],
html[data-theme="dark"] #content [style*="background:white"],
html[data-theme="dark"] #content [style*="background: white"] {
    background: var(--sc-panel) !important;
    color: var(--sc-text) !important;
}

/* Storage cards */
html[data-theme="dark"] #content .disk,
html[data-theme="dark"] #content .storage,
html[data-theme="dark"] #content .storage-card,
html[data-theme="dark"] #content .drive,
html[data-theme="dark"] #content .project-card,
html[data-theme="dark"] #content .backup-card {
    background: var(--sc-panel) !important;
    color: var(--sc-text) !important;
    border-color: var(--sc-border) !important;
}

/* Текст */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] b,
html[data-theme="dark"] strong {
    color: var(--sc-text) !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] small {
    color: var(--sc-muted) !important;
}

/* Таблицы */
html[data-theme="dark"] table,
html[data-theme="dark"] tbody,
html[data-theme="dark"] tr,
html[data-theme="dark"] td {
    background: var(--sc-panel) !important;
    color: var(--sc-text) !important;
}

html[data-theme="dark"] th {
    background: var(--sc-panel-2) !important;
    color: #b6c2d2 !important;
}

html[data-theme="dark"] td,
html[data-theme="dark"] th {
    border-color: var(--sc-border) !important;
}

html[data-theme="dark"] tbody tr:hover td {
    background: var(--sc-panel-2) !important;
}

/* Формы */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: var(--sc-input) !important;
    color: var(--sc-text) !important;
    border: 1px solid var(--sc-border) !important;
}

/* Вторичные кнопки */
html[data-theme="dark"] button:not(.primary) {
    background: var(--sc-panel-2);
    color: var(--sc-text);
    border-color: var(--sc-border);
}

html[data-theme="dark"] button:not(.primary):hover {
    background: var(--sc-panel-3);
}

/* Modal: фон страницы сильнее тушим */
html[data-theme="dark"] .billing-modal-backdrop {
    background: rgba(3, 7, 14, .76) !important;
    backdrop-filter: blur(2px);
}

/* Сам modal заметно отделяем */
html[data-theme="dark"] .billing-modal {
    background: #1a2331 !important;
    border: 1px solid #3a485d;
    box-shadow:
        0 28px 90px rgba(0,0,0,.55),
        0 0 0 1px rgba(255,255,255,.025);
}

html[data-theme="dark"] .billing-modal-head {
    background: #1d2736 !important;
    border-color: var(--sc-border) !important;
}

html[data-theme="dark"] .billing-modal-body {
    background: #1a2331 !important;
}

/* Внутренние карточки modal */
html[data-theme="dark"] .billing-usage > div,
html[data-theme="dark"] .billing-grace-info,
html[data-theme="dark"] .billing-individual-note,
html[data-theme="dark"] .billing-group-readonly {
    background: var(--sc-panel-2) !important;
    border: 1px solid var(--sc-border) !important;
}

/* Progress track */
html[data-theme="dark"] .bar,
html[data-theme="dark"] .progress,
html[data-theme="dark"] progress {
    background: #293548 !important;
}

/* Секции вроде "Хранилище" */
html[data-theme="dark"] .section {
    background: transparent !important;
    color: var(--sc-text) !important;
}

/* Не даём старым правилам снова сделать карточки белыми */
html[data-theme="dark"] #content .card *,
html[data-theme="dark"] #content table * {
    border-color: var(--sc-border);
}


/* =========================================================
   SCUBIS DARK THEME v4 — exact component fixes
   ========================================================= */

/* ---------- OVERVIEW / DISKS ---------- */

html[data-theme="dark"] .disk {
    background: #1a2331 !important;
    color: #edf2f8 !important;
    border-color: #344154 !important;
}

html[data-theme="dark"] .disk h3,
html[data-theme="dark"] .disk strong,
html[data-theme="dark"] .disk .numbers b {
    color: #edf2f8 !important;
}

html[data-theme="dark"] .disk small,
html[data-theme="dark"] .disk p,
html[data-theme="dark"] .disk .numbers span {
    color: #91a1b6 !important;
}

html[data-theme="dark"] .disk .progress {
    background: #303c50 !important;
}


/* ---------- TABLE HEADERS ---------- */

html[data-theme="dark"] table thead,
html[data-theme="dark"] table thead tr,
html[data-theme="dark"] table thead th,
html[data-theme="dark"] table tr:first-child th {
    background: #202b3b !important;
    color: #aebbd0 !important;
    border-color: #344154 !important;
}


/* ---------- BACKUP HEADER ---------- */

html[data-theme="dark"] .backuphead {
    background: #1a2331 !important;
    color: #edf2f8 !important;
    border: 1px solid #344154 !important;
}

html[data-theme="dark"] .backuphead h2 {
    color: #edf2f8 !important;
}

html[data-theme="dark"] .backuphead small,
html[data-theme="dark"] .backuphead span {
    color: #91a1b6 !important;
}


/* ---------- BACKUP PROJECT CARDS ---------- */

html[data-theme="dark"] .backupgroup {
    background: transparent !important;
}

html[data-theme="dark"] .checks label {
    background: #202b3b !important;
    color: #edf2f8 !important;
    border-color: #344154 !important;
}

html[data-theme="dark"] .checks label:hover {
    background: #263244 !important;
    border-color: #46566e !important;
}

html[data-theme="dark"] .checks label b {
    color: #edf2f8 !important;
}

html[data-theme="dark"] .checks label small,
html[data-theme="dark"] .checks label em {
    color: #91a1b6 !important;
}

html[data-theme="dark"] .checks label.blocked {
    opacity: .55;
}


/* ---------- BACKUP MAIN PANELS ---------- */

html[data-theme="dark"] .backuphead + .card,
html[data-theme="dark"] #jobHistory {
    background: #1a2331 !important;
    border-color: #344154 !important;
    color: #edf2f8 !important;
}


/* ---------- TAGS ---------- */

html[data-theme="dark"] .tag {
    background: #202b3b !important;
    color: #a9c1ff !important;
    border: 1px solid #344154 !important;
}


/* ---------- STANDARD BUTTONS ---------- */

html[data-theme="dark"] .edit {
    background: #202b3b !important;
    color: #edf2f8 !important;
    border: 1px solid #3b4a60 !important;
    border-radius: 7px !important;
    padding: 6px 11px !important;
    cursor: pointer;
}

html[data-theme="dark"] .edit:hover {
    background: #2a3749 !important;
}


/* ---------- THEME BUTTON ---------- */

html[data-theme="dark"] .sc-theme-toggle {
    background: #202b3b !important;
    border-color: #344154 !important;
    color: #edf2f8 !important;
}


/* ---------- MODAL ---------- */

html[data-theme="dark"] .billing-modal-backdrop {
    background: rgba(5, 9, 16, .68) !important;
    backdrop-filter: blur(3px);
}

html[data-theme="dark"] .billing-modal {
    background: #1a2331 !important;
    border: 1px solid #3a485d !important;
}


/* =========================================================
   SCUBIS DARK FINAL COMPONENT FIX
   ========================================================= */

/* BOOK KPI CARDS */
html[data-theme="dark"] .stats > div {
    background: #1a2331 !important;
    border: 1px solid #344154 !important;
    color: #edf2f8 !important;
}

html[data-theme="dark"] .stats > div small {
    color: #91a1b6 !important;
}

html[data-theme="dark"] .stats > div b {
    color: #f5f7fb !important;
}


/* NEW BACKUP PROJECT CARDS */
html[data-theme="dark"] .project-backup {
    background: #202b3b !important;
    color: #edf2f8 !important;
    border: 1px solid #344154 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .project-backup:hover {
    background: #263244 !important;
    border-color: #46566e !important;
}

html[data-theme="dark"] .project-backup b,
html[data-theme="dark"] .project-backup strong {
    color: #edf2f8 !important;
}

html[data-theme="dark"] .project-backup small,
html[data-theme="dark"] .project-backup p,
html[data-theme="dark"] .project-backup span {
    color: #9aa8bb !important;
}

html[data-theme="dark"] .project-backup a,
html[data-theme="dark"] .project-backup summary {
    color: #78a0ff !important;
}


/* TABLE HEADER — FORCE DARK */
html[data-theme="dark"] table > tbody > tr:first-child > th,
html[data-theme="dark"] table > tr:first-child > th,
html[data-theme="dark"] table thead th {
    background: #202b3b !important;
    color: #aebbd0 !important;
    border-color: #344154 !important;
}


/* V72 EXTERNAL SERVICES */
html[data-theme="dark"] .v72table {
    background: #1a2331 !important;
    color: #edf2f8 !important;
}

html[data-theme="dark"] .v72tr {
    background: #1a2331 !important;
    border-color: #344154 !important;
    color: #edf2f8 !important;
}

html[data-theme="dark"] .v72tr.head {
    background: #202b3b !important;
    color: #aebbd0 !important;
}

html[data-theme="dark"] .v72tr small,
html[data-theme="dark"] .v72proc small,
html[data-theme="dark"] .v72proc code {
    color: #91a1b6 !important;
}


/* GENERIC CARDS MUST NEVER BECOME WHITE IN DARK MODE */
html[data-theme="dark"] .card {
    background: #1a2331 !important;
    color: #edf2f8 !important;
    border-color: #344154 !important;
}


/* SELECT / DATE */
html[data-theme="dark"] select,
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="text"] {
    color-scheme: dark;
    background: #151d29 !important;
    color: #edf2f8 !important;
    border-color: #3a485d !important;
}


/* PRIMARY ACTION */
html[data-theme="dark"] .primary {
    background: #2f6df6 !important;
    color: #fff !important;
}

html[data-theme="dark"] .primary:hover {
    background: #3f7cff !important;
}


/* SYSTEM EDIT MODAL */

.system-edit-caption {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.system-edit-caption code {
    color: #667085;
    font-size: 13px;
}

.system-edit-note {
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 10px;
    background: #f8fafc;
}

html[data-theme="dark"] .system-edit-caption code {
    color: #91a1b6;
}

html[data-theme="dark"] .system-edit-note {
    background: #202b3b;
    border: 1px solid #344154;
}

html[data-theme="dark"] .system-edit-note small {
    color: #9aa8bb !important;
}

.billing-form textarea {
    resize: vertical;
    min-height: 105px;
}


/* ===== TERMINAL FILE HISTORY DARK ===== */

html[data-theme="dark"] .terminal-files,
html[data-theme="dark"] .terminal-file-list,
html[data-theme="dark"] .terminal-files-panel {
    background: #1a2331 !important;
    color: #edf2f8 !important;
    border-color: #344154 !important;
}

html[data-theme="dark"] .terminal-files > *,
html[data-theme="dark"] .terminal-file-list > * {
    background: #1a2331 !important;
    color: #edf2f8 !important;
    border-color: #344154 !important;
}

html[data-theme="dark"] .terminal-file-row {
    background: #1a2331 !important;
    border-color: #344154 !important;
}

html[data-theme="dark"] .terminal-file-row:hover {
    background: #202b3b !important;
}

html[data-theme="dark"] .terminal-file-row small {
    color: #91a1b6 !important;
}


/* ===== SSD / HDD ICON ===== */

.diskpic {
    width: 54px;
    flex: 0 0 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #91a1b6;
}

.drive-icon {
    width: 42px;
    height: 34px;
    position: relative;
    border: 2px solid currentColor;
    border-radius: 6px;
    background: rgba(255,255,255,.025);
}

.drive-icon::before {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 7px;
    height: 2px;
    background: currentColor;
    opacity: .7;
}

.drive-icon::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    right: 6px;
    top: 6px;
    border-radius: 50%;
    background: #4d7cff;
}

.diskpic.hdd .drive-icon span {
    position: absolute;
    width: 15px;
    height: 15px;
    left: 6px;
    top: 5px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.diskpic.ssd .drive-icon span {
    position: absolute;
    width: 16px;
    height: 11px;
    left: 6px;
    top: 6px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.diskpic small {
    font-size: 10px !important;
    font-weight: 800;
    letter-spacing: .08em;
    color: #91a1b6 !important;
}


/* ===== TERMINAL FILES DARK — REAL CLASSES ===== */

html[data-theme="dark"] .term-files {
    background: #1a2331 !important;
    color: #edf2f8 !important;
    border: 1px solid #344154 !important;
    border-radius: 14px;
    overflow: hidden;
}

html[data-theme="dark"] .term-files-head {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;

    background: #202b3b !important;
    color: #edf2f8 !important;
    border-bottom: 1px solid #344154 !important;
    padding: 10px 12px;
}

html[data-theme="dark"] .term-files-head b {
    color: #edf2f8 !important;
}

html[data-theme="dark"] .term-files-head button,
html[data-theme="dark"] .term-file button {
    background: #263244 !important;
    color: #edf2f8 !important;
    border: 1px solid #3b4a60 !important;
    border-radius: 7px;
    padding: 6px 10px;
}

html[data-theme="dark"] .term-files-head button:hover,
html[data-theme="dark"] .term-file button:hover {
    background: #314057 !important;
}

html[data-theme="dark"] .term-file {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto auto;
    gap: 8px;
    align-items: center;

    background: #1a2331 !important;
    color: #edf2f8 !important;
    border-bottom: 1px solid #2f3b4e !important;
    padding: 11px 12px;
}

html[data-theme="dark"] .term-file:last-child {
    border-bottom: 0 !important;
}

html[data-theme="dark"] .term-file:hover {
    background: #202b3b !important;
}

html[data-theme="dark"] .term-file b {
    color: #edf2f8 !important;
}

html[data-theme="dark"] .term-file small {
    display: block;
    margin-top: 3px;
    color: #91a1b6 !important;
}

@media(max-width:800px) {
    html[data-theme="dark"] .term-file {
        grid-template-columns: 1fr auto;
    }

    html[data-theme="dark"] .term-file > div {
        grid-column: 1 / -1;
    }
}


/* ===== DASHBOARD RINGS DARK ===== */

html[data-theme="dark"] .ring {
    background:
        conic-gradient(
            #4d7cff calc(var(--p) * 1%),
            #344154 0
        ) !important;
}

html[data-theme="dark"] .ring:before {
    background: #202b3b !important;
}

html[data-theme="dark"] .ring b {
    color: #edf2f8 !important;
}

html[data-theme="dark"] .ring small {
    color: #91a1b6 !important;
}


/* ===== TERMINAL ACTION FEEDBACK ===== */

.terminal-toolbar button {
    transition:
        background .16s ease,
        border-color .16s ease,
        transform .10s ease;
}

.terminal-toolbar button:active {
    transform: scale(.96);
}

.terminal-toolbar button.terminal-action-ok {
    background: #16794f !important;
    color: #ffffff !important;
    border-color: #1f9d68 !important;
}


/* SCUBIS Vision monitor */
.vision-card{margin-bottom:18px}
.vision-head,.vision-progress-head{
 display:flex;justify-content:space-between;align-items:center;gap:16px
}
.vision-head h2{margin-bottom:4px}
.vision-progress-head{margin-top:18px;margin-bottom:7px}
.vision-progress{
 height:12px;border-radius:999px;overflow:hidden;
 background:rgba(127,127,127,.18)
}
.vision-progress i{
 display:block;height:100%;border-radius:999px;
 background:linear-gradient(90deg,#16a085,#2471a3);
 transition:width .4s ease
}
.vision-stats{
 display:grid;
 grid-template-columns:repeat(4,minmax(0,1fr));
 gap:10px;margin-top:16px
}
.vision-stats>div,.vision-services>div{
 padding:12px;border:1px solid rgba(127,127,127,.18);
 border-radius:10px
}
.vision-stats small,.vision-services small{
 display:block;opacity:.72;margin-bottom:5px
}
.vision-stats b{font-size:18px}
.vision-services{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:10px;margin-top:10px
}
@media(max-width:900px){
 .vision-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .vision-services{grid-template-columns:1fr}
}

/* =========================================================
   SCUBIS CONTROL LOGIN v2
   ========================================================= */

.login {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(55, 92, 145, .18),
            transparent 40%
        ),
        #111722;
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;

    background: #1a2331;
    color: #edf2f8;

    border: 1px solid #344154;
    border-radius: 18px;

    box-shadow:
        0 30px 80px rgba(0,0,0,.35);
}

.login-card h1,
.login-card h2 {
    color: #f5f7fb;
}

.login-card h1 {
    margin: 0;
    font-size: 27px;
}

.login-card > p {
    margin: 8px 0 26px;
    color: #91a1b6;
}

.login-card input {
    width: 100%;
    height: 48px;

    margin: 6px 0;
    padding: 0 14px;

    background: #151d29;
    color: #edf2f8;

    border: 1px solid #3a485d;
    border-radius: 10px;

    font: inherit;

    outline: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.login-card input:focus {
    border-color: #4d7cff;

    box-shadow:
        0 0 0 3px rgba(77,124,255,.15);
}

.login-card input::placeholder {
    color: #718096;
}

.login-card .primary {
    width: 100%;
    min-height: 48px;

    margin-top: 12px;

    background: #2f6df6;
    color: white;

    border: 0;
    border-radius: 10px;

    font-weight: 700;
    cursor: pointer;

    transition:
        background .15s ease,
        transform .1s ease;
}

.login-card .primary:hover {
    background: #3f7cff;
}

.login-card .primary:active {
    transform: scale(.99);
}

.login-card .primary:disabled {
    opacity: .55;
    cursor: wait;
}

.login-card .error,
.login-card #loginError {
    margin-top: 14px;
    padding: 10px 12px;

    background: rgba(217,45,32,.12);
    color: #fda29b;

    border: 1px solid rgba(217,45,32,.30);
    border-radius: 9px;
}

.login-card .tag {
    background: #202b3b;
    color: #a9c1ff;
    border: 1px solid #344154;
}

