@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --ink:        #14273A;
  --terra:      #E07A2E;
  --paper:      #FFFFFF;
  --ink-90:     #1C3348;
  --ink-70:     #4A5866;
  --ink-50:     #7D8FA0;
  --ink-30:     #A8B5C2;
  --ink-15:     #C9D2DB;
  --terra-dark: #B5611E;
  --terra-soft: #F2C8A0;
  --terra-wash: #FDF0E6;
  --sand:       #D9DEE4;
  --sand-soft:  #EEF1F4;

  --bg:           var(--sand-soft);
  --bg-card:      var(--paper);
  --border:       rgba(20,39,58,.10);
  --border-strong:rgba(20,39,58,.22);

  --font: 'Outfit', sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 3px rgba(20,39,58,.06);
  --shadow-md: 0 4px 16px rgba(20,39,58,.09), 0 1px 3px rgba(20,39,58,.05);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a { color: var(--terra); text-decoration: none; }
a:hover { color: var(--terra-dark); }

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}

.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}

.topbar-logo {
  position: relative; width: 28px; height: 28px;
  background: rgba(255,255,255,.12); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.topbar-logo .r { font-size: 17px; font-weight: 800; color: #fff; line-height: 1; margin-top: -1px; margin-left: -2px; }
.topbar-logo .star { position: absolute; right: 1px; top: 1px; }

.topbar-name { font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: .01em; }

.topbar-nav { display: flex; align-items: center; gap: 8px; }
.topbar-nav a {
  font-size: .85rem; font-weight: 500; color: rgba(255,255,255,.6);
  padding: 6px 14px; border-radius: 6px; transition: background .15s, color .15s;
}
.topbar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar-nav .btn-login {
  background: var(--terra); color: #fff; font-weight: 600;
}
.topbar-nav .btn-login:hover { background: var(--terra-dark); }

/* ── MARKETING HERO ── */
.hero {
  padding: 100px 24px 80px;
  text-align: center;
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-90) 100%);
  color: #fff;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(224,122,46,.2); border: 1px solid rgba(224,122,46,.4);
  color: var(--terra-soft); font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: 5px 14px; border-radius: 99px; margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800;
  line-height: 1.12; margin-bottom: 20px;
}
.hero h1 span { color: var(--terra); }

.hero p {
  font-size: 1.1rem; color: rgba(255,255,255,.65);
  max-width: 540px; margin: 0 auto 36px; line-height: 1.65;
}

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .9rem; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(224,122,46,.4); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.btn-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-90); color: #fff; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #b02a37; color: #fff; }
.btn-sm { padding: 7px 16px; font-size: .8rem; }

/* ── APPS GRID ── */
.section { padding: 72px 24px; max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.section-sub { color: var(--ink-50); margin-bottom: 40px; font-size: .95rem; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 28px 24px;
  transition: box-shadow .18s, transform .18s;
  display: flex; flex-direction: column; gap: 12px;
}
.app-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.app-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: #fff; flex-shrink: 0;
}

.app-card h3 { font-size: 1rem; font-weight: 700; }
.app-card p  { font-size: .85rem; color: var(--ink-50); line-height: 1.55; flex: 1; }

.app-card-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; font-weight: 600; color: var(--terra);
  margin-top: 4px;
}
.app-card-link:hover { color: var(--terra-dark); }

/* ── DASHBOARD SIDEBAR LAYOUT ── */
.dash-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.dash-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--ink);
  color: #fff;
  padding: 32px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.sidebar-restaurant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  text-align: center;
}

.sidebar-restaurant-logo {
  max-width: 200px;
  max-height: 100px;
  object-fit: contain;
}

.sidebar-restaurant-name {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.sidebar-badge {
  font-size: .68rem;
  font-weight: 700;
  background: rgba(224,122,46,.25);
  color: var(--terra-soft);
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 20px 0;
}

.sidebar-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-block-alert {
  background: #E07A2E;
  border-radius: 10px;
  padding: 14px;
}

.sidebar-block-alert .sidebar-block-icon { color: rgba(255,255,255,.75); }
.sidebar-block-alert .sidebar-news-item { border-bottom-color: rgba(255,255,255,.15); }
.sidebar-block-alert .sidebar-news-item strong { color: #fff; }
.sidebar-block-alert .sidebar-news-item p { color: rgba(255,255,255,.75); }

.sidebar-block-icon {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.45);
}

.sidebar-block-text {
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  line-height: 1.55;
}

.sidebar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
  border: 1px solid rgba(255,255,255,.12);
  width: 100%;
  text-align: center;
}
.sidebar-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

.sidebar-btn-orange {
  background: #E07A2E;
  border-color: #E07A2E;
}
.sidebar-btn-orange:hover { background: #B5611E; border-color: #B5611E; color: #fff; }

.sidebar-news-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-news-item:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-news-item strong { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 3px; }
.sidebar-news-item p { font-size: .78rem; color: rgba(255,255,255,.5); line-height: 1.5; margin: 0; }

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  padding: 5px 0;
  transition: color .15s;
}
.sidebar-nav-link:hover { color: rgba(255,255,255,.8); }

