:root {
    --bg: #0b1120;
    --panel: #111c2e;
    --border: #263449;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --green: #22c55e;
    --blue: #38bdf8;
    --yellow: #fbbf24;
    --red: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    font-size: 14px;
}

header {
    padding: 22px 30px;
    background: #0f172a;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

h1 { margin: 0 0 7px; font-size: 27px; }
h2 { font-size: 19px; margin: 0 0 18px; }
h3 { font-size: 14px; color: var(--muted); }

.gold { color: var(--yellow); }
.subtitle { color: var(--muted); font-size: 12px; }
.header-right { text-align: right; line-height: 1.8; }
.mode { color: var(--blue); font-size: 12px; font-weight: bold; }

main { padding: 24px; max-width: 1800px; margin: auto; }

.summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.summary article, .wan-card, .panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

label {
    display: block;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.summary strong { font-size: 26px; }

.wan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.wan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.wan-name { font-size: 23px; font-weight: bold; }

.status {
    font-size: 12px;
    font-weight: bold;
    padding: 7px 10px;
    border-radius: 5px;
}

.OTTIMA { color: var(--green); background: #123326; }
.DEGRADATA { color: var(--yellow); background: #382c13; }
.CRITICA, .OFFLINE { color: var(--red); background: #381b24; }
.STALE { color: var(--muted); background: #263449; }

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.metric strong { font-size: 21px; }
.small { font-size: 12px; color: var(--muted); }

.traffic { margin-top: 17px; }

.traffic-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 12px;
}

.bar {
    height: 9px;
    background: #263449;
    border-radius: 6px;
    overflow: hidden;
}

.fill {
    height: 100%;
    border-radius: 6px;
    transition: width .4s;
}

.tx { background: var(--blue); }
.rx { background: var(--green); }

.details {
    border-top: 1px solid var(--border);
    margin-top: 20px;
    padding-top: 14px;
    line-height: 1.9;
    font-size: 12px;
    color: var(--muted);
}

.panel { margin-bottom: 20px; }

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

select {
    background: #0b1120;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 9px;
    border-radius: 5px;
}

.charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

canvas { width: 100%; height: 220px; display: block; }

.legend { display: flex; gap: 20px; font-size: 12px; }
.tim { color: #22c55e; }
.fastweb { color: #38bdf8; }
.linkem { color: #fbbf24; }

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th { color: var(--muted); font-size: 11px; }

footer {
    text-align: center;
    padding: 20px;
    font-size: 11px;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .wan-grid { grid-template-columns: 1fr; }
    .summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 650px) {
    .charts { grid-template-columns: 1fr; }
    header { flex-direction: column; align-items: flex-start; }
    .header-right { text-align: left; }
    main { padding: 12px; }
}

.quality-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px;
    margin-bottom: 20px;
    background: #0d1728;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.quality-gauge {
    width: 115px;
    height: 115px;
    flex-shrink: 0;
}

.quality-info {
    flex: 1;
    line-height: 1.9;
}

.quality-label {
    font-size: 14px;
    font-weight: bold;
}

.recovery {
    color: var(--yellow);
    font-size: 12px;
    font-weight: bold;
}


.user-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 13px;
}

.role-admin, .role-tech {
    font-size: 10px;
    font-weight: bold;
    padding: 4px 7px;
    border-radius: 4px;
}

.role-admin {
    color: #fbbf24;
    background: #422d12;
}

.role-tech {
    color: #38bdf8;
    background: #0c3045;
}

.logout-button {
    background: #263449;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 5px;
    padding: 5px 12px;
    cursor: pointer;
}

.logout-button:hover {
    background: #475569;
}

[hidden] {
    display: none !important;
}

.traffic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 15px 0;
}

.traffic-grid article {
    background: #0b1120;
    border: 1px solid #263449;
    border-radius: 9px;
    padding: 16px;
}

.traffic-grid label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.traffic-grid strong {
    font-size: 25px;
    color: #e2e8f0;
}

.traffic-progress-label {
    display: flex;
    justify-content: space-between;
    margin: 15px 0 8px;
    font-size: 13px;
}

.traffic-progress {
    height: 12px;
    border-radius: 8px;
    background: #263449;
    overflow: hidden;
    margin-bottom: 20px;
}

#cloud-progress-bar {
    height: 100%;
    width: 0%;
    background: #22c55e;
    transition: width 0.5s;
}

.distribution-row {
    display: grid;
    grid-template-columns: 90px 1fr 75px 100px;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
    font-size: 13px;
}

.distribution-track {
    height: 10px;
    border-radius: 6px;
    background: #263449;
    overflow: hidden;
}

.distribution-fill {
    height: 100%;
    border-radius: 6px;
}

.traffic-note {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 10px;
}

#billing-panel {
    border-color: #854d0e;
}

#billing-panel h2 {
    color: #fbbf24;
}

#billing-panel .billing-total {
    border-color: #854d0e;
}

#billing-panel strong {
    color: #fbbf24;
}

