/* Interfaces sur mesure des énigmes (annuaire, relevé, serre, frigo, ardoise).
   Chacune a son univers visuel ; couleurs locales volontairement (pas le thème du HUD). */

/* ================= Annuaire : intranet de la GIA sur un vieil écran ================= */
.ann { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; align-items: start; width: min(1180px, 97vw); }
.ann-monitor { position: relative; background: #d8cfb8; border-radius: 18px; padding: 18px 18px 26px; box-shadow: 0 24px 70px #000d, inset 0 -6px 0 #b9ae94; }
.ann-screen { background: #f3f5f8; color: #1d2633; border-radius: 6px; height: min(70vh, 620px); display: flex; flex-direction: column; overflow: hidden; font: 13px "Segoe UI", Tahoma, sans-serif; box-shadow: inset 0 0 30px #0002; }
.ann-top { display: flex; align-items: center; gap: 16px; background: #0d2b4a; color: #cfe0f5; padding: 8px 12px; }
.ann-logo b { color: #d9a441; font: bold 1.1rem Georgia, serif; }
.ann-tabs { display: flex; gap: 4px; }
.ann-tabs button { background: transparent; color: #cfe0f5; border: 1px solid #ffffff33; border-radius: 4px; padding: 4px 10px; cursor: pointer; font: inherit; }
.ann-tabs button.on { background: #f3f5f8; color: #0d2b4a; }
.ann-url { margin-left: auto; font: 11px Consolas, monospace; opacity: .7; }
.ann-body { flex: 1; min-height: 0; display: flex; }
.ann-dir, .ann-sql { flex: 1; display: flex; min-height: 0; }
.ann-services, .ann-schema { width: 200px; flex-shrink: 0; background: #e3e8ef; overflow: auto; padding: 8px; }
.ann-services h4, .ann-schema h4 { margin: 4px 4px 8px; color: #0d2b4a; }
.ann-services button { display: flex; justify-content: space-between; width: 100%; text-align: left; background: none; border: none; border-radius: 4px; padding: 5px 8px; cursor: pointer; font: inherit; color: inherit; }
.ann-services button.on, .ann-services button:hover { background: #c9d6e6; }
.ann-services small { color: #667; }
.ann-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 10px; gap: 8px; overflow: hidden; }
.ann-search { padding: 7px 10px; border: 1px solid #b8c4d4; border-radius: 4px; font: inherit; }
.ann-count { color: #667; font-size: 12px; }
.ann-cards { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; align-content: start; }
.ann-card { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid #d5dde8; border-radius: 6px; padding: 8px; line-height: 1.35; }
.ann-card span { color: #556; font-size: 12px; }
.ann-card .ann-tel { color: #0d5a2e; font-weight: 600; }
.ann-avatar { width: 42px; height: 42px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.ann-table { margin-bottom: 10px; }
.ann-table b { color: #0d2b4a; font-family: Consolas, monospace; }
.ann-table ul { margin: 2px 0 0; padding-left: 16px; font: 12px Consolas, monospace; }
.ann-table i { color: #8a94a3; font-style: normal; }
.ann-editor-bar { display: flex; justify-content: space-between; align-items: center; color: #556; }
.ann-run { background: #0d5a2e; color: #fff; border: none; border-radius: 4px; padding: 5px 12px; cursor: pointer; font: inherit; }
.ann-editor { height: 120px; resize: vertical; font: 13px/1.5 Consolas, monospace; padding: 8px; border: 1px solid #b8c4d4; border-radius: 4px; background: #fbfcfe; color: #1d2633; }
.ann-status { font-size: 12px; color: #556; min-height: 1.2em; }
.ann-status.err { color: #b3261e; }
.ann-result { flex: 1; overflow: auto; border: 1px solid #d5dde8; background: #fff; }
.ann-result table { border-collapse: collapse; font: 12px Consolas, monospace; width: max-content; min-width: 100%; }
.ann-result th { position: sticky; top: 0; background: #0d2b4a; color: #fff; padding: 4px 8px; text-align: left; }
.ann-result td { padding: 3px 8px; border-bottom: 1px solid #edf0f4; white-space: nowrap; }
.ann-result tr:nth-child(even) td { background: #f6f8fb; }
.ann-postit { position: absolute; right: -14px; top: -16px; width: 130px; background: #f5e663; color: #3a3410; padding: 10px; transform: rotate(5deg); box-shadow: 3px 4px 10px #0005; font: 14px/1.35 "Segoe Print", "Bradley Hand", cursive; }
.ann-phone { background: #23272b; border-radius: 14px; padding: 12px; box-shadow: 0 16px 40px #000c; color: #dfe6ee; }
.ann-phone-screen { background: #9fb59a; color: #1c2a1a; font: 18px Consolas, monospace; padding: 8px; border-radius: 4px; text-align: right; min-height: 1.4em; letter-spacing: 2px; }
.ann-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.ann-keys button, .ann-phone-actions button { background: #3a4047; color: #fff; border: none; border-radius: 6px; padding: 8px 0; font: 600 1rem "Segoe UI", sans-serif; cursor: pointer; }
.ann-keys button:active { background: #556; }
.ann-phone-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; }
.ann-call { background: #2e7d32 !important; }
.ann-hang { background: #b3261e !important; }
.ann-call:disabled { opacity: .45; }
.ann-phone-msg { font-size: .78rem; margin-top: 8px; min-height: 1.2em; }
.ann-phone-msg.err { color: #ff9a9e; }
.ann-phone-msg.ok { color: #7ee787; }
.ann-close { grid-column: 1 / -1; justify-self: center; }

/* ================= Relevé : faux tableur sur fond de relevé bancaire ================= */
.xl { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 14px; width: min(1220px, 98vw); align-items: start; }
.xl-window { position: relative; background: #fff; color: #1b1b1b; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 70px #000d; font: 12px "Segoe UI", Tahoma, sans-serif; display: flex; flex-direction: column; height: min(86vh, 760px); }
.xl-titlebar { background: #217346; color: #fff; padding: 6px 12px; font-size: 12px; }
.xl-ribbon { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: #f3f3f3; border-bottom: 1px solid #d6d6d6; padding: 6px 8px; }
.xl-ribbon button { background: #fff; border: 1px solid #c8c8c8; border-radius: 3px; padding: 4px 9px; cursor: pointer; font: inherit; }
.xl-ribbon button:hover { border-color: #217346; background: #e9f5ee; }
.xl-selinfo { margin-left: auto; color: #217346; font-weight: 600; }
.xl-panel { background: #fff8e1; border-bottom: 1px solid #e6d9a8; padding: 6px 10px; }
.xl-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.xl-form input:not([type=checkbox]), .xl-form select { font: inherit; padding: 3px 6px; border: 1px solid #bbb; border-radius: 3px; }
.xl-form button { font: inherit; padding: 3px 10px; border: 1px solid #217346; background: #217346; color: #fff; border-radius: 3px; cursor: pointer; }
.xl-form button[data-x] { background: #fff; color: #333; border-color: #bbb; }
.xl-flash { color: #6a5300; padding: 2px 0; }
.xl-chk { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.xl-doc { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 18px 10px; background: #fff; }
.xl-bank { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; margin-bottom: 10px; }
.xl-bank-logo { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.xl-bank-logo span { width: 46px; height: 46px; background: #111; color: #fff; display: grid; place-items: center; font: 900 30px Georgia, serif; }
.xl-bank-logo b { font: 900 20px Arial, sans-serif; letter-spacing: .5px; }
.xl-bank-title { text-align: right; font-weight: 600; }
.xl-bank-title small { font-weight: 400; color: #444; }
.xl-bank-holder { font-size: 12px; }
.xl-bank-note { align-self: end; text-align: right; background: #2b4fd8; color: #fff; padding: 4px 8px; font-weight: 600; }
.xl-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid #c8c8c8; }
.xl-head, .xl-row { display: grid; grid-template-columns: 46px 104px minmax(160px, 1fr) 120px 96px 96px 70px; }
.xl-head { background: #2b4fd8; color: #fff; font-weight: 600; }
.xl-hc { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; border-left: 1px solid #ffffff44; cursor: pointer; }
.xl-hc.sel { background: #17339f; box-shadow: inset 0 -3px 0 #ffd54f; }
.xl-hc.filt button { color: #ffd54f; }
.xl-hc i { font-style: normal; font-size: 10px; opacity: .85; }
.xl-hc button { background: none; border: none; color: #fff; cursor: pointer; font-size: 12px; }
.xl-scroll { flex: 1; overflow-y: auto; position: relative; }
.xl-spacer { position: relative; }
.xl-rows { position: absolute; left: 0; right: 0; top: 0; }
.xl-row { height: 24px; }
.xl-row.odd { background: #dfe8ff; }
.xl-rn { background: #eef0f3; color: #777; text-align: right; padding: 0 6px; line-height: 24px; border-right: 1px solid #d6d6d6; font-size: 11px; }
.xl-head .xl-rn { background: #1f3fbf; }
.xl-c { padding: 0 6px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid #e3e6ee; }
.xl-c.r { text-align: right; }
.xl-c.err { color: #c00; font-weight: 600; }
.xl-c.sel { background: #fff3c4aa; }
.xl-status { background: #217346; color: #fff; padding: 4px 12px; font-size: 12px; white-space: pre; }
.xl-pop { position: absolute; z-index: 5; width: 280px; background: #fff; border: 1px solid #aaa; border-radius: 4px; box-shadow: 0 8px 24px #0004; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.xl-sort { display: flex; gap: 6px; }
.xl-sort button, .xl-pbtns button { flex: 1; font: inherit; padding: 4px; border: 1px solid #bbb; background: #f6f6f6; border-radius: 3px; cursor: pointer; }
.xl-pbtns button[data-ok] { background: #217346; color: #fff; border-color: #217346; }
.xl-psearch, .xl-range input { font: inherit; padding: 4px 6px; border: 1px solid #bbb; border-radius: 3px; width: 100%; box-sizing: border-box; }
.xl-plist { max-height: 220px; overflow: auto; border: 1px solid #e3e3e3; padding: 4px; }
.xl-plist small { color: #888; margin-left: auto; }
.xl-pbtns { display: flex; gap: 6px; }
.xl-range { display: grid; gap: 6px; }
.xl-range.bad input { border-color: #c00; }
.xl-side { display: flex; flex-direction: column; gap: 16px; }
.xl-postit { background: #f5e663; color: #3a3410; padding: 12px; transform: rotate(-3deg); box-shadow: 3px 4px 10px #0006; font: 14px/1.4 "Segoe Print", "Bradley Hand", cursive; }
.xl-safe { background: #3c4146; border-radius: 10px; padding: 12px; box-shadow: 0 16px 40px #000c, inset 0 0 0 4px #2d3236; }
.xl-safe-door { background: #50565c; border-radius: 6px; padding: 10px; }
.xl-safe-screen { background: #10251a; color: #57f287; font: 22px Consolas, monospace; text-align: center; padding: 6px; border-radius: 4px; letter-spacing: 3px; }
.xl-safe-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.xl-safe-keys button { background: #2a2e33; color: #e6e9ef; border: 1px solid #1c1f22; border-radius: 4px; padding: 7px 0; font: 600 1rem Consolas, monospace; cursor: pointer; }
.xl-safe-keys button.ok { background: #2e7d32; }
.xl-safe-keys button:disabled { opacity: .4; }
.xl-safe-msg { color: #dfe6ee; font-size: .78rem; margin-top: 8px; min-height: 1.2em; }
.xl-safe-msg.err { color: #ff9a9e; }
.xl-safe-msg.ok { color: #7ee787; }
.xl-safe.open .xl-safe-door { transform: perspective(500px) rotateY(-35deg); transform-origin: left; transition: transform 1s; }
.xl-close { grid-column: 1 / -1; justify-self: center; }

/* ================= Serre connectée ================= */
.serre { width: min(1180px, 97vw); background: #16211a; color: #dfeedd; border-radius: 12px; box-shadow: 0 24px 70px #000d; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; max-height: 94vh; }
.serre-top { display: flex; justify-content: space-between; align-items: center; }
.serre-logo { font: 700 1.1rem "Segoe UI", sans-serif; color: #7ee787; }
.serre-logo small { color: #9ab79a; font-weight: 400; }
.serre-levels { display: flex; gap: 6px; }
.serre-levels button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #3d5a3f; background: #1f2d22; color: #dfeedd; font-weight: 700; cursor: pointer; }
.serre-levels button.on { border-color: #7ee787; }
.serre-levels button.ok { background: #2e7d32; }
.serre-levels button:disabled { opacity: .35; cursor: default; }
.serre-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; min-height: 0; }
.serre-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.serre-title { margin: 0; color: #a5f2a8; }
.serre-text { margin: 0; line-height: 1.5; color: #cfe3cd; }
.serre-code { background: #0d1410; border: 1px solid #2c3e2f; border-radius: 6px; font: 14px/1.5 Consolas, monospace; overflow: auto; }
.serre-fixed { margin: 0; padding: 4px 12px; color: #7a8f7c; white-space: pre-wrap; }
.serre-editor { display: block; width: 100%; box-sizing: border-box; border: none; border-top: 1px dashed #2c3e2f; border-bottom: 1px dashed #2c3e2f; background: #1c2a20; color: #e8ffe6; font: inherit; padding: 4px 12px; resize: none; outline: none; caret-color: #7ee787; }
.serre-actions { display: flex; align-items: center; gap: 12px; }
.serre-go { background: #1565c0; color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font: 600 1rem "Segoe UI", sans-serif; cursor: pointer; }
.serre-go:disabled { opacity: .45; cursor: default; }
.serre-msg { font-size: .88rem; }
.serre-msg.err { color: #ff9a9e; }
.serre-msg.ok { color: #7ee787; }
.serre-right { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.serre-label { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; color: #9ab79a; }
.serre-preview, .serre-goal { width: 100%; border: 2px solid #2c3e2f; border-radius: 6px; background: #cfe8c4; }
.serre-preview { height: min(34vh, 300px); }
.serre-goal { height: min(24vh, 210px); opacity: .85; pointer-events: none; }
.serre-close { align-self: center; }

/* ================= Frigo ================= */
.frigo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.frigo-body { position: relative; width: min(620px, 94vw); height: min(78vh, 640px); perspective: 1400px; }
.frigo-inside { position: absolute; inset: 0; background: linear-gradient(#f4f8fb, #dfe8ee); border-radius: 26px; box-shadow: inset 0 0 40px #0003, 0 24px 70px #000d; padding: 40px 30px; display: flex; flex-direction: column; gap: 90px; }
.frigo-shelf { height: 8px; background: #c9d6df; border-radius: 4px; }
.frigo-proof { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 70%; text-align: center; color: #1d2633; }
.frigo-env { font-size: 4rem; }
.frigo-proof-text { font: 1rem Georgia, serif; background: #fffbe8; padding: 12px; border-radius: 4px; box-shadow: 0 4px 12px #0003; }
.frigo-door {
  position: absolute; inset: 0; border-radius: 26px; background: linear-gradient(135deg, #f2ead6, #e2d6b8); box-shadow: 0 24px 70px #000d, inset -8px 0 0 #d4c7a6;
  transform-origin: left center; transition: transform 1.4s cubic-bezier(.3, .8, .3, 1); padding: 30px 30px 20px; display: flex; flex-direction: column; gap: 14px; backface-visibility: hidden;
}
.frigo.open .frigo-door { transform: rotateY(-108deg); }
.frigo-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; flex: 1; align-content: start; }
.frigo-card { position: relative; background: #fff; padding: 10px 10px 12px; box-shadow: 0 6px 14px #0004; transform: rotate(var(--tilt)); color: #222; }
.frigo-magnet { position: absolute; top: -10px; left: 50%; width: 22px; height: 22px; border-radius: 50%; transform: translateX(-50%); box-shadow: 0 3px 5px #0006; }
.frigo-photo { aspect-ratio: 1; background: #ddd; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.frigo-photo img { width: 100%; height: 100%; object-fit: cover; }
.frigo-missing { color: #888; text-align: center; font-size: .8rem; }
.frigo-blank { display: block; margin-top: 10px; font: .95rem/1.5 "Segoe Print", "Bradley Hand", cursive; }
.frigo-blank input { width: 100%; box-sizing: border-box; font: inherit; color: #1f3d8a; border: none; border-bottom: 2px dashed #888; background: transparent; outline: none; }
.frigo-lock { align-self: center; background: #b0883a; color: #2a1d0a; border-radius: 12px; padding: 10px 18px; text-align: center; box-shadow: 0 6px 14px #0005; min-width: 260px; }
.frigo-lock-title { font-weight: 700; margin-bottom: 6px; }
.frigo-open { background: #2a1d0a; color: #f2ead6; border: none; border-radius: 6px; padding: 6px 16px; font: 600 .95rem "Segoe UI", sans-serif; cursor: pointer; }
.frigo-open:disabled { opacity: .5; }
.frigo-msg { font-size: .8rem; margin-top: 6px; min-height: 1.1em; }
.frigo-handle { position: absolute; right: 18px; top: 62%; width: 14px; height: 140px; border-radius: 7px; background: linear-gradient(90deg, #c9ced2, #8f969b); }
.frigo-zoom { position: fixed; inset: 0; z-index: 3; background: #000c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: zoom-out; }
.frigo-zoom img { max-width: 80vw; max-height: 75vh; border: 10px solid #fff; }
.frigo-zoom-cap { color: #fff; font: 1.1rem "Segoe Print", cursive; }

/* ================= Ardoise ================= */
.ardoise { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; width: min(1180px, 97vw); align-items: start; }
.ardoise-frame { background: #6b4a2e; padding: 14px; border-radius: 6px; box-shadow: 0 24px 70px #000d; }
.ardoise-board { width: 100%; height: auto; display: block; border-radius: 2px; }
.ardoise-note { color: #ffe28a; font: .95rem "Segoe Print", cursive; min-height: 1.3em; margin-top: 6px; }
.ardoise-side { display: flex; flex-direction: column; gap: 12px; }
.calc { background: #2a2d31; border-radius: 12px; padding: 12px; box-shadow: 0 16px 40px #000c; }
.calc-screen { width: 100%; box-sizing: border-box; background: #c7d3bf; color: #1c2a1a; font: 18px Consolas, monospace; padding: 6px 8px; border: none; border-radius: 4px; text-align: right; }
.calc-result { color: #c7d3bf; font: 16px Consolas, monospace; text-align: right; min-height: 1.3em; margin: 4px 0 8px; }
.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.calc-keys button { background: #44494f; color: #fff; border: none; border-radius: 5px; padding: 8px 0; font: 600 .9rem "Segoe UI", sans-serif; cursor: pointer; }
.calc-keys button.eq { background: #d9a441; color: #1a1405; }
.ardoise-form { background: var(--panel); border: 1px solid #2a3446; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ardoise-form label { display: flex; flex-direction: column; gap: 4px; }
.ardoise-input { font: 1.1rem Consolas, monospace; background: var(--panel-2); color: var(--text); border: 1px solid #2f3a4d; border-radius: 6px; padding: 6px 8px; }
.ardoise-msg { font-size: .85rem; min-height: 1.2em; }
.ardoise-msg.err { color: #ff9a9e; }
.ardoise-msg.ok { color: #7ee787; }
.ardoise-close { grid-column: 1 / -1; justify-self: center; }

@media (max-width: 860px) {
  .ann, .xl, .ardoise { grid-template-columns: 1fr; }
  .serre-body { grid-template-columns: 1fr; }
  .frigo-photos { grid-template-columns: 1fr; overflow: auto; }
}
