/* ITime Solutions billing console. The invoice is the product here, so the
   screen borrows its palette: the same red, the same near-black, the same
   tinted panels. */

:root {
  --red: #cc1b22;
  --red-dark: #a3141a;
  --ink: #1a1a1a;
  --muted: #6b6b72;
  --line: #e1e1e6;
  --tint: #f7f7f9;
  --surface: #fff;
  --green: #1e8a4c;
  --amber: #c99800;
  --radius: 8px;
}

/* The hidden attribute has to win. A rule such as ".busy { display: flex }" is
   an author rule and so beats the browser's own [hidden] { display: none },
   which leaves an element marked hidden fully laid out and still intercepting
   clicks. That is what made this console unusable: an invisible full screen
   overlay sat on top of the sign-in button and swallowed every click. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Aptos, "Segoe UI", -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: var(--tint);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- masthead ---------- */
.mast { background: var(--surface); padding: 18px 20px 0; }
.wordmark { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.wordmark .i { color: var(--red); }
.wordmark .s { font-weight: 400; }
.strapline {
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin-top: 5px;
}
.rule { border-top: 2px solid var(--red); margin-top: 11px; }

.owner-bar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 8px 20px; font-size: 12.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
}
.link {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--red); text-decoration: underline; text-transform: none; letter-spacing: 0;
}

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 60px; }

/* ---------- blocks ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); margin: 22px 2px 8px; padding-bottom: 5px;
  border-bottom: 1px solid var(--ink);
}
.section-title:first-child { margin-top: 0; }
.hint { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.field { display: block; margin-bottom: 12px; }
.lbl { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
input:focus, select:focus { outline: 2px solid var(--red); outline-offset: -2px; }

.btn, .btn-primary {
  font: inherit; font-weight: 600; padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-block { width: 100%; }
.btn:disabled, .btn-primary:disabled { opacity: .5; cursor: default; }
.btn-sm { padding: 6px 11px; font-size: 13px; }

/* ---------- the month picker ---------- */
.period { display: flex; align-items: center; gap: 10px; }
.period select { width: auto; min-width: 190px; }
.period .total { margin-left: auto; text-align: right; }
.period .total b { font-size: 21px; display: block; line-height: 1.2; }

/* ---------- tables ---------- */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 0 10px 7px; border-bottom: 1px solid var(--line);
}
table.grid td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:hover td { background: var(--tint); }
.company { font-weight: 700; }
.company .sub { font-weight: 400; color: var(--muted); font-size: 12.5px; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: var(--tint); color: var(--muted);
}
.pill-draft { background: #fef3c7; color: #92400e; }
.pill-approved { background: #dbeafe; color: #1e40af; }
.pill-sent { background: #dcfce7; color: #166534; }
.pill-none { background: var(--tint); color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 26px 10px; }

/* ---------- invoice preview ---------- */
.inv-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.inv-lines { margin-top: 14px; }
.inv-line { padding: 12px 0; border-bottom: 1px solid var(--line); }
.inv-line .row-between b { font-size: 16px; }
.inv-line ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.inv-total {
  background: var(--red); color: #fff; border-radius: var(--radius);
  padding: 12px 16px; margin-top: 14px; font-weight: 700; font-size: 18px;
  display: flex; justify-content: space-between;
}

/* ---------- busy and toast ---------- */
.busy {
  position: fixed; inset: 0; background: rgba(255,255,255,.75);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; z-index: 50; color: var(--muted);
}
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--line);
  border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

@media (max-width: 620px) {
  table.grid th:nth-child(3), table.grid td:nth-child(3) { display: none; }
  .period { flex-wrap: wrap; }
}

/* a discount code, meant to be read off the screen and typed somewhere else */
.code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; }
