/* Panel sayfasına özel stiller; taban palet ve modal stilleri style.css'ten gelir. */

.panel-shell {
    display: block;
    width: 100%;
    max-width: 68rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* ---------- Giriş ---------- */

.login-wrap {
    min-height: calc(100vh - 6rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 26rem;
    margin: 0 auto;
}

.text-input {
    width: 100%;
    padding: 0.8125rem 1rem;
    background: rgba(5, 8, 18, 0.55);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15);
}

#login-start-form .text-input {
    margin-bottom: 0.875rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9375rem;
}

button.ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    box-shadow: none;
    font-weight: 600;
}

button.ghost:hover:not(:disabled) {
    color: var(--text);
    background: rgba(91, 140, 255, 0.1);
    transform: none;
    filter: none;
    box-shadow: none;
}

button.small {
    padding: 0.4rem 0.875rem;
    font-size: 0.85rem;
}

#login-verify-form .wide + .wide {
    margin-top: 0.625rem;
}

.otp {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.5rem 0 1.25rem;
}

.otp input {
    width: 3rem;
    height: 3.6rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: rgba(5, 8, 18, 0.55);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.otp input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.18);
    transform: translateY(-2px);
}

.otp input.filled {
    border-color: var(--border-strong);
    background: rgba(91, 140, 255, 0.08);
}

.login-foot {
    margin: 1.5rem 0 0;
    font-size: 0.8125rem;
}

.login-foot a {
    color: var(--muted);
    text-underline-offset: 2px;
}

.login-foot a:hover {
    color: var(--accent);
}

/* ---------- Üst bar ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.logo small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    margin-left: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.user-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge.badge-admin {
    background: linear-gradient(92deg, #ff5c7a, #ff9d4c);
    color: #fff;
    box-shadow: 0 0 18px rgba(255, 92, 122, 0.4);
}

.badge.badge-premium {
    background: linear-gradient(92deg, #f5c33b, #ff9d4c);
    color: #3a2500;
    box-shadow: 0 0 18px rgba(245, 195, 59, 0.35);
}

.badge.badge-free {
    background: rgba(91, 140, 255, 0.15);
    color: var(--muted);
    border: 1px solid var(--border);
}

/* ---------- Kartlar ---------- */

.panel-shell .card {
    padding: 1.5rem 1.5rem 1.375rem;
    margin-bottom: 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.panel-shell h2 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
}

.count-pill {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.1rem 0.5rem;
    margin-left: 0.375rem;
    background: rgba(91, 140, 255, 0.15);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    vertical-align: middle;
}

/* ---------- Premium banner ---------- */

.premium-banner {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(92deg, rgba(245, 195, 59, 0.1), rgba(255, 157, 76, 0.06));
    border: 1px solid rgba(245, 195, 59, 0.35);
    border-radius: 16px;
    animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.premium-banner .crown {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 12px rgba(245, 195, 59, 0.5));
}

.premium-banner p {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
}

.premium-cta {
    background: linear-gradient(92deg, #f5c33b, #ff9d4c);
    color: #3a2500;
    box-shadow: 0 6px 20px rgba(245, 195, 59, 0.3);
    white-space: nowrap;
    font-size: 0.875rem;
    padding: 0.55rem 1.125rem;
}

/* ---------- Kısaltma formu ---------- */

.shorten-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.625rem;
    align-items: stretch;
}

.custom-code-field {
    display: flex;
    align-items: center;
    background: rgba(5, 8, 18, 0.55);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 0.375rem 0 0.875rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.custom-code-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15);
}

.cc-prefix {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    user-select: none;
}

.custom-code-field input {
    width: 11rem;
    padding: 0.8125rem 0.375rem;
    background: transparent;
    border: 0;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

.custom-code-field input:focus {
    outline: none;
}

.custom-code-field.locked {
    opacity: 0.75;
    cursor: pointer;
}

.custom-code-field.locked input {
    pointer-events: none;
}

.cc-lock {
    padding: 0.25rem 0.5rem;
    background: transparent;
    box-shadow: none;
    font-size: 1.1rem;
    filter: drop-shadow(0 0 8px rgba(245, 195, 59, 0.5));
}

.cc-lock:hover:not(:disabled) {
    transform: scale(1.15);
    filter: drop-shadow(0 0 12px rgba(245, 195, 59, 0.8));
    box-shadow: none;
}

/* ---------- Tablolar ---------- */

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(124, 144, 255, 0.1);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(91, 140, 255, 0.06);
}

