/* assets/css/admin.css */

:root {
    --bg-body: #020617;
    --bg-card: #0f172a;
    --accent: #fbbf24;
    --accent-soft: rgba(251, 191, 36, 0.12);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --border-soft: rgba(148, 163, 184, 0.25);
    --danger: #f97373;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}
html {
    scrollbar-gutter: stable;
}
/* Masquer le scroll sur Chrome / Edge */
::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* Masquer le scroll sur Firefox */
html {
    scrollbar-width: none;
}


body {
    min-height: 100vh;
    background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 1.6rem);
}

/* Layout principal */

.app-shell {
    max-width: min(1000px, 100vw);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 1.6rem);
}

.app-header {
    display: flex;
    
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-direction: column;
}

.app-brand {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.app-brand h1 {
    margin: 0;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
}

.app-brand p {
    margin: 0;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    color: var(--text-muted);
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-nav a,
.app-nav button {
    text-decoration: none;
    border: 1px solid var(--border-soft);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
    padding: clamp(0.5rem, 1.2vw, 0.7rem) clamp(0.9rem, 1.8vw, 1.4rem);
    border-radius: 999px;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.app-nav a.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.header-btn {
    background: transparent;
    border: 1px solid var(--border-soft, rgba(148,163,184,0.3));
    padding: 0.5rem 0.8rem;
    border-radius: 0.6rem;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: background 0.2s;
}

.header-btn:hover {
    background: rgba(148,163,184,0.2);
}


/* Cartes */

.card {
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-soft);
    padding: clamp(1.2rem, 2vw, 1.8rem);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.card p {
    margin-top: 0;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
}

/* Formulaires */

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: clamp(0.7rem, 1.6vw, 0.9rem);
    border-radius: 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: #020617;
    color: var(--text-main);
    font-size: 0.95rem;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

button,
.button {
    border-radius: 0.7rem;
    border: none;
    padding: clamp(0.8rem, 1.6vw, 1rem);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    background: linear-gradient(120deg, #fbbf24, #f97316);
    color: #111827;
    text-align: center;
}

button:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Messages */

.alert {
    padding: clamp(0.8rem, 1.5vw, 1rem);
    border-radius: 0.7rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.alert-success {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(22, 163, 74, 0.5);
}

.alert-error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.5);
}

/* Tableau historique */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    vertical-align: top;
}

th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

td small {
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-sent {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

.badge-failed {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
}

/* Pied de page */

.app-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}
