/* TimeGrid — the few rules Tailwind utilities do not cover. */
@font-face { font-family: 'Inter'; src: url('../vendor/fonts/Inter-Regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../vendor/fonts/Inter-Medium.woff') format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../vendor/fonts/Inter-SemiBold.woff') format('woff'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../vendor/fonts/Inter-Bold.woff') format('woff'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../vendor/fonts/Inter-ExtraBold.woff') format('woff'); font-weight: 800; font-style: normal; font-display: swap; }
html, body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.grid-line-hour { border-bottom: 1px solid #e2e8f0; }
.grid-line-half { border-bottom: 1px dashed #f1f5f9; }
.time-slot:hover { background-color: rgba(99, 102, 241, 0.05); }
.drag-handle-top, .drag-handle-bottom { cursor: ns-resize; }
.tooltip-card { pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.hidden { display: none !important; }
.sidebar-collapsed { width: 4.5rem !important; }
.sidebar-collapsed .sidebar-text-element { display: none; }
/* Local Fallback Mode: everything that writes is visibly disabled; reading keeps working. */
body.tg-offline [data-write] { opacity: .45; pointer-events: none; cursor: not-allowed; }
.tg-card-dragging { opacity: .8; box-shadow: 0 10px 25px rgba(15, 23, 42, .35); z-index: 30 !important; }
.tg-faded { opacity: .4; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #6366f1; outline-offset: 1px; }

/* F3: text size chosen in « Affichage » (js/theme.js sets <html data-text>). Every size in the app is in rem. */
html[data-text="large"] { font-size: 112.5%; }
html[data-text="xlarge"] { font-size: 125%; }

/* « Affichage » dialog: the selected choice */
.tg-choice:has(input:checked) { border-color: #4f46e5; background: #eef2ff; color: #3730a3; box-shadow: 0 0 0 1px #4f46e5; }
.tg-choice:has(input:focus-visible) { outline: 2px solid #6366f1; outline-offset: 1px; }
html[data-theme="dark"] .tg-choice:has(input:checked) { background: #312e81; color: #e0e7ff; border-color: #818cf8; box-shadow: 0 0 0 1px #818cf8; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f172a; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }
html[data-theme="dark"] .grid-line-hour { border-bottom-color: #283447; }
html[data-theme="dark"] .grid-line-half { border-bottom-color: #1e293b; }

/* B6: the monthly statement — fixed black on white, on screen (any theme) and on paper */
.tg-sheet { background: #fff; color: #0f172a; max-width: 210mm; margin: 0 auto 1.5rem; padding: 14mm 12mm; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 11px; line-height: 1.45; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.tg-sheet header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #0f172a; padding-bottom: 8px; margin-bottom: 10px; }
.tg-sheet .brand { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #4f46e5; }
.tg-sheet h3 { font-size: 17px; font-weight: 800; margin: 2px 0 0; }
.tg-sheet h4 { font-size: 12px; font-weight: 700; margin: 14px 0 6px; }
.tg-sheet .meta { text-align: right; font-size: 11px; }
.tg-sheet .meta b { text-transform: capitalize; font-size: 13px; }
.tg-sheet .who { margin: 0 0 8px; }
.tg-sheet table { width: 100%; border-collapse: collapse; }
.tg-sheet th { text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; color: #475569; border-bottom: 1px solid #94a3b8; padding: 4px 5px; }
.tg-sheet td { border-bottom: 1px solid #e2e8f0; padding: 4px 5px; vertical-align: top; }
.tg-sheet .num { text-align: right; white-space: nowrap; }
.tg-sheet tr.total td { font-weight: 700; border-top: 1.5px solid #0f172a; border-bottom: none; }
.tg-sheet td.empty { text-align: center; color: #64748b; padding: 10px; }
.tg-sheet .legend { font-size: 9.5px; color: #475569; margin-top: 8px; }
.tg-sheet footer { display: grid; grid-template-columns: 1fr 1fr; gap: 14mm; margin-top: 16mm; font-size: 10px; color: #334155; }
.tg-sheet footer .line { height: 16mm; border-bottom: 1px solid #0f172a; margin-bottom: 4px; }

@page { size: A4; margin: 12mm; }
@media print {
  html, body, #app, #app > main, #page-statement { height: auto !important; overflow: visible !important; display: block !important; background: #fff !important; }
  #sidebar, #app > main > header, #offlineBanner, #toastContainer, #modalRoot, .tooltip-card, .tg-noprint, #authRoot { display: none !important; }
  #page-statement { padding: 0 !important; }
  #statementRoot { max-width: none !important; }
  .tg-sheet { max-width: none; margin: 0; padding: 0; border: none; border-radius: 0; box-shadow: none; break-after: page; }
  .tg-sheet:last-child { break-after: auto; }
  .tg-sheet tr { break-inside: avoid; }
}