.data-table .num {
    text-align: right;
}

td.num {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--cyan);
}

.short-cell a {
    color: var(--cyan);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.short-cell a:hover {
    text-decoration: underline;
}

.long-cell {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.date-cell {
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.8125rem;
}

/* Kalıcı link rozeti — panelden/API'den üretilen linklerin hiç düşmediğini
   herkese açık (30 gün) linklerden görsel olarak ayırır. */
.perm-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: #4ade80;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.row-actions {
    display: flex;
    gap: 0.375rem;
    justify-content: flex-end;
}

.icon-btn {
    padding: 0.35rem 0.55rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: none;
    line-height: 1;
}

.icon-btn:hover:not(:disabled) {
    background: rgba(91, 140, 255, 0.12);
    transform: none;
    filter: none;
    box-shadow: none;
}

.icon-btn.danger:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.5);
}

.icon-btn.locked {
    opacity: 0.85;
    filter: drop-shadow(0 0 6px rgba(245, 195, 59, 0.4));
}

.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.empty-note {
    margin: 1rem 0 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Premium anahtarı (superadmin) — gerçek bir switch gibi davranır, statik bir
   rozetle karıştırılmaması için belirgin bir tıklanabilirlik ipucu taşır. */
.premium-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.7rem 0.2rem 0.3rem;
    border-radius: 999px;
    box-shadow: none;
    border: 1px solid var(--border);
    background: rgba(91, 140, 255, 0.05);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.premium-toggle:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(91, 140, 255, 0.1);
    filter: none;
    box-shadow: 0 4px 14px rgba(91, 140, 255, 0.15);
}

.premium-toggle .switch-track {
    position: relative;
    width: 2.15rem;
    height: 1.2rem;
    flex: none;
    border-radius: 999px;
    background: rgba(124, 144, 255, 0.18);
    border: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.premium-toggle .switch-knob {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease;
}

.premium-toggle .switch-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.premium-toggle.on {
    color: #f5c33b;
}

.premium-toggle.on .switch-track {
    background: linear-gradient(92deg, #f5c33b, #ff9d4c);
    border-color: transparent;
    box-shadow: 0 0 14px rgba(245, 195, 59, 0.35);
}

.premium-toggle.on .switch-knob {
    transform: translateX(0.95rem);
    background: #3a2500;
}

.premium-toggle:disabled {
    cursor: progress;
    opacity: 0.7;
}

/* Sunucu yanıtı gelince kısa bir "işlem başarılı" parlaması. */
.premium-toggle.flash {
    animation: premium-flash 0.6s ease;
}

@keyframes premium-flash {
    0% { box-shadow: 0 0 0 0 rgba(245, 195, 59, 0.55); }
    100% { box-shadow: 0 0 0 10px rgba(245, 195, 59, 0); }
}

.status-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    margin-right: 0.375rem;
}

.status-dot.on { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.7); }
.status-dot.off { background: var(--danger); }

/* ---------- Modallar ---------- */

.modal-narrow {
    max-width: 26rem;
}

.modal .control {
    margin-bottom: 1rem;
}

.modal textarea {
    padding: 0.75rem 0.875rem;
    background: rgba(5, 8, 18, 0.55);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.modal textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15);
}

.edit-old {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--cyan);
}

#edit-form .custom-code-field {
    margin-bottom: 1rem;
}

#edit-form .custom-code-field input {
    width: 100%;
    flex: 1;
}

/* ---------- Alt bilgi ---------- */

.panel-foot {
    text-align: center;
    color: var(--muted);
    font-size: 0.8125rem;
    padding: 0.5rem 0 0;
}

.panel-foot p { margin: 0; }

.panel-foot a {
    color: var(--muted);
    text-underline-offset: 2px;
}

.panel-foot a:hover { color: var(--accent); }

/* ---------- Küçük ekranlar ---------- */

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

    .custom-code-field input {
        width: 100%;
        flex: 1;
    }

    .premium-banner {
        flex-direction: column;
        text-align: center;
    }

    .topbar {
        flex-direction: column;
        gap: 0.625rem;
    }

    .otp input {
        width: 2.5rem;
        height: 3.1rem;
        font-size: 1.25rem;
    }
}
