/* ============================================================
   Click2 — Main Stylesheet
   Design system: dark gradient + indigo accent + Inter font
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --indigo:       #6366f1;
    --indigo-dark:  #4f46e5;
    --indigo-light: #eef2ff;
    --text-primary: #0f172a;
    --text-muted:   #64748b;
    --border:       #e2e8f0;
    --bg-page:      radial-gradient(ellipse 90% 60% at 50% -10%, rgba(99,102,241,0.18) 0%, transparent 60%),
                    linear-gradient(160deg, #0c0e1d 0%, #0f172a 45%, #181030 100%);
    --bg-card:      #ffffff;
    --radius-card:  20px;
    --radius-btn:   12px;
    --shadow-card:  0 25px 60px rgba(0,0,0,0.45), 0 8px 20px rgba(0,0,0,0.25);
    --transition:   0.18s ease;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────── */

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Navbar ─────────────────────────────────────────────── */

.site-nav {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: #fff;
}

.logo-icon-svg {
    color: var(--indigo);
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #fff;
}

.logo-accent {
    color: var(--indigo);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.nav-link-cta {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.3);
}

.nav-link-cta:hover {
    background: rgba(99,102,241,0.25);
    color: #fff;
}

/* ── Hero ───────────────────────────────────────────────── */

.hero-section {
    width: 100%;
    max-width: 680px;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 3rem;
    gap: 2rem;
}

.hero-text {
    text-align: center;
}

.hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a5b4fc;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.25);
    padding: 0.3rem 0.9rem;
    border-radius: 99px;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-title-accent {
    color: var(--indigo);
    display: inline-block;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: rgba(255,255,255,0.6);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

.hero-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: color var(--transition), border-color var(--transition);
    animation: bounce 2.5s ease-in-out infinite;
    margin-top: -0.5rem;
}

.hero-scroll-hint:hover {
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.3);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(6px); }
}

/* ── Card ───────────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 2.25rem 2rem;
    width: 100%;
}

.card-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.card-title {
    font-size: clamp(1.35rem, 3vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-subtitle {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ── Form ───────────────────────────────────────────────── */

.shorten-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group {
    display: flex;
    gap: 0.6rem;
    align-items: stretch;
}

.input-group input[type="url"] {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: #f8fafc;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 0;
}

.input-group input[type="url"]::placeholder {
    color: #b0bac6;
}

.input-group input[type="url"]:focus {
    border-color: var(--indigo);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.25rem;
    background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}

.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}

.btn-primary:active {
    transform: translateY(0);
    opacity: 1;
}

/* ── Alerts ─────────────────────────────────────────────── */

.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ── Result box ─────────────────────────────────────────── */

.result-box {
    margin-top: 1.5rem;
    padding: 1.25rem 1.25rem 1rem;
    background: var(--indigo-light);
    border: 1.5px solid rgba(99,102,241,0.2);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--indigo-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-url-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-url {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--indigo-dark);
    text-decoration: none;
    letter-spacing: -0.01em;
    word-break: break-all;
    flex: 1;
}

.result-url:hover {
    text-decoration: underline;
}

.btn-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1.5px solid rgba(99,102,241,0.3);
    border-radius: 8px;
    cursor: pointer;
    color: var(--indigo);
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-copy:hover {
    background: var(--indigo);
    color: #fff;
    border-color: var(--indigo);
}

.result-stats-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.result-stats-link:hover {
    color: var(--indigo);
}

/* ── Features ───────────────────────────────────────────── */

.features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
}

.feature-icon {
    font-size: 1rem;
}

/* ── Stats page ─────────────────────────────────────────── */

.stats-block {
    text-align: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.stat-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-number {
    font-size: clamp(2.8rem, 8vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--indigo);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stats-url-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stats-url-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stats-url-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--indigo-dark);
    text-decoration: none;
}

.stats-url-value:hover {
    text-decoration: underline;
}

.stats-url-destination {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    word-break: break-all;
    line-height: 1.5;
}

.stats-url-destination:hover {
    color: var(--indigo);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--indigo);
    text-decoration: none;
    transition: gap var(--transition);
}

.btn-back:hover {
    gap: 0.6rem;
}

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
    width: 100%;
    margin-top: 5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 2.5rem 1.5rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    text-decoration: none;
}

