diff --git a/web/index.html b/web/index.html index bd95b4e..91dc116 100644 --- a/web/index.html +++ b/web/index.html @@ -3,6 +3,8 @@ + + MKVTool diff --git a/web/src/App.tsx b/web/src/App.tsx index c3bf0f7..353f79b 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,153 +1,1131 @@ -import {useMemo, useState} from "react"; +import { FormEvent, useCallback, useEffect, useMemo, useRef, useState } from "react"; -import Dashboard from "./pages/Dashboard"; -import Files from "./pages/Files"; -import FileDetails from "./pages/FileDetails"; -import Settings from "./pages/Settings"; +type Movie = { + id: number; + radarr_movie_id: number; + radarr_movie_file_id: number; + title: string; + year: number | null; + path: string; + size: number | null; + poster_url: string | null; + status: string; + completed_at: string | null; + last_error: string | null; + failed_step: string | null; + last_seen_at: string; +}; -type Route = - | { name: "dashboard" } - | { name: "files" } - | { name: "file"; id: number } - | { name: "settings" }; +type RadarrSettings = { url: string | null; api_key_configured: boolean }; -function GearIcon({className}: { className?: string }) { - return ( - - - - - ); +type NotificationKind = "info" | "error" | "warning"; +type Notification = { id: number; text: string; kind: NotificationKind }; +type QbittorrentSettings = { + url: string | null; + username: string | null; + password_configured: boolean; +}; + +const jsonHeaders = { "Content-Type": "application/json" }; + +const STATUS_LABELS: Record = { + detected: "Détecté", + analyzing: "Analyse", + ready: "Prêt", + queued: "En file", + converting: "Conversion", + validating: "À valider", + importing: "Import", + completed: "Terminé", + failed: "Erreur", + missing: "Introuvable", +}; + +const PENDING = ["detected", "ready", "queued", "validating"]; +const ACTIVE = ["analyzing", "converting", "validating", "importing"]; +const DONE = ["completed"]; +const BROKEN = ["failed", "missing"]; +const BLOCKED = ["queued", "converting", "validating", "importing"]; +const CONVERTIBLE = ["detected", "ready", "failed"]; + +const STEP_LABELS: Record = { + converting: "Extraction du MKV", + validating: "Validation du MKV", + importing: "Import Jellyfin", +}; + +const dateFormatter = new Intl.DateTimeFormat("fr-FR", { + dateStyle: "short", + timeStyle: "short", +}); + +async function api(path: string, init?: RequestInit): Promise { + const response = await fetch(path, init); + if (!response.ok) { + const body = await response.json().catch(() => null); + throw new Error(body?.detail ?? `Erreur HTTP ${response.status}`); + } + return response.json(); } -function HomeIcon({className}: { className?: string }) { - return ( - - - - - ); +function readableSize(size: number | null): string { + if (size === null) return "—"; + return `${(size / 1024 ** 3).toFixed(1)} Go`; } -function FolderIcon({className}: { className?: string }) { - return ( - - - - ); +function statusLabel(status: string): string { + return STATUS_LABELS[status] ?? status; +} + +function formatDateTime(iso: string): string { + const date = new Date(iso); + return Number.isNaN(date.getTime()) ? "—" : dateFormatter.format(date); +} + +type Page = "dashboard" | "traitements" | "configuration"; + +type Tab = "pending" | "active" | "done" | "broken"; + +const TABS: { id: Tab; label: string }[] = [ + { id: "pending", label: "À traiter" }, + { id: "active", label: "En cours" }, + { id: "done", label: "Traités" }, + { id: "broken", label: "Erreurs" }, +]; + +function inGroup(status: string, tab: Tab): boolean { + if (tab === "pending") return PENDING.includes(status); + if (tab === "active") return ACTIVE.includes(status); + if (tab === "done") return DONE.includes(status); + return BROKEN.includes(status); } export default function App() { - const [route, setRoute] = useState({name: "dashboard"}); + const [page, setPage] = useState("dashboard"); + const [movies, setMovies] = useState([]); + const [tab, setTab] = useState("pending"); + const [url, setUrl] = useState(""); + const [apiKey, setApiKey] = useState(""); + const [keyConfigured, setKeyConfigured] = useState(false); + const [qbitUrl, setQbitUrl] = useState(""); + const [qbitUsername, setQbitUsername] = useState(""); + const [qbitPassword, setQbitPassword] = useState(""); + const [qbitConfigured, setQbitConfigured] = useState(false); + const [selected, setSelected] = useState(null); + const [posterUrl, setPosterUrl] = useState(null); + const [modalBusy, setModalBusy] = useState(false); + const [modalMessage, setModalMessage] = useState(""); + const [modalError, setModalError] = useState(false); + const [validatingId, setValidatingId] = useState(null); + const [selectMode, setSelectMode] = useState(false); + const [selectedIds, setSelectedIds] = useState([]); + const [confirmSingle, setConfirmSingle] = useState(null); + const [confirmBulk, setConfirmBulk] = useState(false); + const [deleting, setDeleting] = useState(false); + const [notifications, setNotifications] = useState([]); + const notificationId = useRef(0); + const [busy, setBusy] = useState(false); + const [authState, setAuthState] = useState<"checking" | "guest" | "authed">("checking"); + const [authedUser, setAuthedUser] = useState(""); + const [isSetup, setIsSetup] = useState(() => window.location.pathname === "/setup"); + const [setupToken, setSetupToken] = useState( + () => new URLSearchParams(window.location.search).get("token"), + ); + const [loginUsername, setLoginUsername] = useState(""); + const [loginPassword, setLoginPassword] = useState(""); + const [loginError, setLoginError] = useState(""); + const [setupUsername, setSetupUsername] = useState(""); + const [setupPassword, setSetupPassword] = useState(""); + const [setupConfirm, setSetupConfirm] = useState(""); + const [setupError, setSetupError] = useState(""); + const [authBusy, setAuthBusy] = useState(false); + const [theme, setTheme] = useState<"dark" | "light">( + () => (localStorage.getItem("mkvtool-theme") === "light" ? "light" : "dark"), + ); + const [menuOpen, setMenuOpen] = useState(false); + const userMenuRef = useRef(null); - const header = useMemo(() => { - switch (route.name) { - case "dashboard": - return {eyebrow: "DASHBOARD", title: "MKVTool"}; - case "files": - return {eyebrow: "FICHIERS", title: "Gestion des fichiers"}; - case "file": - return {eyebrow: "FICHIERS", title: "Détails du fichier"}; - case "settings": - return {eyebrow: "CONFIGURATION", title: "Configuration"}; + const loadMovies = useCallback(async () => { + setMovies(await api("/api/movies")); + }, []); + + function notify(text: string, kind: NotificationKind = "info") { + setNotifications((current) => [ + { id: ++notificationId.current, text, kind }, + ...current, + ]); + } + + function dismissNotification(id: number) { + setNotifications((current) => current.filter((item) => item.id !== id)); + } + + useEffect(() => { + document.documentElement.dataset.theme = theme; + }, [theme]); + + useEffect(() => { + if (!menuOpen) return; + function onPointerDown(event: MouseEvent) { + if (userMenuRef.current && !userMenuRef.current.contains(event.target as Node)) { + setMenuOpen(false); + } + } + document.addEventListener("mousedown", onPointerDown); + return () => document.removeEventListener("mousedown", onPointerDown); + }, [menuOpen]); + + useEffect(() => { + if (isSetup) { + setAuthState("guest"); + return; + } + api<{ username: string }>("/api/auth/me") + .then((me) => { + setAuthedUser(me.username); + setAuthState("authed"); + }) + .catch(() => setAuthState("guest")); + }, [isSetup]); + + useEffect(() => { + if (authState !== "authed") return; + Promise.all([ + api("/api/settings/radarr"), + api("/api/settings/qbittorrent"), + loadMovies(), + ]) + .then(([radarr, qbittorrent]) => { + setUrl(radarr.url ?? ""); + setKeyConfigured(radarr.api_key_configured); + setQbitUrl(qbittorrent.url ?? ""); + setQbitUsername(qbittorrent.username ?? ""); + setQbitConfigured(qbittorrent.password_configured); + if (!radarr.api_key_configured || !qbittorrent.password_configured) { + notify( + "Configuration incomplète — renseignez les connexions Radarr et qBittorrent dans la page Configuration.", + "warning", + ); } - }, [route.name]); + }) + .catch((error: Error) => { + notify(error.message, "error"); + }); + }, [authState, loadMovies]); - return ( -
- + async function handleLogin(event: FormEvent) { + event.preventDefault(); + setAuthBusy(true); + setLoginError(""); + try { + const me = await api<{ username: string }>("/api/auth/login", { + method: "POST", + headers: jsonHeaders, + body: JSON.stringify({ username: loginUsername, password: loginPassword }), + }); + setAuthedUser(me.username); + setAuthState("authed"); + setLoginPassword(""); + } catch (error) { + setLoginError((error as Error).message); + } finally { + setAuthBusy(false); + } + } -
-
-
-
{header.eyebrow}
-

{header.title}

-
-
+ async function handleSetup(event: FormEvent) { + event.preventDefault(); + if (setupPassword !== setupConfirm) { + setSetupError("Les mots de passe ne correspondent pas."); + return; + } + setAuthBusy(true); + setSetupError(""); + try { + const me = await api<{ username: string }>("/api/auth/setup", { + method: "POST", + headers: jsonHeaders, + body: JSON.stringify({ + token: setupToken, + username: setupUsername, + password: setupPassword, + }), + }); + setIsSetup(false); + setSetupToken(null); + window.history.replaceState(null, "", "/"); + setAuthedUser(me.username); + setAuthState("authed"); + notify("Compte créé — bienvenue sur MKVTool."); + } catch (error) { + setSetupError((error as Error).message); + } finally { + setAuthBusy(false); + } + } - {route.name === "dashboard" && ( - setRoute({name: "file", id})} - onOpenFiles={() => setRoute({name: "files"})} - onOpenSettings={() => setRoute({name: "settings"})} - /> - )} - {route.name === "files" && setRoute({name: "file", id})}/>} - {route.name === "file" && ( - setRoute({name: "files"})}/> - )} - {route.name === "settings" && } -
-
+ async function handleLogout() { + await api("/api/auth/logout", { method: "POST" }).catch(() => undefined); + setAuthState("guest"); + setAuthedUser(""); + setMovies([]); + } + + async function saveSettings(event: FormEvent) { + event.preventDefault(); + setBusy(true); + try { + const settings = await api("/api/settings/radarr", { + method: "PUT", + headers: jsonHeaders, + body: JSON.stringify({ url, api_key: apiKey || null }), + }); + setKeyConfigured(settings.api_key_configured); + setApiKey(""); + const result = await api<{ message: string }>("/api/settings/radarr/test", { + method: "POST", + }); + notify(result.message); + } catch (error) { + notify((error as Error).message, "error"); + } finally { + setBusy(false); + } + } + + async function saveQbittorrent(event: FormEvent) { + event.preventDefault(); + setBusy(true); + try { + const settings = await api("/api/settings/qbittorrent", { + method: "PUT", + headers: jsonHeaders, + body: JSON.stringify({ + url: qbitUrl, + username: qbitUsername, + password: qbitPassword || null, + }), + }); + setQbitConfigured(settings.password_configured); + setQbitPassword(""); + const result = await api<{ message: string }>("/api/settings/qbittorrent/test", { + method: "POST", + }); + notify(result.message); + } catch (error) { + notify((error as Error).message, "error"); + } finally { + setBusy(false); + } + } + + async function scan() { + setBusy(true); + try { + const result = await api<{ iso_files: number; scanned_movies: number }>( + "/api/scans", + { method: "POST" }, + ); + await loadMovies(); + notify(`${result.iso_files} ISO trouvée(s) sur ${result.scanned_movies} film(s)`); + } catch (error) { + notify((error as Error).message, "error"); + } finally { + setBusy(false); + } + } + + const groups = useMemo(() => { + const pick = (statuses: string[]) => + movies.filter((movie) => statuses.includes(movie.status)); + return { + pending: pick(PENDING), + active: pick(ACTIVE), + done: pick(DONE), + broken: pick(BROKEN), + }; + }, [movies]); + + const visible = movies.filter((movie) => inGroup(movie.status, tab)); + const lastDone = [...groups.done].sort( + (a, b) => Date.parse(b.last_seen_at) - Date.parse(a.last_seen_at), + ); + const allVisibleSelected = + visible.length > 0 && visible.every((movie) => selectedIds.includes(movie.id)); + + function toggleSelect(movieId: number) { + setSelectedIds((ids) => + ids.includes(movieId) ? ids.filter((id) => id !== movieId) : [...ids, movieId], ); + } + + function toggleSelectAll() { + setSelectedIds(allVisibleSelected ? [] : visible.map((movie) => movie.id)); + } + + function enterSelectMode() { + setSelectMode(true); + setSelectedIds([]); + } + + function exitSelectMode() { + setSelectMode(false); + setSelectedIds([]); + } + + async function deleteRow(movie: Movie) { + setDeleting(true); + try { + await api(`/api/movies/${movie.id}`, { method: "DELETE" }); + setSelectedIds((ids) => ids.filter((id) => id !== movie.id)); + setConfirmSingle(null); + await loadMovies(); + notify(`« ${movie.title} » retiré de l'inventaire.`); + } catch (error) { + setConfirmSingle(null); + notify((error as Error).message, "error"); + } finally { + setDeleting(false); + } + } + + async function deleteSelection() { + setDeleting(true); + const results = await Promise.allSettled( + selectedIds.map((id) => api(`/api/movies/${id}`, { method: "DELETE" })), + ); + const failures = results.filter((result) => result.status === "rejected").length; + setConfirmBulk(false); + await loadMovies(); + setSelectedIds([]); + const successes = selectedIds.length - failures; + if (failures === 0) { + notify(`${successes} ligne(s) retirée(s) de l'inventaire.`); + } else { + notify(`${successes} supprimée(s), ${failures} en échec — une conversion est peut-être en cours.`, "error"); + } + setDeleting(false); + } + + function openMovie(movie: Movie) { + setSelected(movie); + setPosterUrl(movie.poster_url); + setModalMessage(""); + setModalError(false); + } + + function closeModal() { + setSelected(null); + setPosterUrl(null); + setModalMessage(""); + setModalError(false); + } + + async function convert(movie: Movie) { + setModalBusy(true); + setModalMessage(""); + try { + await api(`/api/movies/${movie.id}/convert`, { method: "POST" }); + await loadMovies(); + setModalMessage("Conversion mise en file d'attente."); + setModalError(false); + closeModal(); + notify(`Conversion de « ${movie.title} » mise en file d'attente.`); + } catch (error) { + setModalMessage((error as Error).message); + setModalError(true); + } finally { + setModalBusy(false); + } + } + + async function validate(movie: Movie, fromModal = false) { + const setError = (text: string) => { + if (fromModal) { + setModalMessage(text); + setModalError(true); + } else { + notify(text, "error"); + } + }; + if (fromModal) setModalBusy(true); + else setValidatingId(movie.id); + try { + await api(`/api/movies/${movie.id}/validate`, { method: "POST" }); + await loadMovies(); + if (fromModal) { + closeModal(); + notify(`« ${movie.title} » validé — ISO supprimée, film complètement converti.`); + } + } catch (error) { + setError((error as Error).message); + } finally { + setModalBusy(false); + setValidatingId(null); + } + } + + async function cancel(movie: Movie) { + setModalBusy(true); + setModalMessage(""); + try { + await api(`/api/movies/${movie.id}/cancel`, { method: "POST" }); + await loadMovies(); + closeModal(); + notify(`Conversion de « ${movie.title} » annulée — MKV et lien supprimés, film remis à « Détecté ».`,); + } catch (error) { + setModalMessage((error as Error).message); + setModalError(true); + } finally { + setModalBusy(false); + } + } + + useEffect(() => { + if (!selected) return; + const onKeyDown = (event: KeyboardEvent) => { + if (event.key === "Escape") closeModal(); + }; + window.addEventListener("keydown", onKeyDown); + return () => window.removeEventListener("keydown", onKeyDown); + }, [selected]); + + const convertible = + selected !== null && CONVERTIBLE.includes(selected.status); + const resuming = selected?.status === "failed"; + + const notificationStack = ( +
+ {[...notifications].reverse().map((notification) => ( +
+
+ ))} +
+ ); + + if (authState === "checking") { + return null; + } + + if (isSetup && authState !== "authed") { + return ( +
+
+

PREMIER LANCEMENT

+

Créer votre compte

+

+ Ce lien ne fonctionne qu’une seule fois. Choisissez un nom d’utilisateur + et un mot de passe (8 caractères minimum) pour administrer MKVTool. +

+ {!setupToken ? ( +

+ Jeton manquant — utilisez le lien complet affiché dans la console du serveur. +

+ ) : ( +
+ + + + +
+ )} + {setupError &&

{setupError}

} +
+ {notifications.length > 0 && notificationStack} +
+ ); + } + + if (authState === "guest") { + return ( +
+
+

MKVTOOL

+

Connexion

+

Connectez-vous pour accéder à vos conversions.

+
+ + + +
+ {loginError &&

{loginError}

} +
+ {notifications.length > 0 && notificationStack} +
+ ); + } + + return ( +
+
+
+

RADARR · ISO → MKV

+

MKVTool

+
+
+ +
+ + {menuOpen && ( +
+

{authedUser}

+ + +
+ )} +
+
+
+ + + + {page === "dashboard" && ( + <> +
+
+ {groups.pending.length} + À traiter +
+
+ {groups.active.length} + En cours +
+
+ {groups.done.length} + Traités +
+
+ {groups.broken.length} + Erreurs +
+
+ +
+
+
+

TABLEAU DE BORD

+

Activité

+
+ Mise à jour automatique +
+
+
+

En cours de traitement

+ {groups.active.length === 0 ? ( +
Aucun traitement en cours.
+ ) : ( +
    + {groups.active.map((movie) => ( +
  • +
    + {movie.title} + {statusLabel(movie.status)} +
    + +
  • + ))} +
+ )} +
+
+

Traitement terminé

+ {lastDone.length === 0 ? ( +
Aucune conversion terminée pour le moment.
+ ) : ( +
    + {lastDone.slice(0, 8).map((movie) => ( +
  • +
    + {movie.title} + {readableSize(movie.size)} +
    + +
  • + ))} +
+ )} +
+
+
+ + )} + + {page === "traitements" && ( +
+
+
+

TRAITEMENTS

+

Films ISO

+
+
+ {movies.length} détecté(s) + {selectMode ? ( + + ) : ( + + )} +
+
+ {selectMode && ( +
+ + {selectedIds.length} sélectionné(s) +
+ +
+ )} + + {visible.length === 0 ? ( +
Aucun film dans cette catégorie.
+ ) : ( +
+ {visible.map((movie) => ( +
+ selectMode ? toggleSelect(movie.id) : openMovie(movie) + } + onKeyDown={(event) => { + if (event.key === "Enter" || event.key === " ") { + event.preventDefault(); + selectMode ? toggleSelect(movie.id) : openMovie(movie); + } + }} + > + {selectMode && ( + toggleSelect(movie.id)} + aria-label={`Sélectionner ${movie.title}`} + /> + )} +
+

{movie.title}

+

{movie.year ?? "Année inconnue"} · {readableSize(movie.size)}

+ {movie.path} +
+
+ {movie.status === "validating" && !selectMode && ( + + )} + {!selectMode && ( + + )} + + {statusLabel(movie.status)} + +
+
+ ))} +
+ )} +
+ )} + + {page === "configuration" && ( + <> +
+
+

CONFIGURATION

+

Connexion Radarr

+

L’URL doit être accessible depuis le conteneur MKVTool.

+
+
+ + + +
+ {keyConfigured &&

Clé API configurée

} +
+ +
+
+

CONFIGURATION

+

Connexion qBittorrent

+

+ Utilisée pour supprimer le torrent et ses données lors de la validation + finale d’une conversion. +

+
+
+ + + + +
+ {qbitConfigured && ( +

Connexion configurée — le torrent sera supprimé à la validation

+ )} +
+ + )} + + {selected && ( +
+
event.stopPropagation()}> +
+
+

FICHE FILM · ISO

+

{selected.title}

+

+ {selected.year ?? "Année inconnue"} · Radarr #{selected.radarr_movie_id} +

+
+ +
+ + {posterUrl ? ( + {`Affiche setPosterUrl(null)} + /> + ) : ( + + )} + +
+
+
État
+
{statusLabel(selected.status)}
+
+
+
Taille de l’ISO
+
{readableSize(selected.size)}
+
+
+
Dernier passage du scan
+
{formatDateTime(selected.last_seen_at)}
+
+
+
Fichier Radarr
+
#{selected.radarr_movie_file_id}
+
+ {selected.completed_at && ( +
+
Fin de traitement
+
{formatDateTime(selected.completed_at)}
+
+ )} + {selected.failed_step && ( +
+
Étape en échec
+
{STEP_LABELS[selected.failed_step] ?? selected.failed_step}
+
+ )} +
+
Emplacement
+
{selected.path}
+
+
+ + {selected.last_error &&

{selected.last_error}

} + +

+ La conversion extrait le film du disque ISO vers un fichier MKV avec MakeMKV, + sans réencodage : vidéo, audio et sous-titres sont conservés à l’identique. + Le MKV est lié dans le dossier du film pour que Jellyfin le détecte. + Rien n’est supprimé automatiquement : après vérification manuelle, + la validation supprime l’ISO et son torrent. +

+ + {modalMessage && ( +

{modalMessage}

+ )} + +
+ {selected.status === "validating" ? ( + <> + + + + ) : ( + + )} +
+ {selected.status === "validating" ? ( +

+ Vérifiez que le MKV s’affiche correctement dans Jellyfin, puis validez : + l’ISO et son torrent seront supprimés et le film passera en « Terminé ». +

+ ) : ( + !convertible && ( +

+ {selected.status === "completed" + ? "Ce film a déjà été converti." + : BLOCKED.includes(selected.status) + ? "Une conversion est déjà en cours pour ce film." + : "Fichier ISO introuvable — relancez un scan."} +

+ ) + )} +
+
+ )} + {confirmSingle && ( +
setConfirmSingle(null)}> +
event.stopPropagation()}> +

SUPPRIMER LA LIGNE

+

{confirmSingle.title}

+

+ Cette action retire le film de l’inventaire MKVTool. Les fichiers présents + sur le disque ne sont pas modifiés. +

+
+ + +
+
+
+ )} + + {confirmBulk && ( +
setConfirmBulk(false)}> +
event.stopPropagation()}> +

SUPPRESSION MULTIPLE

+

{selectedIds.length} ligne(s) sélectionnée(s)

+

+ Ces films seront retirés de l’inventaire MKVTool. Les fichiers présents + sur le disque ne sont pas modifiés. +

+
+ + +
+
+
+ )} + {notifications.length > 0 && notificationStack} +
+ ); } diff --git a/web/src/style.css b/web/src/style.css index 5feaacb..4bf57c8 100644 --- a/web/src/style.css +++ b/web/src/style.css @@ -1,648 +1,552 @@ -/* Premium dark theme */ :root { - font-family: Inter, ui-sans-serif, system-ui, sans-serif; - font-synthesis: none; + font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; + color: #f4f4f5; + background: #09090b; + font-synthesis: none; + color-scheme: dark; - --bg: #070a0f; - --panel: #0d1220; - --panel-2: #0b1020; - --border: rgba(255, 255, 255, 0.08); - --border-2: rgba(255, 255, 255, 0.12); - - --text: #edf1ff; - --muted: rgba(237, 241, 255, 0.68); - - --accent: #7c5cff; /* violet */ - --accent-2: #2ee59d; /* mint */ - --danger: #ff4d6d; - - --shadow: 0 18px 50px rgba(0, 0, 0, 0.55); + --bg: #09090b; + --surface: #101012; + --surface-raised: #17171a; + --border: #26262b; + --border-strong: #3f3f46; + --text: #f4f4f5; + --text-muted: #a1a1aa; + --text-faint: #71717a; + --danger: #f87171; + --danger-soft: #fecaca; + --warning: #facc15; + --warning-soft: #fde68a; + --accent: #fafafa; + --on-accent: #09090b; + --border-hover: #d4d4d8; + --pill: rgba(255, 255, 255, 0.06); + --pill-hover: rgba(255, 255, 255, 0.12); + --glow: rgba(255, 255, 255, 0.03); } -* { - box-sizing: border-box; -} +[data-theme="light"] { + color: #18181b; + background: #fafafa; + color-scheme: light; -body { - margin: 0; - min-width: 320px; - min-height: 100vh; - color: var(--text); - background: radial-gradient(1200px 600px at 20% 0%, rgba(124, 92, 255, 0.16), transparent 60%), - radial-gradient(900px 500px at 90% 10%, rgba(46, 229, 157, 0.12), transparent 55%), - var(--bg); -} - -button, input { - font: inherit; + --bg: #fafafa; + --surface: #ffffff; + --surface-raised: #f4f4f5; + --border: #e4e4e7; + --border-strong: #d4d4d8; + --border-hover: #a1a1aa; + --text: #18181b; + --text-muted: #52525b; + --text-faint: #71717a; + --danger: #dc2626; + --danger-soft: #b91c1c; + --warning: #ca8a04; + --warning-soft: #a16207; + --accent: #18181b; + --on-accent: #fafafa; + --pill: rgba(0, 0, 0, 0.06); + --pill-hover: rgba(0, 0, 0, 0.12); + --glow: rgba(0, 0, 0, 0.04); } +* { box-sizing: border-box; } +body { margin: 0; min-width: 320px; min-height: 100vh; } +button, input { font: inherit; } button { - border: 1px solid var(--border); - border-radius: 12px; - padding: 0.7rem 1rem; - color: var(--text); - background: linear-gradient(180deg, rgba(124, 92, 255, 0.95), rgba(124, 92, 255, 0.78)); - box-shadow: 0 10px 22px rgba(124, 92, 255, 0.18); - font-weight: 750; - cursor: pointer; - transition: transform 120ms ease, filter 120ms ease, background 120ms ease; + border: 1px solid var(--border-strong); + border-radius: 8px; + padding: 0.7rem 1.1rem; + color: var(--text); + background: transparent; + font-weight: 600; + cursor: pointer; + transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease; } - -button:hover:not(:disabled) { - transform: translateY(-1px); - filter: brightness(1.02); +button:hover:not(:disabled) { border-color: var(--border-hover); } +button:disabled { cursor: not-allowed; opacity: 0.4; } +button.primary { + color: var(--on-accent); + background: var(--accent); + border-color: var(--accent); + font-weight: 650; } +button.primary:hover:not(:disabled) { filter: brightness(1.08); } +:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } -button:disabled { - cursor: not-allowed; - opacity: 0.45; +main { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; padding: 3.5rem 0 4rem; } +header, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; } +h1, h2, h3, p { margin-top: 0; } +h1 { + margin-bottom: 0; + font-size: clamp(2.25rem, 6vw, 3.5rem); + font-weight: 700; + letter-spacing: -0.05em; + line-height: 1.05; } - - -/* Layout shell */ -.app-shell { - display: grid; - grid-template-columns: 280px 1fr; - min-height: 100vh; -} - -.content { - padding: 2rem; -} - -.topbar { - display: flex; - align-items: flex-end; - justify-content: space-between; - gap: 1rem; - margin-bottom: 1.5rem; -} - -.page-title { - margin: 0; - font-size: clamp(1.6rem, 2.8vw, 2.2rem); - letter-spacing: -0.04em; -} - -header, .section-title { - display: flex; - align-items: center; - justify-content: space-between; - gap: 1rem; -} - -h1, h2, h3, p { - margin-top: 0; -} - - .eyebrow { - color: rgba(237, 241, 255, 0.62); - font-size: 0.75rem; - font-weight: 800; - letter-spacing: 0.14em; - text-transform: uppercase; + color: var(--text-faint); + font-size: 0.72rem; + font-weight: 700; + letter-spacing: 0.22em; + margin-bottom: 0.6rem; } - -/* Navigation */ -.nav { - position: sticky; - top: 0; - align-self: start; - height: 100vh; - padding: 1.6rem 1.2rem; - border-right: 1px solid var(--border); - background: linear-gradient(180deg, rgba(13, 18, 32, 0.92), rgba(13, 18, 32, 0.72)); - backdrop-filter: blur(10px); +.stats { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1px; + background: var(--border); + border: 1px solid var(--border); + border-radius: 12px; + overflow: hidden; + margin: 2.5rem 0 0; +} +.stat { background: var(--surface); padding: 1.25rem 1.4rem; } +.stat-value { + display: block; + font-size: 2rem; + font-weight: 700; + letter-spacing: -0.03em; + font-variant-numeric: tabular-nums; + line-height: 1.2; +} +.stat-label { + display: block; + margin-top: 0.15rem; + color: var(--text-muted); + font-size: 0.8rem; + letter-spacing: 0.04em; } -.nav__brand { - display: flex; - gap: 0.75rem; - align-items: center; - padding-bottom: 1.2rem; - margin-bottom: 1.2rem; - border-bottom: 1px solid var(--border); +.panel { + margin: 2rem 0 0; + padding: 1.75rem; + border: 1px solid var(--border); + border-radius: 12px; + background: var(--surface); } - -.nav__logo { - width: 42px; - height: 42px; - border-radius: 14px; - display: grid; - place-items: center; - font-weight: 900; - background: radial-gradient(circle at 30% 30%, rgba(124, 92, 255, 0.9), rgba(46, 229, 157, 0.35)); - box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45); -} - -.nav__title { - font-weight: 850; - letter-spacing: -0.02em; -} - -.nav__subtitle { - font-size: 0.85rem; - color: var(--muted); -} - -.nav__items { - display: grid; - gap: 0.5rem; -} - -.nav__item { - display: flex; - align-items: center; - gap: 0.7rem; - text-align: left; - width: 100%; - padding: 0.8rem 0.9rem; - border-radius: 12px; - border: 1px solid transparent; - background: transparent; - color: var(--text); - box-shadow: none; - text-decoration: none; -} - -.nav__item:hover:not(:disabled) { - transform: none; - background: rgba(255, 255, 255, 0.04); - border-color: var(--border); -} - -.nav__item--active { - background: rgba(124, 92, 255, 0.14); - border-color: rgba(124, 92, 255, 0.35); -} - -.nav__icon { - width: 18px; - height: 18px; - opacity: 0.9; -} - -.nav__footer { - margin-top: auto; - padding-top: 1.2rem; - border-top: 1px solid var(--border); - display: grid; - gap: 0.5rem; -} - -form { - display: grid; - align-items: end; - gap: 0.75rem; -} - -form.form-2 { - grid-template-columns: 1fr 1fr auto; -} - -form.form-3 { - grid-template-columns: 1fr 1fr 1fr auto; -} - -form.form-1 { - grid-template-columns: 1fr auto; -} - -label { - display: grid; - gap: 0.4rem; - color: rgba(237, 241, 255, 0.84); - font-size: 0.85rem; -} - -label span { - color: rgba(46, 229, 157, 0.9); -} - +.settings { display: grid; grid-template-columns: 1fr 2fr; gap: 2.5rem; } +.panel-head h2 { font-size: 1.15rem; font-weight: 650; margin-bottom: 0.4rem; } +.settings p, article p { color: var(--text-muted); } +form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 0.75rem; } +form.wide { grid-template-columns: 1fr 1fr 1fr auto; } +label { display: grid; gap: 0.45rem; color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.03em; } input { - width: 100%; - padding: 0.75rem; - color: var(--text); - border: 1px solid var(--border); - border-radius: 12px; - background: rgba(7, 10, 15, 0.75); - outline: none; + width: 100%; + padding: 0.7rem 0.85rem; + color: var(--text); + border: 1px solid var(--border-strong); + border-radius: 8px; + background: var(--bg); + transition: border-color 0.15s ease; } +input::placeholder { color: #52525b; } +input:focus { outline: none; border-color: var(--accent); } +.hint { grid-column: 1 / -1; margin: 0.6rem 0 0; color: var(--text-faint); font-size: 0.8rem; } -input:focus { - border-color: rgba(124, 92, 255, 0.65); - box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18); +.message { + margin: 1.25rem 0 0; + padding: 0.85rem 1.1rem; + border: 1px solid var(--border); + border-left: 3px solid var(--accent); + border-radius: 8px; + background: var(--surface); + font-size: 0.92rem; } +.message.error { border-left-color: var(--danger); color: #fecaca; } -.muted { - color: var(--muted); - font-size: 0.92rem; -} - - -.toast { - position: sticky; - top: 1rem; - z-index: 10; - margin-bottom: 1rem; - padding: 0.9rem 1rem; - border: 1px solid var(--border); - border-radius: 14px; - background: rgba(13, 18, 32, 0.9); - box-shadow: var(--shadow); -} - -.toast--danger { - border-color: rgba(255, 77, 109, 0.35); - background: rgba(255, 77, 109, 0.08); -} - - -.page { - display: grid; - gap: 1rem; -} - -.hero { - padding: 1.4rem; - border-radius: 18px; - border: 1px solid var(--border); - background: linear-gradient(180deg, rgba(13, 18, 32, 0.92), rgba(13, 18, 32, 0.72)); - box-shadow: var(--shadow); -} - -.hero--compact { - padding: 1rem 1.2rem; -} - -.hero__row { - display: flex; - justify-content: space-between; - gap: 1rem; - align-items: flex-start; -} - -.hero__actions { - display: flex; - gap: 0.75rem; - align-items: center; - flex-wrap: wrap; - justify-content: flex-end; -} - -.kpis { - display: grid; - grid-template-columns: repeat(4, 1fr); - gap: 0.75rem; - margin-top: 1rem; -} - -.kpi { - padding: 0.9rem 1rem; - border-radius: 16px; - border: 1px solid var(--border); - background: rgba(7, 10, 15, 0.35); -} - -.kpi__label { - color: var(--muted); - font-size: 0.85rem; -} - -.kpi__value { - font-size: 1.35rem; - font-weight: 850; - letter-spacing: -0.02em; - margin-top: 0.2rem; -} - -.card { - padding: 1.2rem; - border-radius: 18px; - border: 1px solid var(--border); - background: rgba(13, 18, 32, 0.84); - box-shadow: var(--shadow); -} - -.card__head { - display: flex; - justify-content: space-between; - gap: 1rem; - align-items: center; - margin-bottom: 0.75rem; -} - -.grid-2 { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 1rem; -} - -.btn { - border: 1px solid var(--border); -} - -.btn--ghost { - background: rgba(255, 255, 255, 0.04); - box-shadow: none; -} - -.btn--ghost:hover:not(:disabled) { - background: rgba(255, 255, 255, 0.06); -} - -.chip { - display: inline-flex; - align-items: center; - padding: 0.25rem 0.6rem; - border-radius: 999px; - border: 1px solid var(--border); - font-size: 0.75rem; - color: var(--muted); -} - -.chip--subtle { - background: rgba(255, 255, 255, 0.03); -} - -.section-title > span { - color: #91a199; -} - - +.library { margin-top: 3rem; } +.library h2 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; } +.section-title { margin-bottom: 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); } +.section-title > span { color: var(--text-faint); font-size: 0.85rem; font-variant-numeric: tabular-nums; } .empty { - padding: 2rem 1rem; - text-align: center; - color: var(--muted); - border: 1px dashed var(--border-2); - border-radius: 16px; - background: rgba(7, 10, 15, 0.2); + padding: 4rem 1rem; + text-align: center; + color: var(--text-faint); + border: 1px dashed var(--border-strong); + border-radius: 12px; + font-size: 0.95rem; } - -.list { - display: grid; - gap: 0.5rem; -} - -.list__row { - display: flex; - justify-content: space-between; - align-items: center; - gap: 1rem; - width: 100%; - padding: 0.85rem 0.9rem; - border-radius: 14px; - background: rgba(255, 255, 255, 0.03); - border: 1px solid var(--border); - box-shadow: none; -} - -.list__row:hover:not(:disabled) { - transform: none; - background: rgba(255, 255, 255, 0.045); -} - -.list__title { - font-weight: 800; - letter-spacing: -0.01em; -} - -.table { - display: grid; - gap: 0.35rem; -} - -.table__head { - display: grid; - grid-template-columns: 1.2fr 1.7fr 0.6fr 0.6fr; - gap: 0.75rem; - color: var(--muted); - font-size: 0.8rem; - padding: 0.2rem 0.4rem; -} - -.table__row { - display: grid; - grid-template-columns: 1.2fr 1.7fr 0.6fr 0.6fr; - gap: 0.75rem; - width: 100%; - text-align: left; - padding: 0.9rem 0.9rem; - border-radius: 16px; - border: 1px solid var(--border); - background: rgba(255, 255, 255, 0.03); - box-shadow: none; -} - -.table__row:hover:not(:disabled) { - transform: none; - background: rgba(255, 255, 255, 0.045); -} - -.table__title { - font-weight: 850; - letter-spacing: -0.01em; -} - -.table__cell { - display: grid; - gap: 0.2rem; - align-content: start; -} - -.search { - min-width: 260px; -} - -.segmented { - display: inline-flex; - border: 1px solid var(--border); - border-radius: 14px; - padding: 0.25rem; - background: rgba(7, 10, 15, 0.35); - gap: 0.25rem; -} - -.segmented__btn { - padding: 0.45rem 0.65rem; - border-radius: 12px; - background: transparent; - border: 1px solid transparent; - box-shadow: none; - color: var(--muted); -} - -.segmented__btn:hover:not(:disabled) { - transform: none; - background: rgba(255, 255, 255, 0.04); -} - -.segmented__btn--active { - color: var(--text); - border-color: rgba(124, 92, 255, 0.35); - background: rgba(124, 92, 255, 0.14); -} - -.segmented__count { - margin-left: 0.35rem; - display: inline-flex; - align-items: center; - height: 18px; - padding: 0 0.45rem; - border-radius: 999px; - background: rgba(255, 255, 255, 0.06); - border: 1px solid var(--border); - color: var(--text); - font-size: 0.75rem; -} - -.badge { - display: inline-flex; - align-items: center; - height: 22px; - padding: 0 0.55rem; - border-radius: 999px; - font-size: 0.75rem; - font-weight: 800; - border: 1px solid var(--border); - background: rgba(255, 255, 255, 0.03); -} - -.badge--neutral { - color: var(--muted); -} - -.badge--warn { - color: rgba(255, 214, 102, 0.92); - border-color: rgba(255, 214, 102, 0.25); - background: rgba(255, 214, 102, 0.08); -} - -.badge--info { - color: rgba(124, 92, 255, 0.95); - border-color: rgba(124, 92, 255, 0.35); - background: rgba(124, 92, 255, 0.12); -} - -.badge--success { - color: rgba(46, 229, 157, 0.95); - border-color: rgba(46, 229, 157, 0.25); - background: rgba(46, 229, 157, 0.10); -} - -.detail-head { - display: flex; - justify-content: space-between; - gap: 1rem; - align-items: center; -} - -.detail-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 0.75rem; - margin-top: 1rem; -} - -.kv { - padding: 0.9rem; - border-radius: 16px; - border: 1px solid var(--border); - background: rgba(7, 10, 15, 0.25); -} - -.kv__k { - color: var(--muted); - font-size: 0.8rem; - margin-bottom: 0.35rem; -} - -.kv__v { - font-weight: 650; -} - -.skeleton { - height: 120px; - border-radius: 16px; - background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)); - background-size: 200% 100%; - animation: shimmer 1.2s infinite linear; -} - -@keyframes shimmer { - 0% { - background-position: 200% 0; - } - 100% { - background-position: -200% 0; - } -} - -.movie-list { - display: grid; - gap: 0.75rem; -} - +.movie-list { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; } article { - display: flex; - justify-content: space-between; - gap: 1rem; - padding: 1.25rem; - border: 1px solid #26332e; - border-radius: 13px; - background: #111816; + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 1rem; + padding: 1.15rem 1.4rem; + background: var(--surface); + transition: background 0.15s ease; +} +article:hover { background: var(--surface-raised); } +article[role="button"] { cursor: pointer; } +article h3 { margin-bottom: 0.25rem; font-size: 1rem; font-weight: 650; } +article p { margin-bottom: 0.5rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; } +code { color: var(--text-muted); font-size: 0.8rem; overflow-wrap: anywhere; } +.status { + align-self: start; + flex-shrink: 0; + padding: 0.3rem 0.7rem; + color: var(--text); + background: var(--surface-raised); + border: 1px solid var(--border-strong); + border-radius: 999px; + font-size: 0.72rem; + font-weight: 600; + letter-spacing: 0.05em; } -article h3 { - margin-bottom: 0.3rem; +.status.error { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); } + +.row-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; } +button.small { padding: 0.45rem 0.9rem; font-size: 0.85rem; border-radius: 8px; } +button.validate { + color: #4ade80; + border-color: rgba(74, 222, 128, 0.45); +} +button.validate:hover:not(:disabled) { + color: #09090b; + background: #4ade80; + border-color: #4ade80; +} +button.delete-row { color: var(--text-faint); border-color: transparent; } +button.delete-row:hover:not(:disabled) { + color: var(--danger); + border-color: rgba(248, 113, 113, 0.45); } -article p { - margin-bottom: 0.6rem; +.title-actions { display: flex; align-items: center; gap: 0.9rem; } +.bulk-bar { + display: flex; + align-items: center; + gap: 1.25rem; + margin-bottom: 1rem; + padding: 0.85rem 1.1rem; + border: 1px solid var(--border); + border-radius: 10px; + background: var(--surface); } +.bulk-bar .spacer { flex: 1; } +.bulk-count { color: var(--text-muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; } +.check-all { display: flex; align-items: center; gap: 0.55rem; color: var(--text-muted); font-size: 0.88rem; cursor: pointer; } +input[type="checkbox"] { + width: 16px; + height: 16px; + margin: 0; + accent-color: var(--accent); + cursor: pointer; + flex-shrink: 0; +} +article.selected { + background: var(--surface-raised); + box-shadow: inset 2px 0 0 var(--accent); +} +.modal.confirm { width: min(480px, 100%); padding: 1.6rem; } +.modal.confirm h2 { font-size: 1.25rem; margin-bottom: 0.5rem; } -code { - color: rgba(237, 241, 255, 0.75); - overflow-wrap: anywhere; +.notifications { + position: fixed; + right: 1.25rem; + bottom: 1.25rem; + z-index: 80; + display: flex; + flex-direction: column; + width: min(380px, calc(100vw - 2.5rem)); } +.notification { + display: flex; + align-items: flex-start; + gap: 0.7rem; + padding: 0.85rem 0.95rem; + border: 1px solid var(--border-strong); + border-radius: 12px; + background: var(--surface); + box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--glow); + animation: rise 0.2s ease; + transition: margin 0.3s ease; +} +.notification p { + margin: 0; + font-size: 0.9rem; + font-weight: 500; + line-height: 1.45; + overflow-wrap: anywhere; +} +.notification .dot { + flex-shrink: 0; + width: 8px; + height: 8px; + margin-top: 0.35rem; + border-radius: 999px; + background: var(--accent); +} +.notification.error { color: var(--danger-soft); } +.notification.warning { color: var(--warning-soft); } +.notification.error .dot { background: var(--danger); } +.notification.warning .dot { background: var(--warning); } +/* Deck facon sonner: chaque carte est recouverte par la suivante; la plus + recente est devant, en bas, et les anciennes depassent au-dessus. */ +.notification:not(:last-child) { margin-bottom: -2.2rem; } +/* Au survol, la pile se deploie en colonne, de bas en haut. */ +.notifications:hover .notification:not(:last-child) { margin-bottom: 0.55rem; } +.notification-close { + flex-shrink: 0; + padding: 0.1rem 0.55rem; + border: 0; + border-radius: 999px; + color: var(--text-muted); + background: var(--pill); + font-size: 0.95rem; + line-height: 1.3; + cursor: pointer; +} +.notification-close:hover { color: var(--text); background: var(--pill-hover); } + +.header-actions { display: flex; align-items: center; gap: 0.6rem; } + +.auth-main { + width: min(1100px, calc(100% - 2rem)); + min-height: 100vh; + margin: 0 auto; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +.auth-panel { width: min(420px, 100%); padding: 2.5rem; margin: 0; } +.auth-panel h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin-bottom: 0.5rem; } +.auth-sub { color: var(--text-muted); font-size: 0.92rem; line-height: 1.5; margin-bottom: 1.5rem; } +.auth-form { grid-template-columns: 1fr; gap: 1rem; } +.auth-form button { margin-top: 0.5rem; } +.auth-main .notifications { position: fixed; } + +.activity { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1.25rem; +} +.activity-col { + padding: 1.25rem 1.4rem; + border: 1px solid var(--border); + border-radius: 12px; + background: var(--surface); +} +.activity-col h3 { + margin: 0 0 0.9rem; + font-size: 0.78rem; + font-weight: 700; + letter-spacing: 0.14em; + text-transform: uppercase; + color: var(--text-muted); +} +.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; } +.activity-list li { + display: flex; + justify-content: space-between; + align-items: center; + gap: 1rem; + padding: 0.8rem 1rem; + background: var(--bg); +} +.activity-list li > div { display: grid; gap: 0.15rem; min-width: 0; } +.activity-list strong { font-size: 0.92rem; font-weight: 600; overflow-wrap: anywhere; } +.activity-list span { color: var(--text-faint); font-size: 0.78rem; } +.activity-list time { color: var(--text-muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; } + +.pages { + display: flex; + gap: 0.5rem; + flex-wrap: wrap; + margin: 2rem 0 1.5rem; + padding-bottom: 1.1rem; + border-bottom: 1px solid var(--border); +} +.page-link { + display: inline-flex; + align-items: center; + gap: 0.5rem; + padding: 0.5rem 1rem; + border-radius: 999px; + color: var(--text-muted); + font-size: 0.9rem; + font-weight: 600; +} +.page-link:hover:not(.active) { color: var(--text); border-color: var(--border-hover); } +.page-link.active { color: var(--on-accent); background: var(--accent); border-color: var(--accent); } +.page-link .count { font-variant-numeric: tabular-nums; font-size: 0.78rem; opacity: 0.7; } + +.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; } +.tab { + display: inline-flex; + align-items: center; + gap: 0.5rem; + padding: 0.45rem 0.9rem; + border-radius: 999px; + color: var(--text-muted); + font-size: 0.85rem; + font-weight: 600; +} +.tab:hover:not(.active) { color: var(--text); } +.tab.active { color: var(--on-accent); background: var(--accent); border-color: var(--accent); } +.tab .count { font-variant-numeric: tabular-nums; font-size: 0.78rem; opacity: 0.7; } +.empty.small { padding: 1.6rem 1rem; font-size: 0.88rem; border-radius: 8px; } +.panel-head .eyebrow { margin-bottom: 0.3rem; } + +.overlay { + position: fixed; + inset: 0; + z-index: 50; + display: flex; + align-items: center; + justify-content: center; + padding: 1.5rem; + background: rgba(9, 9, 11, 0.78); + backdrop-filter: blur(4px); + animation: fade-in 0.15s ease; +} +.modal { + width: min(680px, 100%); + max-height: calc(100vh - 3rem); + overflow-y: auto; + padding: 2rem; + border: 1px solid var(--border-strong); + border-radius: 16px; + background: var(--surface); + animation: rise 0.18s ease; +} +.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; } +.modal-head h2 { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; } +.modal-head .eyebrow { margin-bottom: 0.3rem; } +.modal-sub { margin: 0; color: var(--text-muted); font-size: 0.9rem; } +.modal-poster { + display: block; + width: 138px; + aspect-ratio: 2 / 3; + object-fit: cover; + margin: 1.5rem auto 0; + border: 1px solid var(--border-strong); + border-radius: 10px; + background: var(--bg); +} +.modal-poster.placeholder { + display: flex; + align-items: center; + justify-content: center; + color: var(--text-faint); + font-size: 2.4rem; + font-weight: 700; +} +.modal-close { flex-shrink: 0; } +.modal-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1px; + background: var(--border); + border: 1px solid var(--border); + border-radius: 10px; + overflow: hidden; + margin: 1.5rem 0 0; +} +.modal-grid > div { background: var(--bg); padding: 0.9rem 1.1rem; } +.modal-grid dt { + color: var(--text-faint); + font-size: 0.72rem; + font-weight: 700; + letter-spacing: 0.12em; + text-transform: uppercase; + margin-bottom: 0.3rem; +} +.modal-grid dd { margin: 0; font-size: 0.95rem; font-variant-numeric: tabular-nums; } +.modal-grid .modal-path { grid-column: 1 / -1; } +.modal-explain { + margin: 1.25rem 0 0; + padding: 1rem 1.15rem; + border-left: 3px solid var(--border-strong); + color: var(--text-muted); + font-size: 0.9rem; + line-height: 1.55; +} +.modal .message { margin: 1.25rem 0 0; } +.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; } +.modal-actions .primary { flex-grow: 1; } +button.danger { + color: var(--danger); + border-color: rgba(248, 113, 113, 0.45); + background: transparent; +} +button.danger:hover:not(:disabled) { + color: var(--on-accent); + background: var(--danger); + border-color: var(--danger); +} +.hint.center { text-align: center; margin-top: 0.75rem; } + +@keyframes fade-in { from { opacity: 0; } } +@keyframes rise { from { opacity: 0; transform: translateY(8px); } } @media (max-width: 800px) { - .app-shell { - grid-template-columns: 1fr; - } + .settings { grid-template-columns: 1fr; gap: 1.25rem; } + form, form.wide { grid-template-columns: 1fr; } + .stats { grid-template-columns: repeat(2, 1fr); } + .activity { grid-template-columns: 1fr; } + .modal-grid { grid-template-columns: 1fr; } + header { align-items: flex-end; } + article { flex-direction: column; gap: 0.75rem; } + article.selected { box-shadow: inset 2px 0 0 var(--accent); } + .bulk-bar { flex-wrap: wrap; gap: 0.75rem; } +} - .nav { - position: relative; - height: auto; - border-right: 0; - border-bottom: 1px solid var(--border); - } - - .grid-2 { - grid-template-columns: 1fr; - } - - .kpis { - grid-template-columns: 1fr 1fr; - } - - .hero__row { - flex-direction: column; - align-items: stretch; - } - - .search { - min-width: 100%; - } - - form.form-2, form.form-3, form.form-1 { - grid-template-columns: 1fr; - } - - .detail-grid { - grid-template-columns: 1fr; - } +.header-actions { display: flex; align-items: center; gap: 0.6rem; } +.user-menu { position: relative; } +.avatar { + width: 2.4rem; + height: 2.4rem; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + border-radius: 999px; + background: var(--surface-raised); + color: var(--text); + font-weight: 700; + font-size: 0.95rem; +} +.avatar:hover:not(:disabled) { border-color: var(--border-hover); } +.user-dropdown { + position: absolute; + right: 0; + top: calc(100% + 0.5rem); + z-index: 90; + min-width: 210px; + padding: 0.5rem; + border: 1px solid var(--border-strong); + border-radius: 12px; + background: var(--surface); + box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); + display: grid; + gap: 0.15rem; + animation: rise 0.15s ease; +} +.user-dropdown .user-name { + margin: 0 0 0.3rem; + padding: 0.45rem 0.7rem 0.55rem; + border-bottom: 1px solid var(--border); + color: var(--text-faint); + font-size: 0.8rem; + font-weight: 600; + letter-spacing: 0.03em; +} +.user-dropdown button { + padding: 0.55rem 0.7rem; + border-color: transparent; + border-radius: 8px; + background: transparent; + color: var(--text); + font-size: 0.9rem; + font-weight: 600; + text-align: left; +} +.user-dropdown button:hover:not(:disabled) { + background: var(--surface-raised); + border-color: transparent; }