/* =====================================================================
   MIKHMON TABAKOTO — design complet (surcharge des thèmes Mikhmon)
   Palette selon le thème choisi : dark (défaut) / light / blue / green / pink
   ===================================================================== */

/* ---------- Palettes ---------- */
body.tk-dark, body.tk-blue, body.tk-green, body.tk-pink {
  --bg:#0a1120; --bg2:#0f2238; --surface:#111c2e; --surface2:#16243b; --field:#0b1424;
  --border:#22314a; --text:#e8edf5; --muted:#93a1b8; --nav:rgba(12,20,36,.92);
  --shadow:0 12px 32px rgba(0,0,0,.38); --a1:#2dd4bf; --a2:#22c55e; --on:#05201b;
}
body.tk-blue  { --a1:#38bdf8; --a2:#6366f1; --on:#04101f; --bg2:#0d2145; }
body.tk-green { --a1:#4ade80; --a2:#a3e635; --on:#052e16; --bg2:#0d2a1f; }
body.tk-pink  { --a1:#f472b6; --a2:#c084fc; --on:#2a0a1f; --bg2:#2a1236; }
body.tk-light {
  --bg:#eef2f7; --bg2:#dff3f0; --surface:#ffffff; --surface2:#f6f8fb; --field:#f6f8fb;
  --border:#dde4ee; --text:#0f172a; --muted:#64748b; --nav:rgba(255,255,255,.94);
  --shadow:0 10px 28px rgba(15,23,42,.09); --a1:#0d9488; --a2:#16a34a; --on:#ffffff;
}

/* ---------- Base ---------- */
body[class^="tk-"], body[class*=" tk-"] {
  background: radial-gradient(1100px 520px at 85% -8%, var(--bg2), transparent 60%), var(--bg) !important;
  background-attachment: fixed !important;
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
}
body[class*="tk-"] a { color: var(--text); }
body[class*="tk-"] .text-blue { color: var(--a1); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; border: 0; }
::-webkit-scrollbar-thumb { background: var(--border); border: 0; border-radius: 8px; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- Barre du haut ---------- */
body[class*="tk-"] .navbar {
  background: var(--nav); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); height: 52px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
body[class*="tk-"] .navbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--a1), var(--a2)); opacity: .9; pointer-events: none;
}
body[class*="tk-"] .navbar-left a, body[class*="tk-"] .navbar-right a { color: var(--text); padding: 15px 14px; }
body[class*="tk-"] .navbar a:hover { color: var(--a1); }
body[class*="tk-"] .navbar-hover:hover { background: rgba(127,127,127,.12); }
#brand { min-width: 0 !important; white-space: nowrap; font-weight: 800; letter-spacing: .8px; }
#brand::before { content: "\f1eb"; font-family: FontAwesome; margin-right: 8px; color: var(--a1); font-weight: 400; }
.tk-name { background: linear-gradient(90deg, var(--a1), var(--a2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--a1); margin-left: 4px; }
body[class*="tk-"] .ses, body[class*="tk-"] .dropd {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; height: 32px; margin: 10px 4px 0 0; padding: 0 8px;
}
body[class*="tk-"] .ses option { background: var(--surface); color: var(--text); }

/* ---------- Menu latéral ---------- */
body[class*="tk-"] .sidenav {
  background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: 8px 0 30px rgba(0,0,0,.18); margin-top: 52px;
}
#sidenav::before {
  content: "MIKHMON TABAKOTO"; display: block; margin: 12px 8px 8px; padding: 10px 12px;
  border-radius: 12px; font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-align: center; white-space: nowrap;
  color: var(--on); background: linear-gradient(90deg, var(--a1), var(--a2));
}
body[class*="tk-"] .sidenav a, body[class*="tk-"] .dropdown-btn {
  color: var(--text); border-radius: 10px; margin: 3px 8px; width: auto; padding-right: 10px;
}
body[class*="tk-"] .sidenav i { color: var(--muted); font-size: 17px; width: 26px; text-align: center; padding: 8px 4px 8px 6px; }
body[class*="tk-"] .dropdown-btn:hover, body[class*="tk-"] .sidenav a:hover {
  background: rgba(45,212,191,.12); color: var(--a1);
}
body[class*="tk-"] .sidenav a:hover i, body[class*="tk-"] .dropdown-btn:hover i { color: var(--a1); }
body[class*="tk-"] .active {
  background: linear-gradient(90deg, rgba(45,212,191,.20), rgba(34,197,94,.06)); border-radius: 10px;
  box-shadow: inset 3px 0 0 var(--a1);
}
body[class*="tk-"] .active i { color: var(--a1); }
body[class*="tk-"] .sidenav .card-header { background: transparent; border: 0; border-radius: 10px; color: var(--muted); }
body[class*="tk-"] .spa { border-bottom: 1px solid var(--border); margin: 6px 12px; }

/* ---------- Cartes & tuiles ---------- */
body[class*="tk-"] #main { margin-top: 62px; }
body[class*="tk-"] .main-container { padding: 6px 8px 6px 10px; }
body[class*="tk-"] .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); margin: 8px 6px; overflow: hidden;
}
body[class*="tk-"] .card-header {
  background: var(--surface2); border-bottom: 1px solid var(--border); border-radius: 0;
  padding: 11px 16px; margin: 0 0 6px; position: relative;
}
body[class*="tk-"] .card-header::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--a1), var(--a2));
}
body[class*="tk-"] .card-header h3, body[class*="tk-"] .card-title { font-size: 15px; font-weight: 700; letter-spacing: .3px; color: var(--text); }
body[class*="tk-"] .card-header i { color: var(--a1); }
body[class*="tk-"] .card-body { padding: 8px 16px 12px; }

