/* VoiceLine Archives — Portail d'administration */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --accent: #e53e3e;
    --success: #38a169;
    --warning: #d69e2e;
    --bg: #f7fafc;
    --card: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* --- Layout --- */

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--primary);
    color: #fff;
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 1rem;
}

.sidebar-brand h2 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-brand small {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
}

.sidebar nav {
    flex: 1;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar nav a.active {
    border-right: 3px solid #fff;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.sidebar-footer button {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.75);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    width: 100%;
    font-size: 0.85rem;
}

.sidebar-footer button:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.main {
    flex: 1;
    margin-left: 240px;
    padding: 2rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.page-header p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* --- Cards --- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.card-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.card-value.green { color: var(--success); }
.card-value.red { color: var(--accent); }
.card-value.orange { color: var(--warning); }

/* --- Tables --- */

.table-container {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.table-header h3 {
    font-size: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--bg);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: #f0f4f8; }

/* --- Badges --- */

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green { background: #c6f6d5; color: #22543d; }
.badge-red { background: #fed7d7; color: #9b2c2c; }
.badge-orange { background: #fefcbf; color: #744210; }
.badge-blue { background: #bee3f8; color: #2a4365; }
.badge-gray { background: #e2e8f0; color: #4a5568; }

/* --- Buttons --- */

.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--accent); color: #fff; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

/* --- Forms --- */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text);
    background: #fff;
}

.form-group textarea { min-height: 80px; resize: vertical; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

/* --- Toggle switch --- */

.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    display: inline-block;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle .slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e0;
    border-radius: 26px;
    cursor: pointer;
    transition: 0.2s;
}

.toggle .slider::before {
    content: "";
    position: absolute;
    width: 20px; height: 20px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle input:checked + .slider { background: var(--success); }
.toggle input:checked + .slider::before { transform: translateX(22px); }

/* --- Login page --- */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--primary);
}

.login-box {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.login-box p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.login-box .btn { width: 100%; padding: 0.75rem; font-size: 1rem; }

.login-error {
    background: #fed7d7;
    color: #9b2c2c;
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    display: none;
}

/* --- Pagination --- */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

/* --- Filters --- */

.filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filters select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

/* --- Modal --- */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--card);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal h3 { margin-bottom: 1rem; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-brand h2, .sidebar-brand small, .sidebar nav a span { display: none; }
    .sidebar nav a { justify-content: center; padding: 0.75rem; }
    .main { margin-left: 60px; padding: 1rem; }
    .cards { grid-template-columns: repeat(2, 1fr); }
}

/* --- Utility --- */

.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
