:root {
    --bg: #0f172a;
    --bg-secondary: rgba(15, 23, 42, 0.6);
    --card: rgba(15, 23, 42, 0.75);
    --accent: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    --accent-solid: #6366f1;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --success: #22c55e;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    background: radial-gradient(circle at top left, rgba(99,102,241,0.4), transparent 40%),
                radial-gradient(circle at bottom right, rgba(236,72,153,0.35), transparent 45%),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
                      linear-gradient(180deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at center, rgba(0,0,0,0.4), transparent 70%);
    pointer-events: none;
}

.site-shell {
    position: relative;
    z-index: 1;
    padding: 32px clamp(16px, 4vw, 48px);
    max-width: 1280px;
    margin: 0 auto;
}

a {
    color: inherit;
    text-decoration: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 12px 20px;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 30px rgba(99,102,241,0.4);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(99,102,241,0.55);
}

.btn--ghost {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.btn--danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.45);
    padding: 8px 16px;
    border-radius: 10px;
}

.btn--full {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5f5;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.hero {
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-bottom: 72px;
}

.hero__content h1 {
    font-size: clamp(36px, 6vw, 60px);
    margin: 12px 0 20px;
    letter-spacing: -0.03em;
}

.hero__content p {
    color: var(--muted);
    max-width: 520px;
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.hero__stats {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.stat {
    background: var(--card);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    min-width: 180px;
    backdrop-filter: blur(14px);
}

.stat__value {
    font-size: 36px;
    font-weight: 700;
    display: block;
}

.stat__label {
    color: var(--muted);
    font-size: 14px;
}

.features {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 60px;
}

.feature-card {
    background: var(--card);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.45);
}

.feature-card h2 {
    margin-top: 0;
    font-size: 20px;
}

.latest {
    background: rgba(15, 23, 42, 0.65);
    border-radius: 28px;
    padding: 32px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(14px);
}

.latest__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 24px;
}

.latest__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.latest__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.latest__meta {
    display: flex;
    flex-direction: column;
}

.latest__name {
    font-weight: 600;
}

.latest__date {
    font-size: 13px;
    color: var(--muted);
}

.link-chip {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
    cursor: pointer;
    font-weight: 500;
}

.cta {
    margin-top: 60px;
}

.cta__inner {
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(236,72,153,0.25));
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 40px;
    border-radius: 32px;
    text-align: center;
    backdrop-filter: blur(12px);
}

.cta__inner h2 {
    font-size: clamp(28px, 5vw, 42px);
    margin-bottom: 16px;
}

.cta__inner p {
    color: var(--muted);
    margin-bottom: 24px;
}

.footer {
    text-align: center;
    margin-top: 60px;
    color: rgba(226, 232, 240, 0.7);
    font-size: 14px;
}

.auth {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    align-items: center;
    min-height: 70vh;
}

.auth__panel {
    background: rgba(15, 23, 42, 0.8);
    padding: 40px;
    border-radius: 28px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.55);
}

.auth__panel h1 {
    margin-top: 0;
    margin-bottom: 12px;
}

.auth__panel p {
    color: var(--muted);
    margin-bottom: 24px;
}

.form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="file"] {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
}

.field input[type="file"] {
    padding: 10px 12px;
}

.field input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    margin-bottom: 24px;
}

.alert--error {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

.alert--success {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

.auth__aside {
    display: flex;
    justify-content: center;
}

.auth__card {
    background: rgba(15, 23, 42, 0.55);
    padding: 32px;
    border-radius: 28px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.45);
}

.auth__card h2 {
    margin-top: 0;
    margin-bottom: 16px;
}

.auth__card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
    color: var(--muted);
}

.admin {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    min-height: 80vh;
}

.admin__sidebar {
    background: rgba(15, 23, 42, 0.75);
    border-radius: 32px;
    padding: 32px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    backdrop-filter: blur(16px);
    display: grid;
    gap: 24px;
}

.logo {
    font-weight: 800;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.admin__nav {
    display: grid;
    gap: 12px;
}

.nav__link {
    padding: 10px 16px;
    border-radius: 14px;
    color: var(--muted);
    transition: background 0.2s ease;
}

.nav__link--active,
.nav__link:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #e0e7ff;
}

.logout {
    margin-top: auto;
}

.sidebar__note {
    font-size: 13px;
    color: var(--muted);
}

.admin__main {
    display: grid;
    gap: 28px;
}