@media (max-width: 900px) {
    .traffic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .traffic-grid {
        grid-template-columns: 1fr;
    }
    .distribution-row {
        grid-template-columns: 70px 1fr 55px;
    }
    .distribution-volume {
        display: none;
    }
}

#main-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: #111c2e;
    border-bottom: 1px solid #263449;
}

#main-navigation button {
    background: transparent;
    color: #94a3b8;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
}

#main-navigation button:hover {
    background: #263449;
    color: #e2e8f0;
}

#main-navigation button.nav-active {
    background: #1e3a5f;
    border-color: #2563eb;
    color: #38bdf8;
}

#main-navigation #nav-billing {
    color: #fbbf24;
}

.page-hidden {
    display: none !important;
}

/* GoldTV WAN Monitor 1.4 - User Management */

.management-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.management-grid article {
    background: #0b1120;
    border: 1px solid #263449;
    border-radius: 10px;
    padding: 18px;
}

.management-grid label {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    margin-bottom: 10px;
}

.management-grid strong {
    color: #38bdf8;
    font-size: 24px;
    overflow-wrap: anywhere;
}

.management-button {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 9px 15px;
    cursor: pointer;
    font-size: 13px;
}

.management-button:hover {
    background: #1d4ed8;
}

.management-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.management-button.secondary {
    background: #263449;
    border-color: #475569;
}

.management-button.danger {
    background: #7f1d1d;
    border-color: #ef4444;
}

.management-button.small {
    padding: 5px 9px;
    margin: 3px;
    font-size: 12px;
}

.management-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.management-form {
    display: grid;
    gap: 12px;
    max-width: 450px;
    margin-top: 20px;
}

.management-form label {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    margin: 5px 0;
}

.management-form input,
.management-form select {
    box-sizing: border-box;
    width: 100%;
    background: #0b1120;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 11px;
}

.management-form input:focus,
.management-form select:focus {
    outline: 1px solid #38bdf8;
}

.management-dialog {
    background: #111c2e;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 12px;
    padding: 26px;
    width: min(440px, 90vw);
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.management-dialog::backdrop {
    background: rgba(0, 0, 0, 0.75);
}

.management-message {
    color: #38bdf8;
    font-size: 13px;
    margin: 10px 0;
}

.management-message.error {
    color: #ef4444;
}

.user-enabled {
    color: #22c55e;
}

.user-disabled {
    color: #ef4444;
}

.user-locked {
    color: #fbbf24;
}

#nav-users,
#nav-audit {
    color: #fbbf24;
}

@media (max-width: 900px) {
    .management-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .management-grid {
        grid-template-columns: 1fr;
    }
}


/* GoldTV WAN Monitor 1.5 - Configuration */

.cfg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.cfg-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    min-width: 0;
}

.cfg-card h3 {
    color: var(--blue);
    font-size: 16px;
    margin: 0 0 20px;
}

.cfg-form fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.cfg-form input,
.cfg-form textarea {
    width: 100%;
    background: var(--panel);
    color: var(--text);
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 10px;
    font: inherit;
}

.cfg-form input:focus,
.cfg-form textarea:focus {
    outline: 1px solid var(--blue);
}

.cfg-form input[type="number"] {
    max-width: 130px;
}

