:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #059669;
    --error: #dc2626;
    --info: #0284c7;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 520px; margin: 0 auto; padding: 2rem 1rem; }
.container.wide { max-width: 1000px; }

header { text-align: center; margin-bottom: 2rem; }
header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.25rem; }
.subtitle { color: var(--muted); font-size: 0.95rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; text-align: left; }

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }

input[type="url"], input[type="text"], input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.15);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-copy { background: var(--success); color: white; border-radius: 0 8px 8px 0; }
.btn-danger { background: #fee2e2; color: var(--error); }
.btn-success { background: #d1fae5; color: var(--success); }

.alert { padding: 0.85rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: 0.95rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.result { margin-bottom: 1.5rem; }
.short-url-box { display: flex; margin-top: 0.4rem; }
.short-url-box input { border-radius: 8px 0 0 8px; border-right: none; font-family: monospace; }

footer { text-align: center; margin-top: 2rem; color: var(--muted); font-size: 0.85rem; }
footer a { color: var(--primary); text-decoration: none; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 1.25rem; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--border); }
.stat-number { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }
tr.inactive { opacity: 0.6; }
.url-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.pagination { display: flex; gap: 0.4rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination a { padding: 0.4rem 0.75rem; border-radius: 6px; text-decoration: none; color: var(--text); background: var(--bg); border: 1px solid var(--border); }
.pagination a.active { background: var(--primary); color: white; border-color: var(--primary); }

@media (max-width: 600px) {
    .stats { grid-template-columns: 1fr; }
    .admin-header { flex-direction: column; gap: 1rem; }
}
