/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
    --bg: #13161c;
    --surface: #181c23;
    --surface-2: #1e232c;
    --line: #272d38;
    --line-strong: #353d4b;
    --text: #e4e8ee;
    --text-dim: #98a1b0;
    --text-faint: #6b7483;
    --accent: #8aa4ff;
    --ok: #3fb950;
    --warn: #d4a72c;
    --bad: #f85149;

    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::selection { background: rgba(138, 164, 255, .28); }

.mono { font-family: var(--mono); font-size: 0.8rem; }

/* ==========================================================================
   Public page
   ========================================================================== */
.public-body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 60% 38% at 50% 0%, rgba(138, 164, 255, .10), transparent 72%),
        #090b0f;
    overflow-x: hidden;
}

/* fine grid that fades out away from the top */
.public-body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 55% 45% at 50% 0%, #000, transparent 78%);
            mask-image: radial-gradient(ellipse 55% 45% at 50% 0%, #000, transparent 78%);
}

.center-stage {
    position: relative;
    flex: 1;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: clamp(72px, 17vh, 170px) 20px 56px;
}

/* ---- Header ------------------------------------------------------------ */
.identity-block {
    margin-bottom: 40px;
    text-align: center;
}

.identity-block h1 {
    margin: 0 0 12px;
    font-size: clamp(2.3rem, 8vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1.05;
    color: #fff;
}

.identity-block h1:empty { display: none; }

.identity-block p {
    margin: 0 auto;
    max-width: 52ch;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-faint);
}

.identity-block p:empty { display: none; }

.status-summary {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 22px;
    padding: 6px 14px 6px 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    background: rgba(15, 18, 24, .65);
    backdrop-filter: blur(8px);
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* ---- Status dots ------------------------------------------------------- */
.status-indicator {
    position: relative;
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-faint);
}

.status-indicator.is-online  { background: var(--ok);   box-shadow: 0 0 8px rgba(63, 185, 80, .55); }
.status-indicator.is-maint   { background: var(--warn); box-shadow: 0 0 8px rgba(212, 167, 44, .45); }
.status-indicator.is-offline { background: var(--bad);  box-shadow: 0 0 8px rgba(248, 81, 73, .45); }

.status-summary .status-indicator.is-online::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--ok);
    border-radius: 50%;
    animation: ping 2.8s ease-out infinite;
}

@keyframes ping {
    0%        { transform: scale(1);   opacity: .7; }
    70%, 100% { transform: scale(3.2); opacity: 0; }
}

/* ---- Link list --------------------------------------------------------- */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-node {
    --mx: 50%;
    --my: 50%;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 16px;
    overflow: hidden;
    background: rgba(15, 18, 24, .65);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    transition: transform .2s ease, background-color .2s ease;
    animation: node-in .55s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 70ms + 80ms);
}

@keyframes node-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.service-node::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    background: radial-gradient(280px circle at var(--mx) var(--my), rgba(138, 164, 255, .13), transparent 70%);
    transition: opacity .3s ease;
}

.service-node::after {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(200px circle at var(--mx) var(--my), rgba(138, 164, 255, .7), transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    transition: opacity .3s ease;
}

.service-node:hover,
.service-node:focus-visible {
    background: rgba(25, 30, 40, .78);
    transform: translateY(-2px);
    outline: none;
}

.service-node:hover::before,
.service-node:hover::after,
.service-node:focus-visible::before,
.service-node:focus-visible::after { opacity: 1; }

.service-node:active { transform: translateY(0); }

.node-tile {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    font-size: 1.02rem;
    font-weight: 600;
    color: #d3dae8;
}

.node-tile .status-indicator {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 11px;
    height: 11px;
    border: 2px solid #0e1116;
}

.node-tile.has-image { color: transparent; }

.node-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 11px;
}

.node-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.node-label {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #f1f4f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-domain {
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s ease;
}

.service-node:hover .node-domain { color: var(--text-dim); }

.service-node[data-status="offline"] .node-label { color: var(--text-dim); }