.footer-dev {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

.footer-dev a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-dev a:hover {
    color: #fff;
}

.footer-legal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.footer-copy {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.25);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

.footer-links a {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: color var(--transition);
    padding: 0.1rem 0.3rem;
}

.footer-links a:hover {
    color: #fff;
}

.footer-sep {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.2);
}

/* ── User auth pages ────────────────────────────────────── */

.user-auth-card {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.user-auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.user-auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.user-auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

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

.field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.field-input {
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #f8fafc;
    outline: none;
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input:focus {
    border-color: var(--indigo);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.user-auth-footer {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-auth-footer a {
    color: var(--indigo);
    font-weight: 600;
    text-decoration: none;
}

.user-auth-footer a:hover {
    text-decoration: underline;
}

/* ── Alert ok ───────────────────────────────────────────── */

.alert-ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 480px) {
    .site-nav {
        padding: 1rem 1rem;
    }

    .hero-section {
        padding: 1.5rem 1rem 2rem;
        min-height: calc(100vh - 64px);
    }

    .card {
        padding: 1.75rem 1.25rem;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-primary {
        justify-content: center;
    }

    .features {
        gap: 1rem;
    }

    .footer-links {
        gap: 0.1rem;
    }
}

/* ── Stats page extras ──────────────────────────────────── */

.stats-main {
    max-width: 640px;
}

.stats-hero-card .stats-hero {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.stats-hero .stat-counter {
    flex-shrink: 0;
}

.stats-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.chart-wrap {
    position: relative;
    height: 200px;
}

.referrers-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.referrer-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.referrer-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.referrer-label {
    font-size: 0.8rem;
    color: var(--text-primary);
    word-break: break-all;
    flex: 1;
}

.referrer-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--indigo-dark);
    flex-shrink: 0;
}

.referrer-bar-track {
    height: 5px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.referrer-bar-fill {
    height: 100%;
    background: var(--indigo);
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* ── Index extras ───────────────────────────────────────── */

.ad-banner {
    width: 100%;
    min-height: 90px;
}

.custom-code-toggle {
    display: flex;
    align-items: center;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color var(--transition);
}

.btn-link:hover,
.btn-link.active {
    color: var(--indigo);
}

.custom-code-input {
    margin-top: 0.25rem;
}

.custom-code-prefix {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-btn);
    overflow: hidden;
    background: #f8fafc;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.custom-code-prefix:focus-within {
    border-color: var(--indigo);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.prefix-label {
    padding: 0.7rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: #f1f5f9;
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.custom-code-prefix input {
    flex: 1;
    padding: 0.7rem 0.75rem;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.result-duplicate-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    margin-bottom: 0.25rem;
}

/* ── Preview / interstitial ─────────────────────────────── */

.preview-card {
    text-align: center;
}

.preview-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.preview-destination {
    background: var(--indigo-light);
    border: 1.5px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.preview-host {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--indigo-dark);
    word-break: break-all;
}

.preview-url {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-top: 0.15rem;
}

.preview-ad {
    margin-bottom: 1.25rem;
    min-height: 90px;
}

.preview-countdown-wrap {
    margin-bottom: 1.25rem;
}

.preview-bar-track {
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.preview-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--indigo), var(--indigo-dark));
    border-radius: 99px;
    transition: width 1s linear;
}

.preview-countdown-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.preview-skip {
    width: 100%;
    justify-content: center;
}

/* ── Admin panel ────────────────────────────────────────── */

body.admin-body {
    background: #f8fafc;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.03em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.5rem;
}

.admin-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--indigo);
    color: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: middle;
}

.admin-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    border-left: 3px solid transparent;
}

.admin-nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.admin-nav-link.active {
    background: rgba(99,102,241,0.15);
    color: #fff;
    border-left-color: var(--indigo);
}

.admin-logout {
    color: rgba(255,100,100,0.7);
}

.admin-logout:hover {
    color: #f87171;
    background: rgba(248,113,113,0.1);
}

.admin-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 0.5rem;
}

.admin-main {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.admin-content {
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.admin-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.admin-stat-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.admin-stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.1;
}

.admin-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.1rem;
}

.admin-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
}

.admin-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

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

.admin-table th {
    text-align: left;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
}

