/* admin.css — Back-office No0dle. Interface sombre, sobre, lisible. */

:root {
    --bg: #14141a;
    --surface: #1d1d26;
    --surface-2: #262633;
    --border: #33333f;
    --text: #e9e9f0;
    --muted: #9a9ab0;
    --accent: #ff2e88;
    --accent-2: #22d3ee;
    --danger: #ef4444;
    --ok: #22c55e;
    --radius: 10px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent-2); }

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.4rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
    text-decoration: none;
}
.mainnav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.mainnav a {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.95rem;
}
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a.active { background: var(--accent); color: #fff; }
.mainnav .logout { color: var(--danger); }
.mainnav .target-blank { color: var(--muted); }

/* ---------- Layout ---------- */
.admin-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.6rem 1.2rem 4rem;
}
.admin-footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 2rem 1rem;
}
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}
.page-head h1 { margin: 0; font-size: 1.5rem; }
.count {
    font-size: 0.85rem;
    background: var(--surface-2);
    color: var(--muted);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    vertical-align: middle;
}
.empty { color: var(--muted); }

/* ---------- Flash ---------- */
.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    font-size: 0.95rem;
}
.flash-success { border-color: var(--ok); background: rgba(34,197,94,.12); }
.flash-error { border-color: var(--danger); background: rgba(239,68,68,.12); }
.flash-info { background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.82rem; }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-icon {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    width: 28px; height: 28px;
    cursor: pointer;
    line-height: 1;
}
.btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }
.inline { display: inline; }

/* ---------- Tables ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.data-table th, .data-table td {
    padding: 0.7rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table th { background: var(--surface-2); color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tr:last-child td { border-bottom: none; }
.col-actions { white-space: nowrap; }
.thumb {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: 8px;
    display: inline-block;
    background: var(--surface-2);
}
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
code { background: var(--surface-2); padding: 0.1rem 0.4rem; border-radius: 5px; font-size: 0.85rem; }

/* ---------- Forms ---------- */
.form-card, .form-inline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-bottom: 1.4rem;
    max-width: 640px;
}
.form-inline-card {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    max-width: none;
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.field-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem 0.2rem;
    margin-bottom: 1.1rem;
}
.field-group legend { padding: 0 0.5rem; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=url], input[type=number],
input[type=password], select, textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,46,136,.18);
}
textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.35rem 0 0; }
.preview { margin-top: 0.7rem; max-width: 160px; border-radius: 8px; border: 1px solid var(--border); }
.form-actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.5rem; }
.rename-form { display: flex; gap: 0.4rem; align-items: center; }
.rename-form input[type=text] { width: auto; min-width: 160px; }

/* ---------- Login ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 360px;
}
.login-card h1 { margin: 0 0 0.2rem; font-size: 1.4rem; }
.login-sub { color: var(--muted); margin: 0 0 1.3rem; font-size: 0.92rem; }
.login-card label { display: block; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.login-card button {
    width: 100%;
    margin-top: 1rem;
    padding: 0.6rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.login-card button:hover { filter: brightness(1.08); }

@media (max-width: 640px) {
    .data-table { display: block; overflow-x: auto; }
    .rename-form input[type=text] { min-width: 110px; }
}