.node-meta {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.node-state {
    padding: 2px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: none;
    box-shadow: none;
    font-size: 0.72rem;
    font-weight: 500;
}

.node-state.is-maint   { color: var(--warn); background: rgba(212, 167, 44, .09);  border-color: rgba(212, 167, 44, .25); }
.node-state.is-offline { color: #ff7b74;     background: rgba(248, 81, 73, .09);   border-color: rgba(248, 81, 73, .25); }

.arrow-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    font-size: 0.92rem;
    color: var(--text-faint);
    transition: color .2s ease, border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.service-node:hover .arrow-icon,
.service-node:focus-visible .arrow-icon {
    color: var(--accent);
    border-color: rgba(138, 164, 255, .5);
    background: rgba(138, 164, 255, .1);
    transform: translate(1px, -1px);
}

.minimal-footer {
    position: relative;
    padding: 24px;
    text-align: center;
    font-size: 0.74rem;
    color: var(--text-faint);
}

.minimal-footer:empty { display: none; }

@media (max-width: 480px) {
    .service-node { padding: 14px; gap: 14px; }
    .node-tile { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .service-node { animation: none; }
    .status-summary .status-indicator::after { animation: none; display: none; }
}

/* ==========================================================================
   Shared controls
   ========================================================================== */
[hidden] { display: none !important; }

.admin-body {
    --bg: #0b0d12;
    --surface: #11141a;
    --surface-2: #171b22;
    --line: #1f2530;
    --line-strong: #2c3340;
    --text: #e6e9ef;
    --text-dim: #9aa3b2;
    --text-faint: #687181;
    min-height: 100vh;
    background: var(--bg);
}

.field { margin-bottom: 16px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dim);
}

.hint {
    margin: 6px 0 0;
    font-size: 0.76rem;
    color: var(--text-faint);
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 0.86rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder { color: var(--text-faint); }

input[type="text"]:hover,
input[type="password"]:hover,
select:hover { border-color: #3d4656; }

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(138, 164, 255, .16);
}

.invalid,
input.invalid {
    border-color: var(--bad) !important;
    box-shadow: 0 0 0 3px rgba(248, 81, 73, .14) !important;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23687181' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.input-affix { position: relative; }
.input-affix input { padding-right: 68px; }

.affix-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    height: 26px;
    padding: 0 9px;
    background: none;
    border: 0;
    border-radius: 4px;
    color: var(--text-faint);
    font: inherit;
    font-size: 0.76rem;
    cursor: pointer;
}

.affix-btn:hover { color: var(--text); background: var(--surface-2); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    background: var(--text);
    color: #0b0d12;
    border: 1px solid var(--text);
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}

.btn:hover { background: #fff; border-color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-outline:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: #414b5c;
}

.btn-danger {
    background: transparent;
    color: #ff7b74;
    border-color: rgba(248, 81, 73, .3);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(248, 81, 73, .1);
    border-color: rgba(248, 81, 73, .6);
}

.btn-solid-danger {
    background: #c93c37;
    border-color: #c93c37;
    color: #fff;
}

.btn-solid-danger:hover { background: #dc4640; border-color: #dc4640; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-faint);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.icon-btn.danger:hover { background: rgba(248, 81, 73, .1); color: var(--bad); }

/* Switch */
input.switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: none;
    width: 34px;
    height: 20px;
    margin: 0;
    background: var(--line-strong);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .15s ease;
}

input.switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
}

input.switch:checked { background: var(--accent); }
input.switch:checked::before { transform: translateX(14px); }

/* Status dot */
.dot {
    flex: none;
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-faint);
}

.dot.is-online  { background: var(--ok); }
.dot.is-maint   { background: var(--warn); }
.dot.is-offline { background: var(--bad); }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-click {
    color: var(--accent);
    background: rgba(138, 164, 255, .1);
    border-color: rgba(138, 164, 255, .25);
}

.badge-visit {
    color: var(--text-dim);
    background: rgba(154, 163, 178, .07);
    border-color: var(--line-strong);
}

/* ==========================================================================
   Login
   ========================================================================== */
.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(138, 164, 255, .08), transparent 70%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
}

