/* =============================================================
   settings.css — Full Settings Page
   Extends the existing dark-glass design language.
   ============================================================= */

/* ── Page layout ── */
.settings-page {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.5rem 0 2.5rem;
}

/* ── Left sidenav ── */
.settings-sidenav {
    width: 210px;
    flex-shrink: 0;
    position: sticky;
    top: 1.5rem;
}

.settings-sidenav nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: rgba(255 255 255 / .04);
    border: 1px solid rgba(255 255 255 / .08);
    border-radius: 16px;
    padding: 0.6rem;
}

.settings-navlink {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    color: rgba(255 255 255 / .6);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.18s, color 0.18s;
}

.settings-navlink i {
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.18s;
}

.settings-navlink:hover {
    background: rgba(255 255 255 / .07);
    color: #fff;
}

.settings-navlink:hover i {
    opacity: 1;
}

.settings-navlink.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, .25), rgba(139, 92, 246, .2));
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, .3);
}

.settings-navlink.active i {
    opacity: 1;
}

/* ── Panels area ── */
.settings-panels {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── Section visibility ── */
.settings-section {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeInUp 0.25s ease both;
}

.settings-section.active {
    display: flex;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Section header ── */
.section-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 0.25rem;
}

.section-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, .3), rgba(139, 92, 246, .2));
    border: 1px solid rgba(139, 92, 246, .3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #a78bfa;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    color: #fff;
}

.section-header p {
    font-size: 0.83rem;
    color: rgba(255 255 255 / .5);
    margin: 0;
}

/* ── Cards ── */
.settings-card {
    background: rgba(255 255 255 / .04);
    border: 1px solid rgba(255 255 255 / .09);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255 255 255 / .85);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-title i {
    color: #a78bfa;
}

/* ── Generic row ── */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.setting-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255 255 255 / .9);
}

.setting-label i {
    color: #a78bfa;
    margin-right: 0.25rem;
}

.setting-desc {
    font-size: 0.8rem;
    color: rgba(255 255 255 / .45);
    line-height: 1.4;
}

.setting-divider {
    border-top: 1px solid rgba(255 255 255 / .07);
}

/* ── Toggle switch ── */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    width: 44px;
    height: 24px;
    background: rgba(255 255 255 / .15);
    border-radius: 24px;
    border: 1px solid rgba(255 255 255 / .1);
    position: relative;
    transition: background 0.22s, border-color 0.22s;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.22s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.toggle-switch input:checked+.toggle-track {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #7c3aed;
}

.toggle-switch input:checked+.toggle-track .toggle-thumb {
    transform: translateX(20px);
}

/* ── Theme picker ── */
.theme-picker {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255 255 255 / .12);
    background: rgba(255 255 255 / .05);
    color: rgba(255 255 255 / .6);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.theme-btn:hover {
    background: rgba(255 255 255 / .1);
    color: #fff;
}

.theme-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, .35), rgba(139, 92, 246, .25));
    border-color: #7c3aed;
    color: #a78bfa;
}

/* ── Font size control & slider ── */
.font-size-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 220px;
}

.font-size-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.fs-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.18s;
}

.fs-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.fs-btn:active {
    transform: scale(.92);
}

.fs-value {
    min-width: 48px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-primary, #a78bfa);
    padding: 0.2rem 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fs-slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

.fs-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    transition: background 0.2s;
    cursor: pointer;
}

.fs-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary, #6366f1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    border: 2px solid #ffffff;
    transition: transform 0.15s, background-color 0.15s;
}

.fs-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.fs-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary, #6366f1);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    cursor: pointer;
}

.fs-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'JetBrains Mono', monospace;
}

/* ── Sleek Code Token Capsules (Syntax Color Pattern) ── */
.color-capsule-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-capsule {
    width: 32px;
    height: 18px;
    border-radius: 6px;
    /* Horizontal rounded token capsule */
    background: var(--cap-color);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.16s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.16s ease, border-color 0.16s ease;
    position: relative;
    padding: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3);
    user-select: none;
    overflow: hidden;
}

/* Glass highlight sheen across top half */
.color-capsule .capsule-sheen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 5px 5px 0 0;
    pointer-events: none;
}

