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

:root {
    --bg:       #11100a;
    --surface:  #1a1810;
    --border:   #2f2b1a;
    --accent:   #eab308;
    --accent-h: #facc15;
    --on-accent:#1a1400;
    --green:    #22c55e;
    --red:      #ef4444;
    --text:     #f1eee2;
    --muted:    #a39d84;
    --radius:   12px;
    --shadow:   0 4px 32px rgba(0,0,0,.4);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
}

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

/* ── Layout ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 640px;
    margin: auto;
}

.logo { display: flex; align-items: center; gap: .6rem; margin-bottom: 2rem; }
.logo svg { flex-shrink: 0; }
.logo-text { font-size: 1.35rem; font-weight: 700; letter-spacing: -.5px; }
.logo-text span { color: var(--accent); }

h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; }
h2 { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.subtitle { font-size: .875rem; color: var(--muted); margin-bottom: 2rem; line-height: 1.55; }

.back-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); text-decoration: none; margin-bottom: 1.25rem; }
.back-link:hover { color: var(--text); }

.topnav { display: flex; gap: 1rem; align-items: center; font-size: .8rem; }
.topnav a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.topnav a:hover { color: var(--text); }

/* ── Form ── */
.field { margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
label { display: block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .5rem; }
input[type=text], input[type=email], input[type=url], input[type=number], select {
    width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: .95rem; padding: .75rem 1rem; outline: none; font-family: inherit;
    transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--accent); }
.hint { font-size: .78rem; color: var(--muted); margin-top: .4rem; line-height: 1.5; }

/* ── Button ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--accent); color: var(--on-accent); border: none; border-radius: 8px;
    font-size: .95rem; font-weight: 700; padding: .8rem 1.4rem; cursor: pointer; font-family: inherit;
    transition: background .15s, transform .1s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--accent-h); }
.btn:active { transform: scale(.98); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: transparent; border: 1px solid rgba(239,68,68,.45); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.12); }
.btn-block { width: 100%; }
.btn-sm { font-size: .82rem; padding: .5rem .9rem; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions form { margin: 0; }

/* ── Alert ── */
.alert { border-radius: 8px; padding: .85rem 1rem; font-size: .875rem; margin-bottom: 1.5rem; display: flex; align-items: flex-start; gap: .6rem; line-height: 1.5; }
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert-error   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-info    { background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.3); color: #fde68a; }

/* ── Status pill ── */
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .28rem .65rem; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-up      { background: rgba(34,197,94,.14);  color: var(--green); }
.pill-down    { background: rgba(239,68,68,.14);  color: var(--red); }
.pill-paused  { background: rgba(163,157,132,.15); color: var(--muted); }
.pill-pending { background: rgba(234,179,8,.14);  color: var(--accent); }

/* ── Watch list ── */
.watch-list { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0 0; }
.watch-row {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .85rem 1rem;
    text-decoration: none; color: var(--text); transition: border-color .15s;
}
.watch-row:hover { border-color: var(--accent); }
.watch-url { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-meta { font-size: .76rem; color: var(--muted); margin-top: .2rem; }
.watch-main { min-width: 0; }

/* ── Detail ── */
.url-box {
    font-family: 'Courier New', monospace; font-size: .85rem; word-break: break-all;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; margin: .75rem 0 1.25rem;
}
.url-box a { color: var(--text); text-decoration: none; }
.url-box a:hover { color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1.5rem; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .75rem .9rem; }
.stat-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem; }
.stat-value { font-size: .95rem; font-weight: 700; }

table.history { width: 100%; border-collapse: collapse; font-size: .8rem; }
table.history th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
table.history td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); color: var(--muted); }
table.history td.strong { color: var(--text); }
.tag { font-size: .68rem; font-weight: 700; padding: .15rem .45rem; border-radius: 4px; text-transform: uppercase; }
.tag-change { background: rgba(234,179,8,.15); color: var(--accent); }
.tag-down   { background: rgba(239,68,68,.15); color: var(--red); }
.tag-up     { background: rgba(34,197,94,.15); color: var(--green); }
.table-wrap { overflow-x: auto; }

details.settings { margin: 1.25rem 0; }
details.settings summary { cursor: pointer; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }

footer { margin-top: 2rem; font-size: .78rem; color: var(--muted); text-align: center; max-width: 640px; line-height: 1.5; }

/* ── Petits écrans (mobile) ── */
@media (max-width: 540px) {
    body { padding: 1rem; }
    .card { padding: 1.5rem; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .stats { grid-template-columns: 1fr 1fr; }
    .watch-row { flex-direction: column; align-items: flex-start; }
}

.alert-warn { background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.3); color: #fde68a; }