.admin-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
    color: var(--text-primary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr.row-inactive td {
    opacity: 0.45;
}

.td-truncate {
    max-width: 280px;
    overflow: hidden;
}

.td-truncate span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-right {
    text-align: right;
}

.admin-link {
    color: var(--indigo);
    text-decoration: none;
    font-weight: 600;
}

.admin-link:hover {
    text-decoration: underline;
}

.badge-active {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #166534;
    background: #dcfce7;
    border-radius: 5px;
    padding: 0.15rem 0.45rem;
}

.badge-inactive {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9f1239;
    background: #ffe4e6;
    border-radius: 5px;
    padding: 0.15rem 0.45rem;
}

.badge-custom {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #5b21b6;
    background: #ede9fe;
    border-radius: 5px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.3rem;
}

.action-btns {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.btn-action {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.3rem;
    border-radius: 6px;
    transition: background var(--transition);
    line-height: 1;
}

.btn-action:hover {
    background: #f1f5f9;
}

.btn-ok    { }
.btn-warn  { }
.btn-danger { }

.admin-search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-pagination {
    display: flex;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: background var(--transition), color var(--transition);
}

.page-btn:hover,
.page-btn.active {
    background: var(--indigo);
    color: #fff;
    border-color: var(--indigo);
}

/* ── Shared form fields (login + admin forms) ───────────── */

.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field-input {
    display: block;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #f8fafc;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input:focus {
    border-color: var(--indigo);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.alert-ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ── Admin responsive ───────────────────────────────────── */

@media (max-width: 768px) {
    .admin-sidebar {
        width: 60px;
        padding: 1rem 0;
    }

    .admin-logo span:last-child,
    .admin-nav-link span:last-child {
        display: none;
    }

    .admin-logo {
        justify-content: center;
        padding: 0.5rem;
    }

    .admin-nav-link {
        justify-content: center;
        padding: 0.75rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .admin-nav-link.active {
        border-left: none;
        border-bottom-color: var(--indigo);
    }

    .admin-main {
        margin-left: 60px;
    }

    .admin-content {
        padding: 1rem;
    }

    .admin-topbar {
        padding: 0.75rem 1rem;
    }

    .td-truncate {
        max-width: 160px;
    }
}

/* ── SEO landing sections ────────────────────────────────── */

.seo-section {
    width: 100%;
    max-width: 900px;
    padding: 4rem 1.5rem;
    color: rgba(255,255,255,0.9);
}

.seo-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 2rem;
}

.seo-link {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.seo-link:hover {
    color: #fff;
    text-decoration: underline;
}

.seo-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.seo-step {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.seo-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--indigo);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.seo-step h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.4rem;
}

.seo-step p {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

.seo-feat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.seo-feat-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1.25rem;
}

.seo-feat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.seo-feat-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}

.seo-feat-card p {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

/* ── FAQ ─────────────────────────────────────────────────── */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.faq-item summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #fff;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--indigo);
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
}

/* ── API docs (admin) ────────────────────────────────────── */

.api-docs {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.api-docs-endpoint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: #1e293b;
    margin: 0;
}

.api-method {
    background: var(--indigo);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.api-docs-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.api-docs-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
    background: #f1f5f9;
}

.api-docs-block pre {
    margin: 0;
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #1e293b;
    overflow-x: auto;
}

.api-docs-block pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

/* ── API new key reveal box ──────────────────────────────── */

.api-new-key-box {
    border: 2px solid #f59e0b;
    background: #fffbeb;
}

.api-new-key-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.75rem;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.api-key-display code {
    flex: 1;
    font-size: 0.875rem;
    word-break: break-all;
    color: #1e293b;
}

.btn-copy-key {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: var(--indigo);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-copy-key:hover { background: var(--indigo-dark); }

.api-usage-example {
    font-size: 0.8125rem;
    color: #92400e;
    margin: 0;
}

/* ── Legal pages ─────────────────────────────────────────── */

.legal-page {
    width: 100%;
    max-width: 780px;
    padding: 3rem 1.5rem 5rem;
    flex: 1;
}

.legal-content {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    color: rgba(255,255,255,0.85);
}

.legal-content h1.legal-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.legal-updated {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    margin-bottom: 2rem;
}

.legal-content h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}

.legal-content p,
.legal-content li {
    font-size: 0.9rem;
    line-height: 1.75;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
}

.legal-content ul {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.legal-content a {
    color: #a5b4fc;
    text-decoration: none;
}

.legal-content a:hover {
    color: #fff;
    text-decoration: underline;
}

.legal-content code {
    background: rgba(255,255,255,0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: #c7d2fe;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.legal-table th {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.legal-table td {
    padding: 0.6rem 0.75rem;
    color: rgba(255,255,255,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: top;
}
