/* NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  height: 64px;
  padding: 0 24px;

  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

/* LEFT */
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;

  font-weight: 600;
  font-size: 16px;
  color: #111827;
  text-decoration: none;
}

.navbar__logo img {
  height: 65px;
  width: auto;
}

/* RIGHT */
.navbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar__link {
  color: #374151;
  text-decoration: none;
  font-size: 14px;
}

.navbar__link:hover {
  text-decoration: underline;
}

/* UPGRADE BUTTON */
.navbar__upgrade {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;

  background-color: #2563eb;
  color: #ffffff;
  text-decoration: none;

  border-radius: 6px;
}

.navbar__upgrade:hover {
  background-color: #1d4ed8;
}


/* ========== RESET (light) ========== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: #111827;
  background: #f9fafb;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* ========== TOKENS ========== */
:root{
  --bg: #f9fafb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;

  --radius: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08);

  --sidebar-w: 260px;
  --topbar-h: 64px;
}

/* ========== APP LAYOUT ========== */
.app-layout{
  display: flex;
  height: 100vh;
  background: var(--bg);
}

/* LEFT */
.app-sidebar{
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
}

/* RIGHT */
.app-shell{
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* important for overflow/ellipsis */
}



/* MAIN */
.app-main
{
  flex: 1;
  overflow: auto;
}

/* ========== SIDEBAR ========== */
.sidebar
{
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 14px;
}

.sidebar__brand{ padding: 4px 6px; }
.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand__logo{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.brand__name{
  font-weight: 700;
  letter-spacing: .2px;
}

.sidebar__cta{ padding: 0 6px; }

.sidebar__nav{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 6px;
}

.nav-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #374151;
}
.nav-item__icon{
  width: 18px;
  display: inline-grid;
  place-items: center;
  opacity: .8;
}
.nav-item:hover{
  background: #f3f4f6;
}
.nav-item.is-active{
  background: #eef2ff;
  color: #1e3a8a;
  font-weight: 600;
}
.nav-item--muted{
  color: var(--muted);
}

.sidebar__footer{
  margin-top: auto;
  padding: 0 6px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ========== BUTTONS ========== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: #111827;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.btn:hover{
  background: #f3f4f6;
}
.btn--primary{
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn--primary:hover{
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn--ghost{
  background: #fff;
}
.btn--sm{
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 14px;
}
.btn--block{
  width: 100%;
}

/* Icon buttons (topbar arrows) */
.icon-btn{
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}
.icon-btn:hover{
  background: #f3f4f6;
}

/* ========== OPTIONAL: content card helper ========== */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.btn-dark{
  background: #2B2B2B;              /* gris foncé */
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .2s ease, transform .05s ease;
}

.btn-dark:hover{
  background: #1F1F1F;
}

.btn-dark:active{
  transform: translateY(1px);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 980px){
  :root{ --sidebar-w: 220px; }
}
@media (max-width: 820px){
  .app-sidebar{ display: none; } /* simple: hide sidebar on small screens */
  .app-main{ padding: 14px; }
}


#toast-container {
  position: absolute; /* ne modifie pas le layout */
  top: 15px;
  right: 35px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none; /* ne bloque pas les clics sur la page */
}

.toast {
  background: #4caf50;
  color: white;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-family: sans-serif;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(20px);
  animation: toast-in 0.35s forwards, toast-out 0.4s 2.3s forwards;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}


#context-menu-add, #context-menu-mod {
  position: fixed;
  background: white;
  border-radius: 6px;
  padding: 8px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  z-index: 10000;
  min-width: 140px;
  font-family: sans-serif;
}

#context-menu-add div,#context-menu-mod div {
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}

#context-menu-add div:hover,#context-menu-mod div:hover {
  background: #f0f0f0;
}

input[type="text"],input[type="email"],input[type="datetime-local"],input[type="tel"],textarea,select{
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* HOVER (over) */
input[type="text"],input[type="email"],input[type="datetime-local"],input[type="tel"],textarea,select:hover{
  border-color: #3B82F6;
}

/* FOCUS (clic) */
input[type="text"],input[type="email"],input[type="datetime-local"],input[type="tel"],textarea,select:focus{
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.25);
}

/* Placeholder */
input[type="text"],input[type="email"],input[type="datetime-local"],input[type="tel"],textarea,select::placeholder{
  color: #9CA3AF;
}

.loader 
{
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2563EB;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
  margin-top: 10px;
}