@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Syne:wght@400;500;600;700&display=swap');

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

:root {
    --bg-base: #0f1117;
    --bg-surface: #161920;
    --bg-elevated: #1e2229;
    --bg-hover: #252a33;
    --border: #2a2f3a;
    --border-light: #343a47;
    --accent: #00d4aa;
    --accent-dim: rgba(0, 212, 170, 0.12);
    --accent-glow: rgba(0, 212, 170, 0.25);
    --danger: #ff4757;
    --danger-dim: rgba(255, 71, 87, 0.1);
    --text-primary: #e8eaf0;
    --text-secondary: #8b92a5;
    --text-muted: #555d70;
    --text-code: #7dd3fc;
    --font-display: 'Syne', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

html, body {
    height: 100%;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,212,170,0.06) 0%, transparent 60%);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── HEADER ── */
.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(15, 17, 23, 0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(0,212,170,0.3);
    padding: 3px 9px;
    border-radius: 100px;
    letter-spacing: 0.04em;
}

.nav-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-form {
    display: inline;
}

/* ── MAIN ── */
.main-content {
    flex: 1;
    padding: 40px 0 60px;
}

/* ── PAGE HEADER ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 20px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 13.5px;
    margin-top: 6px;
}

.stats-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 72px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    flex-shrink: 0;
}

.stats-number {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

.stats-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── ALERTS ── */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
}

.alert-success {
    background: rgba(0,212,170,0.08);
    border: 1px solid rgba(0,212,170,0.25);
    color: #00d4aa;
}

.alert-error {
    background: var(--danger-dim);
    border: 1px solid rgba(255,71,87,0.3);
    color: var(--danger);
}

/* ── TABLE ── */
.file-table-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table thead tr {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.file-table th {
    padding: 11px 16px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.th-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sort-badge {
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0,212,170,0.2);
}

.file-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.file-row:last-child td {
    border-bottom: none;
}

.file-row {
    transition: background 0.15s ease;
}

.file-row:hover {
    background: var(--bg-hover);
}

.file-row.row-latest {
    background: linear-gradient(90deg, rgba(0,212,170,0.04) 0%, transparent 60%);
}

.file-row.row-latest:hover {
    background: linear-gradient(90deg, rgba(0,212,170,0.08) 0%, var(--bg-hover) 60%);
}

/* File name cell */
.file-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.row-latest .file-icon {
    border-color: rgba(0,212,170,0.3);
    color: var(--accent);
    background: var(--accent-dim);
}

.file-name-text {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

.badge-latest {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    background: var(--accent);
    color: #0a0c10;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Size */
.size-text {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* Date cell */
.date-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.date-main {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-secondary);
}

.date-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Actions */
.actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-form {
    display: inline;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-download {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(0,212,170,0.25);
}

.btn-download:hover {
    background: rgba(0,212,170,0.2);
    border-color: rgba(0,212,170,0.45);
    transform: translateY(-1px);
}

.btn-delete {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: rgba(255,71,87,0.2);
}

.btn-delete:hover {
    background: rgba(255,71,87,0.18);
    border-color: rgba(255,71,87,0.4);
    transform: translateY(-1px);
}

/* ── TABLE FOOTER ── */
.table-footer {
    margin-top: 16px;
    padding: 0 4px;
}

.table-info {
    font-size: 12.5px;
    color: var(--text-muted);
}

.table-info strong {
    color: var(--text-secondary);
}

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.empty-icon {
    display: inline-flex;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.empty-text {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.7;
}

.empty-text code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-code);
    background: rgba(125, 211, 252, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
}

.empty-list {
    margin-top: 10px;
    list-style: none;
    padding: 0;
}

.empty-list li {
    margin: 6px 0;
}

/* ── LOGIN ── */
.login-wrap {
    display: flex;
    justify-content: center;
    padding-top: 50px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.login-title {
    font-size: 24px;
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.login-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-radius: var(--radius);
    padding: 10px 12px;
    outline: none;
}

.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.18);
}

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

/* ── LATEST LINK PAGE ── */
.latest-wrap {
    display: flex;
    justify-content: center;
    padding-top: 30px;
}

.latest-card {
    width: 100%;
    max-width: 760px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.latest-title {
    font-size: 24px;
    margin-bottom: 6px;
}

.latest-subtitle {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.latest-link-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 14px;
}

.latest-link-box code {
    color: var(--text-code);
    font-family: var(--font-mono);
}

.latest-meta {
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.latest-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── FOOTER ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 18px 0;
    text-align: center;
}

.site-footer p {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .col-created { display: none; }
    .page-header { flex-direction: column; }
    .stats-badge { flex-direction: row; gap: 8px; min-height: auto; }
    .page-title { font-size: 22px; }
}

@media (max-width: 540px) {
    .col-size { display: none; }
    .btn span { display: none; }
    .btn { padding: 7px 9px; }
}
