:root {
        --bg: #0f172a; /* slate-900 */
        --panel: #111827; /* gray-900 */
        --card: #111827; /* gray-900 */
        --muted: #94a3b8; /* slate-400 */
        --text: #e5e7eb; /* gray-200 */
        --accent: #22c55e; /* green-500 */
        --accent-2: #60a5fa; /* blue-400 */
        --border: #1f2937; /* gray-800 */
        --input: #0b1220; /* dark */
        --danger: #f43f5e; /* rose-500 */
      }
      * {
        box-sizing: border-box;
      }
      html,
      body {
        height: 100%;
      }
      body {
        margin: 0;
        font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
          Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji",
          "Segoe UI Emoji";
        background: radial-gradient(
            1000px 600px at 10% -10%,
            #1e293b88,
            transparent
          ),
          radial-gradient(800px 500px at 110% -20%, #0ea5e988, transparent),
          var(--bg);
        color: var(--text);
      }
      header {
        position: sticky;
        top: 0;
        z-index: 10;
        backdrop-filter: blur(8px);
        background: #0f172adc;
        border-bottom: 1px solid var(--border);
      }
      .wrap {
        max-width: 1100px;
        margin: 0 auto;
        padding: 16px;
      }
      h1 {
        font-size: 20px;
        margin: 0 0 8px;
      }
      .toolbar {
        display: grid;
        gap: 12px;
        align-items: center;
        grid-template-columns: 1fr auto auto auto auto auto auto;
      }
      .toolbar .left {
        display: flex;
        gap: 10px;
        align-items: center;
      }
      .btn {
        background: linear-gradient(180deg, #1f2937, #0b1220);
        border: 1px solid var(--border);
        color: var(--text);
        padding: 10px 12px;
        border-radius: 12px;
        cursor: pointer;
        transition: transform 0.05s ease, background 0.2s ease,
          border-color 0.2s ease;
        font-weight: 600;
        font-size: 14px;
      }
      .btn:hover {
        transform: translateY(-1px);
        border-color: #334155;
      }
      .btn:active {
        transform: translateY(0);
      }
      .btn.primary {
        border-color: #14532d;
        box-shadow: 0 0 0 1px #14532d inset;
      }
      .btn.ghost {
        background: transparent;
      }
      input[type="week"],
      input[type="file"],
      input[type="number"] {
        background: var(--input);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 10px 12px;
        font-size: 14px;
      }
      input.people {
        width: 60px;
      }
      .status {
        font-size: 12px;
        color: var(--muted);
      }

      main {
        max-width: 1100px;
        margin: 16px auto;
        padding: 16px;
      }
      .card {
        background: linear-gradient(180deg, #0b1220, #0b1220);
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
      }

      table {
        width: 100%;
        border-collapse: collapse;
        min-width: 600px;
      }
      thead th {
        text-align: left;
        font-size: 13px;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: var(--muted);
        background: #0b1220;
        border-bottom: 1px solid var(--border);
        padding: 12px;
      }
      tbody td {
        border-bottom: 1px dashed #1e293b;
      }
      tbody tr:last-child td {
        border-bottom: none;
      }
      tbody th,
      tbody td {
        padding: 10px 12px;
        vertical-align: top;
      }

      .dayname {
        font-weight: 700;
      }
      .meal {
        min-height: 56px;
        border: 1px dashed #243244;
        border-radius: 12px;
        padding: 8px 10px;
        background: #0a1220;
        outline: none;
        white-space: pre-wrap;
      }
      .meal:empty:before {
        content: attr(data-placeholder);
        color: #475569;
      }
      .meal:focus {
        border-color: var(--accent-2);
        box-shadow: 0 0 0 2px #1d4ed81a inset;
      }

      .grid-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }
      .badges {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
      }
      .badge {
        font-size: 12px;
        padding: 6px 8px;
        border-radius: 999px;
        border: 1px solid var(--border);
        color: var(--muted);
        background: #0b1220;
      }
      .badge.success {
        color: #86efac;
        border-color: #14532d;
      }
      .hint {
        color: var(--muted);
        font-size: 13px;
        margin-top: 8px;
      }

      footer {
        max-width: 1100px;
        margin: 0 auto 40px;
        padding: 0 16px;
        color: var(--muted);
      }
      .info {
        margin-top: 8px;
        font-size: 12px;
      }

      @media (max-width: 600px) {
        thead {
          display: none;
        }
        tbody tr {
          display: grid;
          grid-template-columns: 100px 60px 1fr;
          grid-template-areas:
            "day people-lunch lunch"
            "day people-dinner dinner";
          border-bottom: 1px dashed #1e293b;
        }
        tbody tr:last-child {
          border-bottom: none;
        }
        tbody tr td {
          border-bottom: none;
        }
        tbody tr th.dayname {
          grid-area: day;
          align-self: center;
          border-bottom: none;
        }
        tbody tr td:nth-child(2) {
          grid-area: people-lunch;
        }
        tbody tr td:nth-child(3) {
          grid-area: lunch;
        }
        tbody tr td:nth-child(4) {
          grid-area: people-dinner;
        }
        tbody tr td:nth-child(5) {
          grid-area: dinner;
        }
        tbody tr td::before {
          display: block;
          font-weight: 700;
          margin-bottom: 4px;
        }
        tbody tr td:nth-child(2)::before {
          content: "Pers. midi";
        }
        tbody tr td:nth-child(3)::before {
          content: "Midi";
        }
        tbody tr td:nth-child(4)::before {
          content: "Pers. soir";
        }
        tbody tr td:nth-child(5)::before {
          content: "Soir";
        }
      }

      @media print {
        header,
        .grid-actions,
        .hint,
        .print-note {
          display: none !important;
        }
        body {
          background: #ffffff;
          color: #000;
        }
        .card {
          box-shadow: none;
          border: 1px solid #ddd;
        }
        thead th {
          color: #000;
          background: #f8f8f8;
          border-bottom: 1px solid #ddd;
        }
        .meal {
          border: 1px solid #ddd;
        }
        /* Remplacer le placeholder par "-" uniquement à l'impression */
        .meal:empty::before {
          content: "-";
          color: #000;
        }
      }
