/* app/static/css/app.css */

/* ---------- Base body ---------- */
body.tk-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1f2933, #020617);
  color: #e5e7eb;
  min-height: 100vh;
}

/* ---------- Auth card ---------- */
.tk-auth-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.4);
  margin: 40px auto;
}

/* ---------- Logo ---------- */
.tk-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.tk-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: conic-gradient(from 180deg, #f97316, #facc15, #fb923c, #f97316);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.7);
}

.tk-logo-text {
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 1.1rem;
}

.tk-logo-text span {
  color: #f97316;
}

.tk-logo-sub {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #9ca3af;
  padding-top: 5px;
}

.tk-logo-image img {
  width: 42px;
  height: auto;
  display: block;
}

.tk-logotxt-image img {
  width: 130px;
  height: auto;
  display: block;
}

/* ---------- Auth texts ---------- */
.tk-auth-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.tk-auth-subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 24px;
}

/* ---------- Forms ---------- */
.tk-form-group {
  margin-bottom: 16px;
}

.tk-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.tk-input,
.tk-select {
  width: 95%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.95rem;
}

.tk-input:focus,
.tk-select:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.6);
}

/* ---------- Buttons ---------- */
.tk-button,
.tk-button-secondary,
.tk-button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  font-size: 0.85rem;
}

.tk-button {
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #0b1120;
}

.tk-button:hover {
  filter: brightness(1.05);
}

.tk-button-secondary {
  background: transparent;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

.tk-button-secondary:hover {
  background: rgba(15, 23, 42, 0.9);
}

/* ---------- Flash messages ---------- */
.tk-flash-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
}

.tk-flash {
  padding: 10px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  text-align: center;
}

.tk-flash-success {
  background: rgba(22, 163, 74, 0.2);
  color: #bbf7d0;
  border: 1px solid rgba(22, 163, 74, 0.6);
}

.tk-flash-danger {
  background: rgba(220, 38, 38, 0.2);
  color: #fecaca;
  border: 1px solid rgba(220, 38, 38, 0.6);
}

.tk-flash-warning {
  background: rgba(234, 179, 8, 0.2);
  color: #fef3c7;
  border: 1px solid rgba(234, 179, 8, 0.6);
}

.tk-flash-info {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.6);
}

/* ---------- Layout admin ---------- */
.tk-shell {
  display: flex;
  min-height: 100vh;
}

.tk-sidebar {
  width: 250px;
  background: rgba(15, 23, 42, 0.98);
  border-right: 1px solid rgba(31, 41, 55, 0.9);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tk-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tk-sidebar-link {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #e5e7eb;
  text-decoration: none;
}

.tk-sidebar-link:hover {
  background: rgba(31, 41, 55, 0.9);
}

.tk-sidebar-link-active {
  background: rgba(249, 115, 22, 0.1);
  color: #fed7aa;
  border: 1px solid rgba(249, 115, 22, 0.6);
}

.tk-main {
  flex: 1;
  padding: 24px 32px;
}

/* ---------- Header admin ---------- */
.tk-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.tk-main-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.tk-main-subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
}

/* ---------- Cards & tables ---------- */
.tk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.tk-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.tk-card-title {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 6px;
}

.tk-card-value {
  font-size: 1.4rem;
  font-weight: 600;
}

.tk-table-wrapper {
  margin-top: 16px;
  overflow-x: auto;
}

.tk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tk-table th,
.tk-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.tk-table th {
  text-align: left;
  font-weight: 500;
  color: #9ca3af;
}

.tk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.tk-badge-green {
  background: rgba(22, 163, 74, 0.15);
  color: #bbf7d0;
}

.tk-badge-red {
  background: rgba(220, 38, 38, 0.15);
  color: #fecaca;
}

/* ============================================================
   Boutons Danger / Destructive
============================================================ */
.tk-button-danger {
  background: linear-gradient(135deg, #ef4444, #f97373);
  color: #0b1120;
}

.tk-button-danger:hover {
  filter: brightness(1.05);
}

/* Taille XS commune pour tous les boutons si tu l'utilises */
.tk-button-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* ---------- Progress bar upload ---------- */
.tk-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.tk-progress-inner {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #f97316);
  transition: width 0.1s ease;
}

/* ---------- Burger menu (mobile) ---------- */
.tk-burger {
  display: none; /* activé seulement en mobile via @media */
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
}

.tk-burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #e5e7eb;
}

/* État ouvert (optionnel, pour une anim croix plus tard) */
.tk-burger.is-open span:nth-child(2) {
  opacity: 0;
}
.tk-burger.is-open span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
.tk-burger.is-open span:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---------- Layout responsive sidebar ---------- */
@media (max-width: 768px) {
  .tk-shell {
    flex-direction: column;
  }

  .tk-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    max-width: 80%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 40;
    /* on remet un léger fond plein en mobile */
    background: rgba(15, 23, 42, 0.98);
  }

  .tk-sidebar.tk-sidebar-open {
    transform: translateX(0);
  }

  .tk-main {
    padding: 72px 16px 24px; /* espace pour le burger en haut */
  }

  .tk-burger {
    display: inline-flex;
  }
}