.admin__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.panel {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 28px;
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.5);
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    gap: 12px;
}

.panel__hint {
    font-size: 13px;
    color: var(--muted);
}

.table {
    display: grid;
    gap: 12px;
}

.table__head,
.table__row {
    display: grid;
    grid-template-columns: 2fr 1.4fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 14px 18px;
    align-items: center;
    border-radius: 16px;
}

.table__head {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.table__row {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.16);
}

.file-name {
    font-weight: 600;
}

.file-date {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.short-url {
    cursor: pointer;
    background: rgba(99, 102, 241, 0.15);
    padding: 8px 12px;
    border-radius: 10px;
    display: inline-block;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-family: 'Inter', monospace;
}

.panel--split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.list li {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.list--dense li {
    align-items: flex-start;
    flex-direction: column;
}

.badge--soft {
    background: rgba(99, 102, 241, 0.22);
    border-radius: 999px;
    padding: 6px 12px;
    color: #c7d2fe;
}

.badge--ghost {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--muted);
}

.empty {
    color: var(--muted);
    padding: 16px 0;
}

.error {
    min-height: 60vh;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 16px;
}

.error__code {
    font-size: clamp(72px, 12vw, 120px);
    font-weight: 900;
    letter-spacing: 0.1em;
    background: var(--accent);
    -webkit-background-clip: text;
    color: transparent;
}

@media (max-width: 1024px) {
    .admin {
        grid-template-columns: 1fr;
    }
    .admin__sidebar {
        position: sticky;
        top: 16px;
        order: 2;
    }
    .admin__main {
        order: 1;
    }
}

@media (max-width: 768px) {
    .table__head,
    .table__row {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .hero__stats {
        flex-direction: column;
    }
    .latest__item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .hero__actions {
        flex-direction: column;
    }
    .site-shell {
        padding: 24px 18px;
    }
}

.link-chip.copied,
.short-url.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
}


.link-chip--inline {
    margin-left: 12px;
    padding: 8px 16px;
}

.link-chip--table {
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
}

.short-code {
    display: block;
    font-size: 12px;
    color: var(--muted);
}


.download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-line {
    font-size: 12px;
    color: var(--muted);
}


.audit {
    margin-top: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 12px 18px;
}

.audit details {
    color: var(--muted);
    font-size: 14px;
}

.audit__table {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.audit__head,
.audit__row {
    display: grid;
    grid-template-columns: 160px 200px 1fr 160px;
    gap: 12px;
}

.audit__head {
    text-transform: uppercase;
    font-size: 11px;
    color: var(--muted);
}

.audit__row {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.ua-cell {
    max-height: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit details[open] summary {
    color: #cbd5f5;
}

.audit summary {
    cursor: pointer;
}

@media (max-width: 1024px) {
    .audit__head,
    .audit__row {
        grid-template-columns: 1fr;
    }
}


.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
}

.modal__content {
    position: relative;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 24px;
    width: min(840px, 92vw);
    max-height: 80vh;
    overflow: hidden;
    display: grid;
    gap: 16px;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal__header h2 {
    margin: 0;
}

.modal__close {
    border: none;
    background: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.modal__body {
    overflow-y: auto;
    padding-right: 6px;
}

.download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-line {
    font-size: 12px;
    color: var(--muted);
}

.ua-cell {
    max-height: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit__table {
    display: grid;
    gap: 10px;
}

.audit__head,
.audit__row {
    display: grid;
    grid-template-columns: 160px 220px 1fr 160px;
    gap: 14px;
    font-size: 12px;
}

.audit__head {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.audit__row {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 14px 16px;
    line-height: 1.45;
}

@media (max-width: 1024px) {
    .audit__head,
    .audit__row {
        grid-template-columns: 1fr;
    }
}


.link-chip--ghost {
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #cbd5f5;
}
.link-chip--ghost:hover {
    border-color: rgba(148, 163, 184, 0.45);
}


.upload-status {
    margin-top: 16px;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.upload-status.error {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

.upload-progress {
    flex: 1;
    height: 8px;
    background: rgba(148, 163, 184, 0.14);
    border-radius: 9999px;
    overflow: hidden;
}

.upload-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    transition: width 0.2s ease;
}

.upload-status__text {
    font-size: 13px;
    color: var(--muted);
    min-width: 160px;
}

.link-chip--ghost {
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #cbd5f5;
}

.link-chip--ghost:hover {
    border-color: rgba(148, 163, 184, 0.45);
}

