* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
body { background: #f2f4f3; color: #1f2a27; }

/* ---------- Login ---------- */
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg,#0f6b5c,#123f38); }
.login-box { background: #fff; padding: 40px; border-radius: 10px; width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,.25); text-align: center; }
.login-box h1 { color: #0f6b5c; margin-bottom: 20px; font-size: 22px; }
.login-box input { width: 100%; padding: 10px; margin-bottom: 12px; border: 1px solid #ccc; border-radius: 6px; }
.login-box button { width: 100%; padding: 10px; background: #e8622c; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }
.login-box button:hover { background: #cf5320; }
.login-error { color: #c0392b; font-size: 13px; margin-bottom: 8px; min-height: 16px; }

/* ---------- Layout général ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: #0f6b5c; color: #fff; padding: 20px 0; flex-shrink: 0; }
.sidebar .logo { text-align: center; margin-bottom: 25px; }
.sidebar .logo .badge { display: inline-block; width: 56px; height: 56px; line-height: 56px; background: #e8622c; border-radius: 50%; font-weight: bold; font-size: 20px; }
.sidebar .logo h2 { margin-top: 10px; font-size: 17px; }
.sidebar .logo p { font-size: 11px; opacity: .75; letter-spacing: 1px; }
.sidebar nav a { display: block; padding: 12px 24px; color: #d7ede8; text-decoration: none; font-size: 14px; border-left: 4px solid transparent; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.08); border-left-color: #e8622c; color: #fff; }
.sidebar .logout { position: absolute; bottom: 20px; width: 230px; text-align: center; }
.sidebar .logout a { color: #ffc9b3; font-size: 13px; text-decoration: none; }

.main { flex: 1; padding: 28px 34px; }
.main header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.main header h1 { font-size: 22px; color: #0f6b5c; }

/* ---------- Cartes dashboard ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card-tile { background: #fff; border-radius: 10px; padding: 22px; text-decoration: none; color: #1f2a27; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden; }
.card-tile:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.card-tile .num { font-size: 34px; font-weight: 800; color: #e8622c; opacity: .35; }
.card-tile h3 { margin-top: 8px; font-size: 16px; color: #0f6b5c; }
.card-tile p { font-size: 12px; color: #667; margin-top: 4px; }

/* ---------- Tableaux ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.btn { padding: 9px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-primary { background: #0f6b5c; color: #fff; }
.btn-accent { background: #e8622c; color: #fff; }
.btn-outline { background: #fff; border: 1px solid #ccc; color: #333; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
th, td { padding: 10px 12px; text-align: right; font-size: 13px; border-bottom: 1px solid #eee; }
th { background: #0f6b5c; color: #fff; position: sticky; top: 0; }
tr:hover td { background: #f7faf9; }
.status-pill { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-prep { background: #fdecd2; color: #a06a00; }
.status-cours { background: #dbeafe; color: #1d4ed8; }
.status-livre { background: #d7f5e3; color: #0f6b5c; }
.status-retard { background: #fbd6d0; color: #c0392b; }

.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); align-items: center; justify-content: center; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: #fff; padding: 24px; border-radius: 10px; width: 380px; max-height: 85vh; overflow-y: auto; }
.modal h3 { margin-bottom: 14px; color: #0f6b5c; }
.modal label { display: block; font-size: 12px; margin: 10px 0 4px; color: #555; }
.modal input, .modal select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 6px; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }

.empty-state { text-align: center; padding: 40px; color: #888; }
