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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    padding: 20px;
    line-height: 1.6;
}

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

h1 {
    color: #58a6ff;
    margin-bottom: 30px;
    font-size: 2em;
}

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

.logout-btn {
    padding: 8px 16px;
    background: #da3633;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    text-decoration: none;
}

.logout-btn:hover {
    background: #f85149;
}

h2 {
    color: #58a6ff;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.nav {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav a {
    color: #58a6ff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav a:hover {
    background: #0d1117;
}

.nav a.active {
    background: #0d1117;
    font-weight: 600;
}

.config-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

input[type="text"], select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #58a6ff;
}

select {
    cursor: pointer;
}

select option {
    background: #0d1117;
    color: #c9d1d9;
}

button {
    padding: 8px 16px;
    background: #238636;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover {
    background: #2ea043;
}

button:disabled {
    background: #21262d;
    color: #8b949e;
    cursor: not-allowed;
}

.test-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.test-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}

.test-card:hover {
    border-color: #58a6ff;
    background: #1c2128;
}

.test-card h3 {
    color: #58a6ff;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.test-card p {
    color: #8b949e;
    font-size: 0.9em;
}

.form-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    color: #c9d1d9;
    font-size: 14px;
    font-weight: 500;
}

.field-description {
    color: #8b949e;
    font-size: 12px;
    margin-bottom: 5px;
}

.field-error {
    color: #f85149;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.field-error.visible {
    display: block;
}

input[type="text"].error {
    border-color: #f85149;
}

.output-section {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.output-section h3 {
    color: #58a6ff;
    margin-bottom: 10px;
}

.output-area {
    background: #010409;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #c9d1d9;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.status.connected {
    background: #238636;
    color: white;
}

.status.disconnected {
    background: #da3633;
    color: white;
}

.error {
    background: #da3633;
    color: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.hidden {
    display: none;
}

.log-line {
    margin-bottom: 5px;
}

.log-line.out {
    color: #58a6ff;
}

.log-line.err {
    color: #f85149;
}

.log-line.mon {
    color: #a371f7;
}

.bandwidth-monitor {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.bandwidth-monitor h3 {
    color: #58a6ff;
    margin-bottom: 15px;
}

.bandwidth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.bandwidth-stat {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
}

.bandwidth-stat .label {
    color: #8b949e;
    font-size: 12px;
    margin-bottom: 5px;
}

.bandwidth-stat .value {
    color: #58a6ff;
    font-size: 24px;
    font-weight: 600;
}

.bandwidth-stat .unit {
    color: #8b949e;
    font-size: 14px;
    margin-left: 5px;
}

.bandwidth-stat.rx .value {
    color: #3fb950;
}

.bandwidth-stat.tx .value {
    color: #f85149;
}

.ip-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.ip-section h3 {
    color: #58a6ff;
    margin-bottom: 15px;
}

.ip-category {
    margin-bottom: 20px;
}

.ip-category h4 {
    color: #8b949e;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
}

.ip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.ip-item {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ip-item .ip-address {
    color: #58a6ff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.ip-item .ip-index {
    color: #8b949e;
    font-size: 12px;
}

.load-ips-btn {
    background: #1f6feb;
    margin-left: 10px;
}

.load-ips-btn:hover {
    background: #388bfd;
}

.logs-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.logs-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #c9d1d9;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-item {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.log-item:hover {
    border-color: #58a6ff;
    background: #161b22;
}

.log-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.log-item-name {
    color: #58a6ff;
    font-weight: bold;
    font-size: 14px;
}

.log-item-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.log-item-status.success {
    background: #238636;
    color: #fff;
}

.log-item-status.failed {
    background: #da3633;
    color: #fff;
}

.log-item-status.running {
    background: #bf8700;
    color: #fff;
}

.log-item-times {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #8b949e;
}

.log-item-time {
    display: flex;
    gap: 5px;
}

.log-item-time-label {
    font-weight: bold;
}

.log-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #30363d;
    display: none;
}

.log-details.visible {
    display: block;
}

.log-details-content {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #c9d1d9;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.no-logs {
    text-align: center;
    padding: 40px;
    color: #8b949e;
}

.bandwidth-graph {
    width: 100%;
    height: 400px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-top: 15px;
}

.graph-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}
