* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 30px;
    font-family: Arial, sans-serif;
    background: #0f172a;
    color: white;
}

.container {
    max-width: 1600px;
    margin: auto;
}


/* ==========================================
   Header
========================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

h1 {
    margin: 0 0 8px;
    color: #38bdf8;
}

h2 {
    margin: 0 0 7px;
    font-size: 18px;
}

p {
    margin: 0;
    color: #94a3b8;
}

.refresh-status {
    padding: 8px 12px;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 13px;
}


/* ==========================================
   Egress Config
========================================== */

.config-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
    padding: 20px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
}

.egress-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    color: #94a3b8;
    font-size: 12px;
}

.form-group select {
    min-width: 160px;
    padding: 9px 10px;
    border: 1px solid #475569;
    border-radius: 5px;
    background: #0f172a;
    color: white;
}

.form-group select:disabled {
    opacity: 0.5;
}


/* ==========================================
   Table
========================================== */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #334155;
    border-radius: 8px;
}

table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
    background: #1e293b;
}

th,
td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
}

th {
    background: #111827;
    color: #94a3b8;
    font-size: 13px;
}

tbody tr:hover {
    background: #263449;
}

.center {
    text-align: center;
}

.muted {
    color: #64748b;
}

.error-text {
    color: #f87171;
}


/* ==========================================
   Status
========================================== */

.status,
.internet {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.status-ready {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-restarting {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

.status-down {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.internet-up {
    color: #4ade80;
}

.internet-down {
    color: #f87171;
}


/* ==========================================
   Buttons
========================================== */

.actions {
    display: flex;
    gap: 7px;
}

.btn {
    border: none;
    border-radius: 5px;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: bold;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-rename {
    background: #334155;
    color: white;
}

.btn-rename:hover {
    background: #475569;
}

.btn-restart {
    background: #dc2626;
    color: white;
}

.btn-restart:hover:not(:disabled) {
    background: #ef4444;
}

.btn-save {
    background: #0284c7;
    color: white;
}

.btn-save:hover:not(:disabled) {
    background: #0ea5e9;
}


/* ==========================================
   Auto Restart
========================================== */

.auto-restart {
    display: flex;
    align-items: center;
    gap: 8px;
}

.interval-input {
    width: 65px;
    padding: 7px;
    border: 1px solid #475569;
    border-radius: 5px;
    background: #0f172a;
    color: white;
}

.interval-input:disabled {
    opacity: 0.5;
}


/* ==========================================
   Toggle Switch
========================================== */

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #475569;
    border-radius: 22px;
    transition: 0.2s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked+.slider {
    background: #0284c7;
}

.switch input:checked+.slider::before {
    transform: translateX(18px);
}


/* ==========================================
   Message
========================================== */

.message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
}

.message.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}


/* ==========================================
   Mobile
========================================== */

@media (max-width: 900px) {
    body {
        padding: 15px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .config-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .egress-form {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .form-group select {
        width: 100%;
    }
}