/* Main content */
.dash-main {
  flex: 1;
  padding: 52px 56px;
  overflow-y: auto;
}

.dash-main-restaurant {
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-30);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dash-main-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 44px;
}

/* App launcher grid */
.launcher-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 44px 36px;
}

.launcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  width: 120px;
}

.launcher-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  transition: transform .18s, box-shadow .18s;
  box-shadow: 0 4px 16px rgba(20,39,58,.12);
}
.launcher-item:hover .launcher-icon {
  transform: scale(1.06) translateY(-3px);
  box-shadow: 0 12px 32px rgba(20,39,58,.2);
}

.launcher-icon-fallback {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 16px rgba(20,39,58,.12);
  transition: transform .18s, box-shadow .18s;
}
.launcher-item:hover .launcher-icon-fallback {
  transform: scale(1.06) translateY(-3px);
  box-shadow: 0 12px 32px rgba(20,39,58,.2);
}

.launcher-label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.3;
}

.launcher-desc {
  font-size: .75rem;
  color: var(--ink-50);
  text-align: center;
  line-height: 1.4;
}

/* Contenu riche (HTML Quill) dans la sidebar */
.sidebar-rich-content { font-size: .8rem; color: rgba(255,255,255,.55); line-height: 1.55; margin-top: 4px; }
.sidebar-rich-content h2, .sidebar-rich-content h3 { font-size: .82rem; font-weight: 700; color: rgba(255,255,255,.85); margin: 8px 0 3px; }
.sidebar-rich-content p { margin: 0 0 5px; }
.sidebar-rich-content ul, .sidebar-rich-content ol { padding-left: 16px; margin: 4px 0; }
.sidebar-rich-content li { margin-bottom: 2px; }
.sidebar-rich-content a { color: var(--terra-soft); }
.sidebar-rich-content strong { color: rgba(255,255,255,.8); font-weight: 600; }

/* ── ADMIN ── */

/* ── ADMIN ── */
.admin-wrap { max-width: 1100px; margin: 40px auto; padding: 0 24px; }

.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px 28px;
  margin-bottom: 24px;
}
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 18px; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--ink-70); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: .73rem; font-weight: 600; letter-spacing: .02em;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red   { background: #fee2e2; color: #b91c1c; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: .83rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-70); }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: .9rem;
  background: var(--paper); color: var(--ink); transition: border-color .15s;
  outline: none;
}
input:focus, select:focus { border-color: var(--terra); }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; border: 1.5px solid var(--border);
  cursor: pointer; font-size: .85rem; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.checkbox-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--terra); }
.checkbox-item:has(input:checked) { border-color: var(--terra); background: var(--terra-wash); }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(150deg, var(--ink) 0%, var(--ink-90) 100%);
}
.login-box {
  background: var(--paper); border-radius: 16px;
  padding: 44px 40px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.login-logo .r-box {
  position: relative; width: 34px; height: 34px; border-radius: 8px;
  background: var(--ink); display: flex; align-items: center; justify-content: center;
}
.login-logo .r-box .r { font-size: 20px; font-weight: 800; color: #fff; margin-top: -1px; margin-left: -2px; }
.login-logo .r-box .star { position: absolute; right: 1px; top: 1px; }
.login-logo .brand-name { font-size: 1.2rem; font-weight: 800; color: var(--ink); }

.login-box h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.login-box p  { color: var(--ink-50); font-size: .88rem; margin-bottom: 28px; }

/* ── FLASH MESSAGES ── */
.flash-list { list-style: none; margin-bottom: 18px; }
.flash {
  padding: 10px 16px; border-radius: 8px; font-size: .88rem; margin-bottom: 8px;
}
.flash-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* ── ERROR PAGE ── */
.error-wrap { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--ink-15); line-height: 1; }
.error-msg  { font-size: 1.1rem; color: var(--ink-70); margin-top: 8px; }

/* ── Hamburger button ── */
.sidebar-toggle-btn {
  background: none; border: none; cursor: pointer; padding: 6px;
  color: rgba(255,255,255,.7); border-radius: 6px; transition: background .15s;
  display: none;
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── Sidebar backdrop (mobile) ── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.sidebar-backdrop.visible { opacity: 1; pointer-events: auto; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero { padding: 64px 16px 56px; }
  .topbar { padding: 0 16px; }
  .login-box { padding: 32px 20px; }
  .apps-grid { grid-template-columns: 1fr; }

  /* Show hamburger */
  .sidebar-toggle-btn { display: flex; align-items: center; justify-content: center; }

  /* Sidebar off-canvas */
  .dash-layout { display: block; }
  .dash-sidebar {
    position: fixed; left: 0; top: 60px; bottom: 0; z-index: 200;
    width: 290px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .dash-sidebar.sidebar-open { transform: translateX(0); }
  .sidebar-backdrop { display: block; pointer-events: none; }

  /* Main full width */
  .dash-main { padding: 28px 20px; }

  /* Launcher grid 3 colonnes */
  .launcher-grid { gap: 28px 20px; }
  .launcher-item { width: 90px; }
  .launcher-icon, .launcher-icon-fallback { width: 90px; height: 90px; border-radius: 22px; }
  .launcher-desc { font-size: .7rem; }
}