.color-capsule:hover {
    transform: translateY(-1.5px) scale(1.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 10px var(--cap-color), 0 3px 6px rgba(0, 0, 0, 0.4);
}

.color-capsule i.bi-check2 {
    font-size: 0.82rem;
    font-weight: 900;
    color: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.color-capsule.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 1.5px #ffffff, 0 0 12px var(--cap-color), 0 3px 6px rgba(0, 0, 0, 0.5);
    transform: scale(1.05);
}

.color-capsule.active i.bi-check2 {
    opacity: 1;
    transform: scale(1);
}

/* Custom color picker capsule with eyedropper */
.color-capsule-custom {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px dashed rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.75);
    box-shadow: none;
}

.color-capsule-custom:hover {
    border-color: #ffffff;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1.5px) scale(1.08);
}

.color-capsule-custom i.bi-eyedropper {
    font-size: 0.76rem;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.color-capsule-custom input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.btn-reset-color {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    transition: color 0.18s, background 0.18s;
}

.btn-reset-color:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* ── Syntax Pattern Section (Keywords, Tables, Columns) ── */
.syntax-pattern-section {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0;
}

.syntax-color-row {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
}

.syntax-row-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.syntax-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    line-height: 1.2;
}

.syntax-badge-kw {
    background: rgba(0, 229, 255, 0.12);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.25);
}

.syntax-badge-table {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.syntax-badge-col {
    background: rgba(241, 245, 249, 0.12);
    color: #f1f5f9;
    border: 1px solid rgba(241, 245, 249, 0.2);
}

.syntax-hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

.syntax-hint code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.78rem;
}

/* ── Live SQL Editor Preview Card ── */
.setting-row-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preview-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sql-preview-card {
    background: #060b14;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: background-color 0.2s, border-color 0.2s;
}

.preview-header {
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.preview-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.preview-dots .dot.red {
    background: #ef4444;
}

.preview-dots .dot.yellow {
    background: #eab308;
}

.preview-dots .dot.green {
    background: #22c55e;
}

.preview-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.preview-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--accent-primary, #a78bfa);
    font-weight: 600;
}

.preview-body {
    display: flex;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--editor-font-size, 14px);
    line-height: 1.6;
    padding: 0.85rem 0;
    transition: font-size 0.15s ease;
}

.preview-gutter {
    width: 44px;
    text-align: right;
    padding-right: 12px;
    color: rgba(255, 255, 255, 0.25);
    user-select: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
}

.preview-gutter span {
    display: block;
}

.preview-code {
    margin: 0;
    padding: 0 0 0 14px;
    overflow-x: auto;
    color: #e2e8f0;
    flex: 1;
    background: transparent;
}

.preview-code code {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    background: transparent;
    padding: 0;
}

