/* ==========================================================================
   Settings page + sidebar version + theme toggle button
   ========================================================================== */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.settings-body {
    padding: 18px;
    display: grid;
    gap: 20px;
}

.setting-title {
    font-size: 13px;
    font-weight: 600;
}

.setting-hint {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

/* Theme picker */
.theme-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.theme-card {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 8px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.theme-card:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.theme-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-card:focus-within {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .25);
}

.theme-card.selected {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}

.theme-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12px;
}

.theme-label .ico {
    width: 14px;
    height: 14px;
}

.theme-preview {
    height: 64px;
    border-radius: 9px;
    padding: 8px;
    display: grid;
    grid-template-columns: 22% 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 5px;
    border: 1px solid rgba(100, 116, 139, .25);
}

.theme-preview i {
    border-radius: 4px;
    display: block;
}

.theme-preview i:first-child {
    grid-row: 1 / 3;
}

.preview-light { background: #eef2f7; }
.preview-light i:first-child { background: #0b1220; }
.preview-light i:not(:first-child) { background: #fff; }

.preview-dark { background: #0b1220; }
.preview-dark i:first-child { background: #070c16; }
.preview-dark i:not(:first-child) { background: #1a2740; }

.preview-system {
    position: relative;
    overflow: hidden;
    background: #eef2f7;
}
.preview-system i:first-child { background: #0b1220; }
.preview-system i:not(:first-child) { background: #fff; }
.preview-system::after {
    content: "";
    position: absolute;
    inset: 0 0 0 50%;
    background:
        linear-gradient(#1a2740, #1a2740) 0 8px / calc(100% - 8px) 21px no-repeat,
        linear-gradient(#1a2740, #1a2740) 0 34px / calc(100% - 8px) 21px no-repeat,
        #0b1220;
}

/* Switch */
.switch {
    position: relative;
    flex: none;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.switch-track {
    display: block;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: var(--line-strong);
    transition: background .2s ease;
}

.switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s ease;
}

.switch input:checked + .switch-track {
    background: var(--orange);
}

.switch input:checked + .switch-track .switch-thumb {
    transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .3);
}

/* About */
.about-hero {
    display: flex;
    align-items: center;
    gap: 14px;
}

.about-hero > div:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.about-hero strong {
    font-size: 17px;
    letter-spacing: -.01em;
}

.about-hero p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.about-mark {
    width: 64px;
    height: 64px;
    flex: none;
    background: transparent;
    display: grid;
    place-items: center;
}

.version-badge {
    flex: none;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
}

.about-list {
    margin: 0;
    display: grid;
}

.about-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-top: 1px solid var(--line-soft);
}

.about-list dt {
    color: var(--muted);
}

.about-list dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

/* Sidebar version link + login version */
.sidebar-version {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: #64748b;
    font-size: 11px;
    text-decoration: none;
    letter-spacing: .04em;
    transition: color .2s ease;
}

.sidebar-version:hover {
    color: #cbd5e1;
}

.login-version {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px;
}

@media (max-width: 1100px) {
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
    .theme-options { grid-template-columns: 1fr; }
    .about-hero { flex-wrap: wrap; }
}

/* Navigation layout previews */
.setting-divider {
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.nav-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-tabs,
.preview-sidebar {
    background: #17191e;
}

.preview-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-tabs i:first-child {
    grid-row: auto;
    height: 12px;
    width: 72%;
    border-radius: 999px;
    background: #353942;
}

.preview-tabs i:nth-child(2) {
    flex: 1;
    background: #23262d;
}

.preview-sidebar i:first-child {
    background: #08090b;
}

.preview-sidebar i:nth-child(2) {
    grid-row: 1 / 3;
    background: #23262d;
}

/* Admin accounts */
.settings-grid .accounts-panel {
    grid-column: 1 / -1;
}

.table-wrap {
    overflow-x: auto;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.accounts-table th {
    padding: 12px 18px;
    text-align: left;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.accounts-table td {
    padding: 14px 18px;
    border-top: 1px solid var(--line-soft);
    vertical-align: middle;
}

.accounts-table td strong {
    display: block;
    font-weight: 600;
}

.accounts-table td > strong:first-child {
    display: inline;
}

.accounts-table td small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.accounts-table code {
    padding: 3px 9px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.accounts-table tr.is-you {
    background: var(--tint-green);
}

.you-badge {
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

@media (max-width: 700px) {
    .accounts-table thead { display: none; }
    .accounts-table, .accounts-table tbody, .accounts-table tr, .accounts-table td { display: block; }
    .accounts-table tr { padding: 10px 0; border-top: 1px solid var(--line-soft); }
    .accounts-table td { border: 0; padding: 6px 18px; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
    .accounts-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
}