.login-card h1 {
    margin: 18px 0 6px;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.login-sub {
    margin: 0 0 24px;
    font-size: 0.87rem;
    color: var(--text-dim);
}

.form-error {
    margin: 14px 0 0;
    padding: 9px 12px;
    background: rgba(248, 81, 73, .08);
    border: 1px solid rgba(248, 81, 73, .28);
    border-radius: 6px;
    color: #ff8b85;
    font-size: 0.82rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.brand-mark-lg { width: 42px; height: 42px; border-radius: 10px; font-size: 1.05rem; }

/* ==========================================================================
   Shell & Content (Admin Panel)
   ========================================================================== */
.shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    background: var(--surface);
    border-right: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 22px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 0.9rem; font-weight: 600; }
.brand-text small { font-size: 0.74rem; color: var(--text-faint); }

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 0.86rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.nav-btn svg { flex: none; }
.nav-btn:hover { background: rgba(255, 255, 255, .03); color: var(--text); }
.nav-btn.active { background: var(--surface-2); color: var(--text); }

.nav-count {
    margin-left: auto;
    padding: 1px 7px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.7rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}

.side-foot {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.side-link {
    display: block;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--text-faint);
    font-family: var(--sans);
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.side-link:hover { background: rgba(255, 255, 255, .03); color: var(--text); }

.content {
    padding: 32px 40px 96px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-head h2 {
    margin: 0 0 4px;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.page-head p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-dim);
}

.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-box {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-box span { font-size: 0.78rem; color: var(--text-dim); }
.stat-box strong { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.insights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.panel-card {
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 20px;
}

.panel-flush { padding: 0; overflow: hidden; }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-title { margin: 0 0 3px; font-size: 0.96rem; font-weight: 600; }
.panel-note { margin: 0; font-size: 0.8rem; color: var(--text-dim); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field-narrow { max-width: 360px; }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; flex-direction: column; gap: 5px; }
.bar-meta { display: flex; justify-content: space-between; font-size: 0.8rem; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-count { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.bar-track { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }

.chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    height: 140px;
    align-items: end;
    padding-top: 16px;
}

.chart-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; }
.chart-val { font-size: 0.72rem; color: var(--text-dim); height: 14px; }
.chart-track { flex: 1; width: 100%; max-width: 28px; display: flex; align-items: flex-end; background: var(--bg); border-radius: 5px; padding: 2px; }
.chart-bar { width: 100%; background: var(--accent); border-radius: 3px; }
.chart-bar.is-empty { background: var(--line-strong); }
.chart-day { font-size: 0.72rem; color: var(--text-faint); }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.search { position: relative; flex: 1; max-width: 320px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search input { padding-left: 34px; }

.segmented {
    display: inline-flex;
    padding: 3px;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: 7px;
}

.seg-btn {
    padding: 5px 12px;
    background: none;
    border: 0;
    border-radius: 5px;
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}

.seg-btn.active { background: var(--surface-2); color: var(--text); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.84rem; }
th, td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.75rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; background: rgba(255,255,255,.01); }
.cell-sub { font-size: 0.74rem; color: var(--text-faint); }
.cell-target { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty, .empty-note { text-align: center; padding: 28px; color: var(--text-faint); font-size: 0.85rem; }

.ip-btn {
    background: var(--bg);
    border: 1px solid var(--line-strong);
    color: var(--text);
    padding: 3px 8px;
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 0.78rem;
    cursor: pointer;
}
.ip-btn:hover { border-color: var(--accent); }

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
}
.pager-info { font-size: 0.8rem; color: var(--text-dim); }
.pager-btns { display: flex; gap: 6px; }

/* Links Editor */
.link-grid {
    display: grid;
    grid-template-columns: 58px 1.1fr 1.3fr 1.8fr 130px 64px 34px;
    gap: 10px;
    align-items: center;
}

.links-head {
    padding: 0 10px 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-faint);
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}

.link-item {
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
}

.reorder { display: flex; gap: 2px; }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap .dot { position: absolute; left: 10px; pointer-events: none; }
.select-wrap select { padding-left: 24px; }
.c-active { display: flex; justify-content: center; }

.link-appearance {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.tile-preview {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 0.85rem;
    overflow: hidden;
    flex: none;
}
.tile-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-input { width: 110px !important; flex: none; }
.f-image { flex: 1; min-width: 180px; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-dim); cursor: pointer; margin-left: auto; }
.check-note { width: 100%; font-size: 0.74rem; color: var(--text-faint); }
.is-up { color: var(--ok); }
.is-down { color: var(--bad); }

/* Savebar & Toasts */
.savebar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 16px 40px rgba(0,0,0,.6);
}
.savebar-inner { display: flex; align-items: center; gap: 12px; }
.savebar-msg { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; margin-right: 8px; }

#toasts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: var(--text);
    border-radius: 8px;
    font-size: 0.84rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.error { border-color: rgba(248, 81, 73, .5); color: #ff8b85; }

.dialog {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
}
.dialog::backdrop { background: rgba(0, 0, 0, .65); }
.dialog h3 { margin: 0 0 8px; }
.dialog p { margin: 0 0 20px; color: var(--text-dim); font-size: 0.88rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ==========================================================================
   Admin Panel Mobile Responsive
   ========================================================================== */
@media (max-width: 850px) {
    .shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 14px 16px;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .brand { padding-bottom: 12px; }

    .side-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-btn { width: auto; white-space: nowrap; flex: none; }

    .side-foot {
        flex-direction: row;
        justify-content: space-between;
        margin-top: 10px;
        padding-top: 10px;
    }

    .side-link { width: auto; }

    .content { padding: 20px 16px 100px; }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .head-actions { width: 100%; }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .insights,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search { max-width: none; }
    .segmented { width: 100%; }
    .seg-btn { flex: 1; }

    table { min-width: 600px; }

    .links-head { display: none; }

    .link-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .reorder { justify-content: flex-end; }
    .c-active { justify-content: flex-start; }
    .switch-label { margin-left: 0; }

    .savebar {
        width: calc(100% - 24px);
        bottom: 12px;
    }
    .savebar-inner {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .savebar-msg { width: 100%; margin-bottom: 4px; }
}

/* ==========================================================================
   Discord Spotify Kartı & Sol Yerleşim
   ========================================================================== */
.center-stage {
    transition: max-width .3s ease;
}

.center-stage.has-spotify {
    max-width: 880px;
}

.stage-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.center-stage.has-spotify .stage-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}

.spotify-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: rgba(15, 18, 24, .75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(29, 185, 84, .28);
    border-radius: 14px;
    box-shadow: 0 12px 34px -18px rgba(29, 185, 84, .35);
    animation: node-in .55s cubic-bezier(.2, .7, .2, 1) both;
}

.spotify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.spotify-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.74rem;
    font-weight: 500;
    color: #1ed760;
    letter-spacing: -0.01em;
}

.eq-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.eq-bars i {
    display: block;
    width: 2.5px;
    height: 4px;
    background: #1ed760;
    border-radius: 2px;
    animation: eq-bounce 1.1s ease-in-out infinite;
}

.eq-bars i:nth-child(2) { animation-delay: .2s; height: 10px; }
.eq-bars i:nth-child(3) { animation-delay: .4s; height: 6px; }

@keyframes eq-bounce {
    0%, 100% { height: 3px; }
    50% { height: 12px; }
}

.spotify-body {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    border-radius: 10px;
    transition: opacity .2s ease;
}

.spotify-body:hover {
    opacity: .9;
}

.spotify-art-wrap {
    position: relative;
    flex: none;
    width: 62px;
    height: 62px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
}

.spotify-art-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spotify-art-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #1ed760;
    font-size: 1.3rem;
}

.spotify-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spotify-song {
    font-size: 0.94rem;
    font-weight: 600;
    color: #f4f7fb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-artist {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-album {
    font-size: 0.72rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.spotify-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, .1);
    border-radius: 999px;
    overflow: hidden;
}

.spotify-bar-fill {
    height: 100%;
    width: 0%;
    background: #1ed760;
    border-radius: 999px;
    transition: width .8s linear;
}

.spotify-times {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-faint);
}

@media (max-width: 760px) {
    .center-stage.has-spotify {
        max-width: 540px;
    }

    .center-stage.has-spotify .stage-grid {
        grid-template-columns: 1fr;
    }
}