.cfg-form textarea {
    resize: vertical;
}

.cfg-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 45px;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
}

.cfg-row label {
    margin: 0;
    font-size: 13px;
}

.cfg-unit {
    color: var(--muted);
    font-size: 12px;
}

.cfg-notice {
    background: #0c3045;
    color: var(--blue);
    border: 1px solid #164e63;
    border-radius: 7px;
    padding: 14px;
    margin: 20px 0;
    line-height: 1.6;
}

.cfg-warning {
    color: var(--yellow) !important;
}

.cfg-critical {
    color: var(--red) !important;
}

.cfg-valid {
    color: var(--green);
}

.cfg-invalid {
    color: var(--red);
}

#cfg-dialog {
    width: min(750px, 90vw);
}

#cfg-dialog-content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.6;
}

#cfg-history td:nth-child(4) {
    white-space: normal;
    min-width: 180px;
}

@media (max-width: 1000px) {
    .cfg-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .cfg-row {
        grid-template-columns: minmax(0, 1fr) 90px 35px;
        gap: 6px;
    }
}

/* GoldTV WAN Monitor 1.6 - Advanced Statistics */

.stats-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-note {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 12px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.stats-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    min-width: 0;
}

.stats-card h3 {
    color: var(--blue);
    margin: 0 0 16px;
}

.stats-distribution-bar {
    display: flex;
    height: 22px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border);
    margin-bottom: 16px;
}

.stats-distribution-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
}

#advanced-statistics h3 {
    margin-top: 24px;
    margin-bottom: 12px;
}

#stats-content[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* GoldTV WAN Monitor 1.7 - Billing Management */

#billing-management {
    margin-top: 28px;
    border-top: 1px solid #854d0e;
    padding-top: 18px;
}

#billing-management h3 {
    margin: 22px 0 14px;
    color: #fbbf24;
}

#bill-fields {
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 18px;
    margin: 20px 0;
}

.bill-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

#bill-form label {
    display: block;
    font-size: 13px;
    color: #94a3b8;
}

#bill-form input:not([type="checkbox"]),
#bill-form select,
#bill-form textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: #0b1120;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font: inherit;
}

#bill-form textarea {
    resize: vertical;
}

#bill-form input:focus,
#bill-form select:focus,
#bill-form textarea:focus {
    outline: 1px solid #fbbf24;
}

#bill-form .bill-check {
    margin: 20px 0;
}

.bill-reason-label {
    margin-top: 18px;
}

.bill-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.bill-actions button {
    background: #263449;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 10px 16px;
    color: #e2e8f0;
    cursor: pointer;
}

.bill-actions button[type="submit"] {
    background: #854d0e;
    border-color: #ca8a04;
    color: #fff;
}

.bill-actions button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

#bill-message {
    min-height: 20px;
    white-space: pre-wrap;
}

#bill-message.bill-error {
    color: #ef4444;
}

#bill-message.bill-success {
    color: #22c55e;
}

@media (max-width: 1000px) {
    .bill-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 550px) {
    .bill-form-grid {
        grid-template-columns: 1fr;
    }
}


/* GoldTV WAN Monitor 1.7 - Budget Management */

#budget-management {
    margin-top: 28px;
    border-top: 1px solid #854d0e;
    padding-top: 18px;
}

#budget-management h3 {
    margin: 22px 0 14px;
    color: #fbbf24;
}

#budget-fields {
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 18px;
    margin: 20px 0;
}

#budget-form label {
    display: block;
    font-size: 13px;
    color: #94a3b8;
}

#budget-form input:not([type="checkbox"]),
#budget-form textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: #0b1120;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font: inherit;
}

#budget-form .bill-check {
    margin: 20px 0;
}

#budget-form textarea {
    resize: vertical;
}

#budget-form input:focus,
#budget-form textarea:focus {
    outline: 1px solid #fbbf24;
}

#budget-message {
    min-height: 20px;
    white-space: pre-wrap;
}

#budget-message.bill-error {
    color: #ef4444;
}

#budget-message.bill-success {
    color: #22c55e;
}


/* GoldTV WAN Monitor 1.7 - Forecast */

