@import "tailwindcss";

/* The sheet's own colours, read off AlphA on screen (plans/design.md), as Tailwind utilities:
   bg-saisie, bg-band, bg-block, bg-section, bg-total, border-rule, text-ink-2… Names say what a
   colour is for, so that a value can change without the views changing. */
@theme {
  --font-sans: Carlito, Calibri, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --color-ink: #1a1d21;          /* text */
  --color-ink-2: #6a6e71;        /* the grey of AlphA's small labels: "Prep", units, codes */
  --color-rule: #d0d4d8;         /* the sheet's thin lines */
  --color-rule-soft: #e8eaec;    /* a line between two rows */
  --color-band: #c8cdd1;         /* the frozen band above the budget, with the column heads */
  --color-block: #334254;        /* the dark block of the banner: sub-total, margin, total */
  --color-saisie: #e9f2fb;       /* a cell a producer can type in: AlphA's blue input columns */
  --color-saisie-focus: #cfe0f5; /* the same, with the focus */
  /* A cell of a line's Exe side: AlphA's green "Prod Exe" input columns. No picture shows them; the
     green is the "Eq. Exe" square's (fam-exe, sampled), lightened as the blue input is to the shoot's. */
  --color-saisie-exe: #ebf4ec;
  --color-saisie-exe-focus: #cde2d1;
  --color-section: #f4f8fb;      /* a section's title row */
  --color-total: #e6e7e9;        /* the grey band that closes a chapter with its total */
  --color-carbon: #4f6228;       /* the banner's "≃ 5.0 TCO2", olive green */
  --color-retyped: #22224c;      /* a label typed over the card's, navy: the strokes of "Réalisateur test" on 06-budget-5 */
  --color-retyped-print: #1e40af; /* the same label on the printed page and the exported workbook, blue (docs/macros/print.md) */
  --color-setting: #f2f2f2;      /* a setting in the rate card's head, the wage factors: grey on the sheet (Rcard F42:F48) */
  --color-card-banner: #595959;  /* the rate card's banner, "Ratecard 1: Film", dark grey (Rcard K38) */
  /* The list of quotes (Res), sampled on 13-quotes-list-2-four-quotes.jpg and 15-merged-1-list-of-quotes.jpg. */
  --color-head: #dfe3e6;         /* its column heads (Nom to Recettes) and its Total row, light grey; Coût, Marge, % are on the band */
  --color-confirm-head: #d3b6bb; /* the head of "Confirmés (n/m)", pink */
  --color-navy: #1f3864;         /* "Devis confirmés", the kinds and the Total under it, and a confirmed quote's row: dark blue */
  /* The preferences dialogs, sampled on 04-user-prefs-1-general.jpg and 04-user-prefs-3-social-insurance.jpg. */
  --color-note: #9e6f39;         /* the strip of notes at their foot, brown */
  --color-domestic: #52708a;     /* "Mode AlphA Classique", "France", "B : Devise des dépenses domestiques": the domestic side, blue */
  --color-exe: #5b7e3e;          /* "Mode AlphA Exe", "Exe", "C : Devise des dépenses de Prod Exe": the Prod Exe side, green */
  /* The cost log (Log), sampled on 12-log-3-summary-detail-open.jpg. */
  --color-log-navy: #485c77;     /* the compared columns' heads, "Col H - Col F", Marge globale's cells, the chart's bars */
  --color-log-grey: #d9d9d9;     /* "Double-cliquer sur [+]…", "Marge / Recettes", "% Mb" and the entries' heads */
  --color-mag: #e3e0eb;          /* maG's head and cells, lavender */
  --color-log-section: #f0f4f5;  /* a section's title row: Réalisateur/Photographe, Techniciens… */
  --color-log-hint: #842c2c;     /* "Double-cliquer sur [+] pour plus de détail", dark red (antialiased on the picture) */
  /* Petty cash (Cash), sampled on 16-petty-cash-1-empty.jpg and 16-petty-cash-2-entries.jpg; its computed
     columns and their heads are the band's grey (#c8cdd1 on the picture, the same). */
  --color-cash-head: #f0f4f5;    /* the column heads of the list and the three tables, light grey */
  --color-cash-row: #dee7f0;     /* every other row of the list of crew members, pale blue */
  --color-cash-rule: #8c8c8c;    /* the rules above and under the heads, under each table, the summary's lines */
  --color-cash-line: #a9a9a9;    /* the lines between the columns */

  /* The square before each section button of the ribbon, by family, sampled on 06-budget-2-crew-chapter-with-lines.jpg. */
  --color-fam-concept: #f6d586;  /* Concept */
  --color-fam-shoot: #7399c7;    /* Prep, Interp., Équipe, Matériel, Déco, Studio, Déc. nat., Pell. dév., Régie */
  --color-fam-exe: #cde2d1;      /* Eq. Exe */
  --color-fam-photo: #d8c4ab;    /* Photo */
  --color-fam-post: #9277b3;     /* Post-prod, Son, Digital, Print, GDS */
  --color-fam-other: #b2b8bd;    /* Repas, Hot, Voyages, Ass, Soc, CGV */
}