.preview-pattern-legend {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-pip-kw {
    background-color: var(--sql-keyword, #00e5ff);
}

.legend-pip-table {
    background-color: var(--sql-table, #4ade80);
}

.legend-pip-col {
    background-color: var(--sql-column, #f1f5f9);
}

.preview-kw {
    color: var(--sql-keyword-custom, var(--sql-keyword, #00e5ff));
    font-weight: 600;
    transition: color 0.18s;
}

.preview-table {
    color: var(--sql-table-custom, var(--sql-table, #4ade80));
    font-weight: 600;
    transition: color 0.18s;
}

.preview-col {
    color: var(--sql-column-custom, var(--sql-column, #f1f5f9));
    transition: color 0.18s;
}

.preview-str {
    color: #fde047;
}

/* ── Difficulty select ── */
.settings-select {
    background: rgba(255 255 255 / .07);
    border: 1px solid rgba(255 255 255 / .14);
    border-radius: 10px;
    color: #fff;
    padding: 0.5rem 2.2rem 0.5rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 14px;
    transition: border-color 0.18s;
    flex-shrink: 0;
}

.settings-select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
}

.settings-select option {
    background: #1a1230;
}

/* ── Fields grid ── */
.fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field-group-full {
    grid-column: 1 / -1;
}

.field-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255 255 255 / .65);
    letter-spacing: 0.02em;
}

.field-group input {
    background: rgba(255 255 255 / .06);
    border: 1px solid rgba(255 255 255 / .12);
    border-radius: 10px;
    color: #fff;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    transition: border-color 0.18s, box-shadow 0.18s;
    width: 100%;
}

.field-group input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .2);
}

.field-group input::placeholder {
    color: rgba(255 255 255 / .25);
}

.help-text {
    font-size: 0.75rem;
    color: rgba(255 255 255 / .35);
    margin: 0;
}

.field-error {
    font-size: 0.78rem;
    color: #f87171;
    margin: 0;
}

/* ── Password input ── */
.password-input-wrap {
    position: relative;
    display: flex;
}

.password-input-wrap input {
    padding-right: 2.8rem;
}

.pwd-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255 255 255 / .4);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.18s;
    font-size: 1rem;
    line-height: 1;
}

.pwd-toggle:hover {
    color: rgba(255 255 255 / .8);
}

/* ── Password rules ── */
.pwd-rules {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255 255 255 / .4);
}

.pwd-rules li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.pwd-rules li.valid {
    color: #34d399;
}

.pwd-rules li.valid i::before {
    content: "\f26b";
    /* bi-check-circle-fill */
}

/* ── Card footer actions ── */
.card-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

/* ── Photo row ── */
.photo-row {
    flex-direction: row !important;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.photo-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(139, 92, 246, .4);
}

.avatar-initials {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    user-select: none;
}

.photo-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
}

.photo-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.photo-username {
    margin: 0;
}

.photo-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

/* ── Buttons ── */
.btn-settings {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7577f3, #9d6ff8);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .5);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: rgba(255 255 255 / .08);
    border: 1px solid rgba(255 255 255 / .14);
    color: rgba(255 255 255 / .8);
}

.btn-secondary:hover {
    background: rgba(255 255 255 / .14);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, .3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 6px 20px rgba(220, 38, 38, .45);
    transform: translateY(-1px);
    color: #fff;
}

.btn-danger-outline {
    background: rgba(220, 38, 38, .1);
    border: 1px solid rgba(220, 38, 38, .35);
    color: #f87171;
}

.btn-danger-outline:hover {
    background: rgba(220, 38, 38, .2);
    border-color: #ef4444;
    color: #fca5a5;
}

.btn-text-link {
    background: none;
    border: none;
    color: rgba(255 255 255 / .45);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    transition: color 0.18s;
}

.btn-text-link:hover {
    color: rgba(255 255 255 / .8);
}

/* ── Feedback ── */
.feedback-msg {
    font-size: 0.82rem;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    margin: 0;
}

.feedback-msg.success {
    background: rgba(52, 211, 153, .12);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, .25);
}

.feedback-msg.error {
    background: rgba(248, 113, 113, .12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, .25);
}

/* ── Danger zone ── */
.danger-zone {
    border-color: rgba(220, 38, 38, .25) !important;
    background: rgba(220, 38, 38, .04) !important;
}

.danger-zone-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #f87171;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.setting-row-danger .setting-label {
    color: rgba(255 255 255 / .85);
}

/* ── Confirmation modal ── */
#confirmModal .modal-content {
    background: rgba(18, 12, 36, .92);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255 255 255 / .1);
}

#confirmModal .modal-title {
    color: #fff;
    font-weight: 700;
}

#confirmModal .modal-body {
    color: rgba(255 255 255 / .65);
    font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .settings-page {
        flex-direction: column;
    }

    .settings-sidenav {
        width: 100%;
        position: static;
    }

    .settings-sidenav nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .settings-navlink span {
        display: none;
    }

    .settings-navlink {
        padding: 0.55rem 0.75rem;
        justify-content: center;
    }

    .settings-navlink i {
        opacity: 1;
        font-size: 1.1rem;
    }
}

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

    .field-group-full {
        grid-column: 1;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .theme-picker {
        flex-wrap: wrap;
    }
}

/* =============================================================
   LIGHT THEME OVERRIDES FOR SETTINGS (data-bs-theme="light")
   ============================================================= */
html[data-bs-theme="light"] .settings-sidenav nav {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

html[data-bs-theme="light"] .settings-navlink {
    color: #475569;
}

html[data-bs-theme="light"] .settings-navlink:hover {
    background: #f1f5f9;
    color: #0f172a;
}

html[data-bs-theme="light"] .settings-navlink.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    color: var(--accent-primary, #6366f1);
    border-color: rgba(99, 102, 241, 0.3);
}

html[data-bs-theme="light"] .section-header h2 {
    color: #0f172a;
}

html[data-bs-theme="light"] .section-header p {
    color: #64748b;
}

html[data-bs-theme="light"] .settings-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

html[data-bs-theme="light"] .card-title {
    color: #0f172a;
}

html[data-bs-theme="light"] .setting-label {
    color: #0f172a;
}

html[data-bs-theme="light"] .setting-desc {
    color: #64748b;
}

html[data-bs-theme="light"] .setting-divider {
    border-top-color: rgba(0, 0, 0, 0.06);
}

html[data-bs-theme="light"] .theme-btn {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.1);
    color: #475569;
}