body[class*="tk-"] .box {
  border-radius: 16px; border: 0; margin: 8px 6px; box-shadow: var(--shadow);
  background-image: linear-gradient(135deg, rgba(255,255,255,.20), rgba(0,0,0,.10));
  color: #fff; transition: transform .18s ease;
}
body[class*="tk-"] .box:hover { transform: translateY(-2px); }
body[class*="tk-"] .box, body[class*="tk-"] .box a, body[class*="tk-"] .box h1, body[class*="tk-"] .box h3 { color: #fff; }
body[class*="tk-"] .box-bordered { border: 0; }
body[class*="tk-"] .box-group-icon { border-radius: 14px; background: rgba(255,255,255,.18); }
body[class*="tk-"] .bg-primary, body[class*="tk-"] .bg-blue { background-color: var(--a1); }
body[class*="tk-"] .bg-primary { color: var(--on); }
body[class*="tk-"] .bg-light-blue { background-color: #38bdf8; }
body[class*="tk-"] .bg-green { background-color: #22c55e; }
body[class*="tk-"] .bg-red, body[class*="tk-"] .bg-danger { background-color: #ef4444; }
body[class*="tk-"] .bg-yellow, body[class*="tk-"] .bg-warning { background-color: #f59e0b; }
body[class*="tk-"] .bg-teal { background-color: #14b8a6; }
body[class*="tk-"] .bg-indigo { background-color: #6366f1; }
body[class*="tk-"] .bg-purple { background-color: #8b5cf6; }
body[class*="tk-"] .bg-pink { background-color: #ec4899; }
body[class*="tk-"] .bg-cyan { background-color: #06b6d4; }

/* ---------- Tableaux ---------- */
body[class*="tk-"] .table { border-collapse: separate !important; border-spacing: 0; }
body[class*="tk-"] .table th {
  background: var(--surface2); color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .7px; font-weight: 700; padding: 10px 8px; text-align: left;
}
body[class*="tk-"] .table td { color: var(--text); padding: 8px; border-bottom: 1px solid var(--border); }
body[class*="tk-"] .table-bordered td, body[class*="tk-"] .table-bordered th { border: 0 !important; border-bottom: 1px solid var(--border) !important; }
body[class*="tk-"] .table-hover:hover tbody tr:hover, body[class*="tk-"] .table tbody tr:hover { background: rgba(45,212,191,.07); }
body[class*="tk-"] .overflow { border-radius: 12px; }

/* ---------- Champs & boutons ---------- */
body[class*="tk-"] .form-control, body[class*="tk-"] .group-item, body[class*="tk-"] select,
body[class*="tk-"] textarea, body[class*="tk-"] input[type=text], body[class*="tk-"] input[type=password],
body[class*="tk-"] input[type=number], body[class*="tk-"] input[type=search], body[class*="tk-"] input[type=date] {
  background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  min-height: 34px; outline: none;
}
body[class*="tk-"] .form-control:focus, body[class*="tk-"] .group-item:focus, body[class*="tk-"] select:focus,
body[class*="tk-"] textarea:focus, body[class*="tk-"] input:focus {
  border-color: var(--a1); box-shadow: 0 0 0 3px rgba(45,212,191,.18);
}
body[class*="tk-"] input[type=submit], body[class*="tk-"] .btn-login, body[class*="tk-"] button.btn {
  background: linear-gradient(90deg, var(--a1), var(--a2)); color: var(--on); font-weight: 700;
  border: 0; border-radius: 10px; cursor: pointer;
}
body[class*="tk-"] input[type=submit]:hover, body[class*="tk-"] .btn:hover { filter: brightness(1.08); }
body[class*="tk-"] .btn { border-radius: 10px; font-weight: 600; }
body[class*="tk-"] .pointer.btn, body[class*="tk-"] .btn.bg-primary { color: var(--on); }
body[class*="tk-"] .progress { background: var(--surface2); border-radius: 8px; }
body[class*="tk-"] .progress-bar-blue { background: linear-gradient(90deg, var(--a1), var(--a2)); }
body[class*="tk-"] #notify {
  background: var(--surface); color: var(--text); border: 1px solid var(--a1); border-radius: 12px; box-shadow: var(--shadow);
}
.lds-dual-ring:after { border-color: var(--a1) transparent var(--a1) transparent !important; }

/* ---------- Pied de page ---------- */
body[class*="tk-"] #main::after {
  content: "MIKHMON TABAKOTO  \00B7  Gestion Hotspot MikroTik"; display: block; text-align: center;
  padding: 22px 0 30px; color: var(--muted); font-size: 12px; letter-spacing: 1.2px;
}

/* ---------- Page de connexion ---------- */
.tk-login { width: 100%; max-width: 430px; margin: 0 auto; padding: 9% 14px 20px; box-sizing: border-box; }
.tk-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 30px 26px 24px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(45,212,191,.08); text-align: center; color: var(--text); position: relative; overflow: hidden;
}
.tk-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.tk-logo img { width: 68px; height: 68px; border-radius: 18px; box-shadow: 0 8px 22px rgba(45,212,191,.28); }
.tk-title { font-size: 29px; margin: 16px 0 2px; letter-spacing: 1px; font-weight: 800; color: var(--text); }
.tk-title span { background: linear-gradient(90deg, var(--a1), var(--a2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--a1); }
.tk-sub { margin: 0 0 24px; font-size: 13px; color: var(--muted); }

/* ---------- Champs & fenêtre de connexion routeur ---------- */
.tk-field { position: relative; margin-bottom: 14px; text-align: left; }
.tk-field > i.fa { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
body .tk-field input {
  width: 100%; box-sizing: border-box; height: 46px; padding: 0 42px 0 40px; background: var(--field); color: var(--text);
  font-size: 16px; border: 1px solid var(--border); border-radius: 12px; outline: none;
}
body .tk-field input:focus { border-color: var(--a1); box-shadow: 0 0 0 3px rgba(45,212,191,.18); }
.tk-eye { position: absolute; right: 0; top: 0; height: 46px; width: 42px; line-height: 46px; text-align: center; color: var(--muted); cursor: pointer; }
.tk-btn {
  width: 100%; height: 48px; margin-top: 6px; border: 0; border-radius: 12px; cursor: pointer; font-size: 16px; font-weight: 800;
  color: var(--on); background: linear-gradient(90deg, var(--a1), var(--a2)); box-shadow: 0 10px 22px rgba(45,212,191,.22);
}
.tk-btn:hover { filter: brightness(1.08); }
.tk-err-wrap { margin-top: 12px; font-size: 13px; }
.tk-err { margin: 4px 0 10px; padding: 9px 11px; border-radius: 10px; font-size: 13px; text-align: left; background: rgba(239,68,68,.14); color: #f87171; border: 1px solid rgba(239,68,68,.4); }

.tk-overlay {
  position: fixed; inset: 0; z-index: 1000; overflow-y: auto; background: rgba(4,9,18,.78);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: flex-start; justify-content: center; padding: 64px 14px 24px; box-sizing: border-box;
}
.tk-modal {
  width: 100%; max-width: 450px; margin: auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 22px; padding: 26px 22px 18px; box-shadow: 0 30px 70px rgba(0,0,0,.5);
  position: relative; overflow: hidden; animation: tkpop .25s ease-out;
}
.tk-modal::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
@keyframes tkpop { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.tk-modal-head { text-align: center; margin-bottom: 16px; }
.tk-ico { width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%; background: rgba(45,212,191,.14); color: var(--a1); font-size: 26px; line-height: 58px; }
.tk-modal-head h3 { margin: 0 0 6px; font-size: 21px; color: var(--text); }
.tk-modal-head p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.tk-label { display: block; margin: 0 0 5px 2px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tk-section { margin: 16px 0 10px; padding-bottom: 6px; font-size: 13px; font-weight: 800; color: var(--a1); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .7px; }
.tk-modal-head + form .tk-section:first-child { margin-top: 0; }
.tk-note { margin-top: 12px; font-size: 12px; color: var(--muted); text-align: center; }
.tk-links { margin-top: 10px; text-align: center; font-size: 13px; }
.tk-links a { color: var(--a1); text-decoration: none; }

/* Fond de la page de connexion (classe ajoutée par login.php) */
body.tk-loginpage { background: radial-gradient(700px 420px at 15% 10%, rgba(45,212,191,.18), transparent 60%),
  radial-gradient(700px 480px at 90% 90%, rgba(99,102,241,.18), transparent 60%), var(--bg) !important; background-attachment: fixed !important; }
body.tk-loginpage #main::after { display: none; }

@media (max-width: 576px) {
  .tk-login { padding-top: 6%; }
  .tk-title { font-size: 25px; }
}
