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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #21262d;
    gap: 12px;
}

.header h1 {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 600;
    white-space: nowrap;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    color: #58a6ff;
}

.stat-value.active { color: #3fb950; }
.stat-value.inactive { color: #f85149; }
.stat-value.highlight { color: #d2a8ff; }

.table-container {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: #8b949e;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #21262d;
    background: #0d1117;
    white-space: nowrap;
}

tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #21262d;
    font-size: 13px;
}

tbody tr:hover {
    background: #1c2128;
}

.empty {
    text-align: center;
    color: #8b949e;
    padding: 40px !important;
    font-style: italic;
}

code {
    background: #21262d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-online { background: #1b3525; color: #3fb950; }
.badge-offline { background: #351b1b; color: #f85149; }
.badge.warning { background: #352d1b; color: #d29922; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #30363d;
    background: #21262d;
    color: #c9d1d9;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn:hover { background: #30363d; }
.btn-primary { background: #238636; border-color: #238636; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.danger:hover { background: #da3633; border-color: #da3633; color: #fff; }

.actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.muted { color: #484f58; }

.form {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 20px;
}

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

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #8b949e;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #0d1117;
    color: #e1e4e8;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #58a6ff;
}

.porta-auto {
    font-weight: 700 !important;
    color: #d2a8ff !important;
}

.form-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #21262d;
}

.form-actions .btn {
    padding: 12px 24px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
}

.alert {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    word-break: break-word;
}

.alert-error {
    background: #351b1b;
    border: 1px solid #da3633;
    color: #fda4af;
}

.alert-success {
    background: #1b3525;
    border: 1px solid #238636;
    color: #86e8a7;
}

.alert a { color: #58a6ff; margin-left: 8px; }

.info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 12px;
}

.info-bar span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.disk-cell { min-width: 110px; }
.disk-bar-container {
    position: relative;
    width: 100px;
    height: 18px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    overflow: hidden;
}
.disk-bar {
    height: 100%;
    background: #238636;
    border-radius: 3px;
    transition: width 0.5s;
    min-width: 0;
}
.disk-bar-container .disk-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
    color: #e1e4e8;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 26px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #238636, #2ea043);
    border-radius: 5px;
    transition: width 0.5s;
    min-width: 0;
}
.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #e1e4e8;
}

.upload-area { padding: 0 !important; border: none !important; background: none !important; }
.upload-form { display: flex; flex-direction: column; align-items: center; }
.upload-dropzone {
    width: 100%;
    padding: 30px 20px;
    text-align: center;
    border: 2px dashed #30363d;
    border-radius: 8px;
    background: #0d1117;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}
.upload-dropzone:hover {
    border-color: #58a6ff;
    background: #161b22;
}
.upload-dropzone p { font-size: 14px; margin: 4px 0; }
.upload-dropzone .muted { font-size: 12px; }

@media (max-width: 900px) {
    .container { padding: 12px; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 12px; }
    .form { padding: 16px; }
    .form-grid { gap: 12px; }
}

@media (max-width: 768px) {
    .header { flex-direction: column; text-align: center; }
    .header h1 { white-space: normal; }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .container { padding: 8px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 6px; }
    .stat-card { padding: 10px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 10px; }

    table { min-width: 550px; }
    thead th, tbody td { padding: 8px 10px; font-size: 12px; }
    .btn.small { padding: 3px 6px; font-size: 11px; }
    .actions { gap: 3px; }

    .form { padding: 12px; }
    .form-group input,
    .form-group select,
    .form-group textarea { font-size: 16px; padding: 12px; }
    .info-bar { flex-direction: column; gap: 6px; font-size: 11px; }
    .upload-dropzone { padding: 20px 12px; }
    .upload-dropzone p { font-size: 13px; }
}

@media (max-width: 400px) {
    .stats { grid-template-columns: 1fr; }
    .disk-bar-container { width: 80px; }
}