html[data-bs-theme="light"] .theme-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

html[data-bs-theme="light"] .theme-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(139, 92, 246, 0.14));
    border-color: var(--accent-primary, #6366f1);
    color: var(--accent-primary, #4f46e5);
}

html[data-bs-theme="light"] .fs-btn {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.12);
    color: #475569;
}

html[data-bs-theme="light"] .fs-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

html[data-bs-theme="light"] .fs-value {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.08);
}

html[data-bs-theme="light"] .fs-slider {
    background: #e2e8f0;
}

html[data-bs-theme="light"] .fs-slider-labels {
    color: #94a3b8;
}

html[data-bs-theme="light"] .settings-select {
    background-color: #f8fafc;
    border-color: rgba(0, 0, 0, 0.12);
    color: #0f172a;
}

html[data-bs-theme="light"] .settings-select option {
    background: #ffffff;
    color: #0f172a;
}

html[data-bs-theme="light"] .toggle-track {
    background: #cbd5e1;
    border-color: rgba(0, 0, 0, 0.1);
}

html[data-bs-theme="light"] .toggle-switch input:checked+.toggle-track {
    background: var(--accent-primary, #6366f1);
}

html[data-bs-theme="light"] .sql-preview-card {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

html[data-bs-theme="light"] .preview-header {
    background: #f1f5f9;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

html[data-bs-theme="light"] .preview-filename {
    color: #64748b;
}

html[data-bs-theme="light"] .preview-gutter {
    color: #94a3b8;
    border-right-color: rgba(0, 0, 0, 0.08);
}

html[data-bs-theme="light"] .preview-code {
    color: #1e293b;
}

html[data-bs-theme="light"] .preview-str {
    color: #d97706;
}

html[data-bs-theme="light"] .color-swatch-custom {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.2);
    color: #64748b;
}

html[data-bs-theme="light"] .color-swatch-custom:hover {
    border-color: #0f172a;
    color: #0f172a;
}

html[data-bs-theme="light"] .btn-reset-color {
    color: #64748b;
}

html[data-bs-theme="light"] .btn-reset-color:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

html[data-bs-theme="light"] #confirmModal .modal-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

html[data-bs-theme="light"] #confirmModal .modal-title {
    color: #0f172a;
}

html[data-bs-theme="light"] #confirmModal .modal-body {
    color: #475569;
}

html[data-bs-theme="light"] #confirmModal .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(20%) !important;
}

html[data-bs-theme="light"] .setting-desc code {
    background: #e2e8f0;
    color: #0f172a;
}

html[data-bs-theme="light"] .setting-row-danger .setting-desc strong {
    color: #0f172a;
}

html[data-bs-theme="light"] .btn-secondary {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.12);
    color: #334155;
}

html[data-bs-theme="light"] .btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

html[data-bs-theme="light"] .preview-code {
    color: #0f172a !important;
}

html[data-bs-theme="light"] .preview-code code {
    color: #0f172a !important;
}

html[data-bs-theme="light"] .preview-kw {
    color: var(--sql-keyword-custom, var(--sql-keyword, #0284c7));
}

html[data-bs-theme="light"] .color-capsule {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
}

html[data-bs-theme="light"] .color-capsule.active {
    border-color: #0f172a;
    box-shadow: 0 0 0 1.5px #0f172a, 0 0 10px var(--cap-color), 0 2px 6px rgba(0, 0, 0, 0.2);
}

html[data-bs-theme="light"] .color-capsule-custom {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.28);
    color: #334155;
    box-shadow: none;
}

html[data-bs-theme="light"] .color-capsule-custom:hover {
    border-color: #0f172a;
    color: #0f172a;
    background: #e2e8f0;
}

html[data-bs-theme="light"] .syntax-color-row {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.08);
}

html[data-bs-theme="light"] .syntax-hint {
    color: #64748b;
}

html[data-bs-theme="light"] .syntax-hint code {
    background: #e2e8f0;
    color: #0f172a;
}

html[data-bs-theme="light"] .syntax-badge-col {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.15);
}

html[data-bs-theme="light"] .preview-pattern-legend {
    color: #64748b;
}

html[data-bs-theme="light"] .preview-col {
    color: var(--sql-column-custom, var(--sql-column, #1e293b));
}