:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-color: #c9d1d9;
    --primary-color: #58a6ff;
    --danger-color: #f85149;
    --border-color: #30363d;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0; padding: 20px;
}
.container { max-width: 900px; margin: 0 auto; }
h1 { color: #fff; text-align: center; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; border: 1px solid var(--border-color); text-align: left; }
th { background: #21262d; }
button {
    background: var(--primary-color);
    color: #fff; border: none; padding: 6px 12px; border-radius: 4px;
    cursor: pointer; font-weight: bold;
}
button.danger { background: var(--danger-color); }
button:not(:last-child) { margin-right: 8px; }
.badge {
    display: inline-block; background: #238636; color: #fff;
    padding: 2px 6px; border-radius: 12px; font-size: 12px; margin: 2px;
}
.badge.star { background: var(--danger-color); font-weight: bold; }

#modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); align-items: center; justify-content: center;
}
.modal-content {
    background: var(--card-bg); padding: 20px; border-radius: 8px; width: 400px;
    border: 1px solid var(--border-color);
}
.form-group { margin-bottom: 12px; }
input[type="text"] {
    width: 100%; padding: 8px; background: #010409; color: #fff;
    border: 1px solid var(--border-color); border-radius: 4px; box-sizing: border-box;
}

/* Dynamic Toggle & Safe Styling */
.hidden { display: none !important; }
.flex { display: flex !important; }
.btn-muted { background: var(--border-color) !important; }
.btn-success { background: #238636 !important; margin-bottom: 1rem; }
.tabs { margin-bottom: 1rem; }
.tab-active { background: var(--primary-color) !important; margin-right: 0.5rem; }
.tab-inactive { background: var(--border-color) !important; margin-right: 0.5rem; }

.modal-backdrop {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-backdrop.flex { display: flex !important; }

.form-group.spaced { margin-top: 1rem; }
.form-group.spaced.bottom { margin-bottom: 1.5rem; }
.form-label { display: block; }
.form-input { width: 100%; padding: 0.5rem; margin-top: 0.3rem; box-sizing: border-box; }

.redirect-uri-cell {
    word-break: break-all;
    font-size: 0.9em;
}

.protected-admin-label {
    color: var(--text-muted);
    font-style: italic;
}