/* Carlito, served by the application (app/assets/fonts/README.md). */
@font-face { font-family: Carlito; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/carlito-latin-400-normal-1f27b0e0.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Carlito; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/carlito-latin-ext-400-normal-6515ec95.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Carlito; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/carlito-latin-700-normal-8842895a.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Carlito; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/carlito-latin-ext-700-normal-a9de07ee.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Carlito; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/carlito-latin-400-italic-3b5cd99b.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Carlito; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/carlito-latin-ext-400-italic-a6762185.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Carlito; font-style: italic; font-weight: 700; font-display: swap; src: url("/assets/carlito-latin-700-italic-a4193a12.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Carlito; font-style: italic; font-weight: 700; font-display: swap; src: url("/assets/carlito-latin-ext-700-italic-81802ff7.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Figures line up in every column without asking: a budget is read down its columns. */
body { font-variant-numeric: tabular-nums; }

/* The grid: the row that holds the focus is the current row, whether the keyboard or the mouse
   put it there; a cell selected with Shift and the arrows is tinted whatever its own background. */
#grid-body tr:has(input:focus) {
  background-color: var(--color-section);
}
#grid-body input.selected-cell {
  background-color: var(--color-saisie-focus);
}

/* The heading's fold: the marker turns when open; the browser's own marker is off. */
#heading-fold > summary::-webkit-details-marker { display: none; }
#heading-fold[open] > summary > span:first-child { transform: rotate(90deg); display: inline-block; }

/* The rate card's cells: one class for near twenty thousand inputs, where the utilities on each
   would weigh megabytes (app/views/rate_cards/show.html.erb). */
#rate-card input, #rate-card select {
  background-color: var(--color-saisie);
  border: 1px solid transparent;
  padding: 1px 0.25rem;
  outline: none;
}
#rate-card input:hover { border-color: var(--color-ink-2); }
#rate-card input:focus { border-color: var(--color-block); background-color: var(--color-saisie-focus); }
#rate-card td { padding: 2px 0.5rem; }
#rate-card td.num input { text-align: right; width: 6rem; }
#rate-card input.label { width: 100%; min-width: 10rem; }
#rate-card input.unit { width: 6rem; text-align: center; }
/* The names and the unit take typing on the card but sit on white, as on the sheet; only the rates
   and the in-house mark are the blue cells. The wage factors are the head's grey. */
#rate-card input.label, #rate-card input.unit { background-color: transparent; }
#rate-card input.factor { background-color: var(--color-setting); width: 4rem; text-align: center; }
#rate-card input.label:focus, #rate-card input.unit:focus, #rate-card input.factor:focus { background-color: var(--color-saisie-focus); }

/* The cost log's entries (app/views/cost_logs/show.html.erb): white cells between the sheet's thin
   lines, as on 12-log-4; one class for every cell, as the rate card's. */
#log-entries td { border-left: 1px solid var(--color-rule-soft); padding: 0 0.25rem; }
#log-entries input, #log-entries select {
  width: 100%; background-color: transparent; border: 1px solid transparent; padding: 1px 0.25rem; outline: none;
}
#log-entries input:hover, #log-entries select:hover { border-color: var(--color-ink-2); }
#log-entries input:focus, #log-entries select:focus { border-color: var(--color-block); background-color: var(--color-saisie-focus); }
#log-entries select { appearance: none; }
#log-entries select:focus, #log-entries select:hover { appearance: auto; }
#log-entries input.num { text-align: right; min-width: 6rem; }
#log-entries tr.selected td { background-color: var(--color-saisie); }
#log-entries button[data-toggle] { width: 100%; min-width: 1.5rem; text-align: center; cursor: pointer; }

/* Petty cash's tables (app/views/petty_cash/show.html.erb), the Cash sheet's cells: white between the
   column lines, the computed ones grey, the list's every other row pale blue. */
#petty-cash-page table.cash td { border-left: 1px solid var(--color-cash-line); border-top: 1px solid var(--color-rule-soft); padding: 0 0.25rem; height: 1.4rem; }
#petty-cash-page table.cash td[data-gutter] { border-left: 0; padding: 0; }
#petty-cash-page table.cash tfoot td { border: 0; }
#petty-cash-page table.cash input, #petty-cash-page table.cash select {
  width: 100%; background-color: transparent; border: 1px solid transparent; padding: 1px 0.25rem; outline: none;
}
#petty-cash-page table.cash input:hover, #petty-cash-page table.cash select:hover { border-color: var(--color-ink-2); }
#petty-cash-page table.cash input:focus, #petty-cash-page table.cash select:focus { border-color: var(--color-block); background-color: var(--color-saisie-focus); }
#petty-cash-page table.cash select { appearance: none; }
#petty-cash-page table.cash select:focus, #petty-cash-page table.cash select:hover { appearance: auto; }
#petty-cash-page table.cash input.num { text-align: right; min-width: 5rem; }
#cash-list tbody tr:nth-child(even) td:not([data-gutter]) { background-color: var(--color-cash-row); }
#petty-cash-page table.cash tr.selected td { background-color: var(--color-saisie-focus); }