#forecast-management {
    margin: 28px 0;
    padding: 20px 0;
    border-top: 1px solid #854d0e;
    border-bottom: 1px solid #854d0e;
}

#forecast-management h3 {
    color: #fbbf24;
    margin: 0;
}

#forecast-status {
    font-size: 12px;
    font-weight: bold;
    padding: 6px 12px;
    border: 1px solid currentColor;
    border-radius: 6px;
}

.forecast-cost-grid {
    margin-top: 16px;
}

.forecast-quality {
    background: #0b1120;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 18px;
    margin: 20px 0;
}

.forecast-quality h4 {
    margin: 0 0 16px;
    color: #e2e8f0;
}

.forecast-quality-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    font-size: 13px;
    color: #94a3b8;
}

.forecast-quality-row strong {
    color: #e2e8f0;
    text-align: right;
}

#forecast-progress {
    width: 100%;
    height: 12px;
    accent-color: #fbbf24;
}

#forecast-excluded {
    margin-top: 20px;
    font-size: 13px;
}

#forecast-excluded summary {
    cursor: pointer;
    color: #94a3b8;
    padding: 10px 0;
}

#forecast-management .fc-good {
    color: #22c55e;
}

#forecast-management .fc-warning {
    color: #fbbf24;
}

#forecast-management .fc-critical {
    color: #ef4444;
}

#forecast-management .fc-neutral {
    color: #94a3b8;
}


/* GoldTV WAN Monitor 1.7 - Monthly billing */

#monthly-management {
    margin: 28px 0;
    padding: 20px 0;
    border-top: 1px solid #854d0e;
    border-bottom: 1px solid #854d0e;
}

#monthly-management h3 {
    color: #fbbf24;
    margin: 0;
}

.monthly-toolbar,
.monthly-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.monthly-secondary {
    margin-top: 16px;
}

#monthly-progress {
    width: 100%;
    height: 12px;
    accent-color: #fbbf24;
    margin-top: 16px;
}

#monthly-fields {
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
}

.monthly-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.monthly-form-grid label,
.monthly-reason-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.monthly-reason-label {
    margin-top: 16px;
}

#monthly-management input,
#monthly-management select {
    box-sizing: border-box;
    background: #0b1120;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 10px;
    min-width: 0;
}

#monthly-management button {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 9px 14px;
    cursor: pointer;
}

#monthly-management button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

#monthly-management .monthly-warning {
    color: #fbbf24;
}

#monthly-management .monthly-good {
    color: #22c55e;
}

#monthly-management .monthly-info {
    color: #38bdf8;
}

#monthly-management .monthly-error {
    color: #ef4444;
}

@media (max-width: 800px) {
    .monthly-form-grid {
        grid-template-columns: 1fr;
    }
}


/* GoldTV Client Flow Monitor v1.8 */

.flows-tabs,
.flows-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}

.flows-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.flows-summary article {
    background: #172235;
    border: 1px solid #263449;
    border-radius: 10px;
    padding: 16px;
}

.flows-summary label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
}

.flows-summary strong {
    font-size: 28px;
}

.flow-ONLINE { color: var(--green); }
.flow-DEGRADED { color: var(--yellow); }
.flow-OFFLINE { color: var(--red); }
.flow-IDLE { color: var(--blue); }
.flow-UNKNOWN,
.flow-DISABLED { color: var(--muted); }

#flows-panel .status {
    background: #263449;
    white-space: nowrap;
}

.flows-toolbar input,
.flows-toolbar select {
    background: #172235;
    color: inherit;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 10px;
}

#flows-search {
    flex: 1;
    min-width: 200px;
}

#flows-table td {
    vertical-align: middle;
}

@media (max-width: 1100px) {
    .flows-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 550px) {
    .flows-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* GoldTV v1.8 - Anagrafica clienti */

#flows-panel [hidden] {
    display: none !important;
}

#fc-search {
    flex: 1;
    min-width: 200px;
}

#fc-dialog {
    width: min(620px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
}

#fc-dialog textarea {
    width: 100%;
    box-sizing: border-box;
    background: #172235;
    color: inherit;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 10px;
    font: inherit;
    resize: vertical;
}

