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

:root {
    --ink: #16181d;
    --paper: #f3f1ec;
    --panel: #ffffff;
    --line: #e2ded3;
    --muted: #6b6b63;
    --brass: #b08d57;
    --brass-dark: #8f7040;
    --danger: #c1493f;
    --accent: #b08d57;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--paper);
    color: var(--ink);
}

h1, h2 { font-family: 'Space Grotesk', sans-serif; }

a { color: inherit; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--panel); }
.btn-danger { background: transparent; color: var(--danger); border-color: #e6c9c5; }
.btn-danger:hover { background: #fbeceb; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Auth pages ---------- */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    background-image: radial-gradient(circle at 20% 20%, #23262e 0%, var(--ink) 60%);
}
.auth-card {
    background: var(--panel);
    padding: 40px 36px;
    border-radius: 14px;
    width: 340px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.auth-card h1 { margin: 0 0 22px; font-size: 22px; }
.auth-card label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--muted); }
.auth-card input {
    width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.auth-card button {
    width: 100%; margin-top: 22px; padding: 12px; border: none; border-radius: 8px;
    background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer;
}
.error-msg { color: var(--danger); background: #fbeceb; padding: 10px 14px; border-radius: 8px; font-size: 14px; }

/* ---------- Admin layout ---------- */
.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.admin-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.admin-header h1 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 10px; }
.count-badge { background: var(--brass); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 20px; font-family: Inter; }
.header-actions { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.search-form { display: flex; gap: 8px; }
.search-form input { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; width: 260px; font-size: 14px; }

.empty-state { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.client-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
    display: flex; flex-direction: column; gap: 12px;
}
.client-thumb { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.client-thumb.placeholder {
    display: flex; align-items: center; justify-content: center;
    background: var(--ink); color: #fff; font-family: 'Space Grotesk'; font-weight: 700; font-size: 20px;
}
.client-info { display: flex; flex-direction: column; }
.client-info strong { font-size: 15px; }
.client-info .slug { font-size: 13px; color: var(--muted); }
.status-off { font-size: 11px; color: var(--danger); font-weight: 600; margin-top: 2px; }
.client-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }

/* ---------- Form card (edit client) ---------- */
.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; max-width: 720px; }
.form-card h2 { font-size: 17px; margin: 0 0 4px; }
.form-card .hint { font-size: 13px; color: var(--muted); margin-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 4px; }
.form-card label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--muted); }
.form-card input[type=text], .form-card textarea, .form-card select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.form-card input[type=color] { width: 60px; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.slug-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.slug-input span { padding: 10px 0 10px 12px; color: var(--muted); font-size: 14px; }
.slug-input input { border: none; padding-left: 2px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 16px 0; color: var(--ink); font-weight: 500; }
.current-photo { display: block; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 8px 0; }

.link-row { display: grid; grid-template-columns: 150px 1fr 1.4fr auto; gap: 8px; margin-bottom: 10px; align-items: center; }
#add-link { margin-top: 4px; }
.form-actions { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Public profile page ---------- */
.profile-body {
    min-height: 100vh;
    background: var(--ink);
    background-image:
        radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 55%);
    display: flex;
    justify-content: center;
    padding: 60px 20px 40px;
}
.profile-wrap { width: 100%; max-width: 420px; text-align: center; }

.profile-photo {
    width: 108px; height: 108px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 6px rgba(255,255,255,.06);
    margin-bottom: 18px;
}
.profile-photo.placeholder {
    display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
    background: #23262e; color: var(--accent); font-family: 'Space Grotesk'; font-weight: 700; font-size: 38px;
}

.profile-name { color: #fff; font-size: 26px; margin: 0 0 2px; }
.profile-title { color: var(--accent); font-size: 14px; font-weight: 600; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .04em; }
.profile-bio { color: #c7c7cf; font-size: 14px; line-height: 1.6; margin: 0 0 28px; }

.link-buttons { display: flex; flex-direction: column; gap: 12px; }
.link-btn {
    display: flex; align-items: center; gap: 12px;
    background: #1f222a; border: 1px solid #2c303a;
    color: #fff; text-decoration: none;
    padding: 15px 18px; border-radius: 12px; font-size: 15px; font-weight: 500;
    transition: border-color .15s ease, transform .12s ease;
}
.link-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.link-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); }
.link-icon svg { width: 100%; height: 100%; }

.powered-by { margin-top: 36px; font-size: 11px; color: #55565f; letter-spacing: .03em; }

@media (max-width: 560px) {
    .form-row { grid-template-columns: 1fr; }
    .link-row { grid-template-columns: 1fr; }
    .client-grid { grid-template-columns: 1fr 1fr; }
}