#fc-table td {
    vertical-align: middle;
}


/* GoldTV v1.8 - Configurazione flussi */

#fs-search {
    flex: 1;
    min-width: 220px;
}

#fs-dialog {
    width: min(1050px, 94vw);
    max-height: 92vh;
    overflow-y: auto;
}

.fs-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 15px 0;
}

.fs-form-grid fieldset {
    min-width: 0;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 14px;
}

.fs-form-grid legend {
    color: var(--blue);
    padding: 0 8px;
    font-weight: bold;
}

#fs-dialog label {
    display: block;
    margin: 10px 0 5px;
    font-size: 12px;
    color: var(--muted);
}

#fs-dialog input,
#fs-dialog select,
#fs-dialog textarea,
#fs-action-dialog textarea {
    width: 100%;
    box-sizing: border-box;
    background: #172235;
    color: inherit;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 10px;
    font: inherit;
}

#fs-dialog input:disabled,
#fs-dialog select:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.fs-row-actions button {
    margin: 3px;
}

#flows-services h3 {
    margin-top: 22px;
}

#fs-requests td {
    overflow-wrap: anywhere;
    max-width: 400px;
}

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


/* Client Flow Statistics */

.fst-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

.fst-filters[hidden] {
    display: none !important;
}

.fst-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fst-cards {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.fst-card,
.fst-panel {
    border: 1px solid rgba(128,128,128,.3);
    border-radius: 8px;
    padding: 16px;
}

.fst-card span {
    display: block;
    font-size: .85rem;
    opacity: .8;
}

.fst-card strong {
    display: block;
    font-size: 1.65rem;
    margin-top: 8px;
}

.fst-panel {
    margin: 16px 0;
}

.fst-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.fst-table-wrap {
    overflow-x: auto;
}

.fst-panel svg {
    display: block;
    width: 100%;
    height: auto;
}


#fst-state-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.fst-state-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .85rem;
}

.fst-state-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.fst-wan-row {
    margin: 14px 0;
}

.fst-wan-track {
    margin-top: 7px;
    height: 12px;
    border-radius: 5px;
    background: rgba(128,128,128,.2);
    overflow: hidden;
}

.fst-wan-bar {
    height: 100%;
    background: #38bdf8;
    border-radius: 5px;
}


/* Rifiniture Client Flow Statistics */

#flows-statistics button {
    padding: 9px 16px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    color: #e2e8f0;
    cursor: pointer;
    font-size: .85rem;
}

#flows-statistics button:hover:not(:disabled) {
    background: #334155;
    border-color: #38bdf8;
}

#flows-statistics button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

#fst-refresh {
    min-height: 36px;
}

.fst-chart-tooltip {
    padding: 10px 12px;
    margin: 8px 0;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: .85rem;
    line-height: 1.7;
}

.fst-chart-tooltip[hidden] {
    display: none;
}

#fst-bitrate-chart svg {
    max-height: 380px;
}



/* Software Creation branding v1.8.0a */

.sc-brand {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.sc-header-logo {
    display: block;
    width: 140px;
    max-width: 100%;
    height: auto;
    background: #ffffff;
    padding: 8px;
    border-radius: 8px;
}

.sc-login-logo {
    display: block;
    width: 220px;
    max-width: 85%;
    height: auto;
    margin: 0 auto 26px;
    background: #ffffff;
    padding: 12px;
    border-radius: 10px;
}

@media (max-width: 650px) {
    .sc-brand {
        gap: 12px;
    }

    .sc-header-logo {
        width: 95px;
    }

    .sc-brand h1 {
        font-size: 21px;
    }
}

/* Software Creation - Logo refinement */

.sc-header-logo {
    width: 90px;
    background: transparent;
    padding: 0;
    border-radius: 10px;
    flex-shrink: 0;
}

.sc-login-logo {
    width: 150px;
    background: transparent;
    padding: 0;
    border-radius: 12px;
}

.sc-brand {
    gap: 16px;
}

@media (max-width: 650px) {
    .sc-header-logo {
        width: 65px;
    }
}
