/**
 * public/css/timesheet-theme.css
 * Timesheet Status theme — loaded after site.css (same approach as survey-theme.css):
 * white nav, Croy blue accent, blue header band. Plus the page's own components.
 */
:root {
  --ce-navy:     #1a2744;
  --ce-blue:     #2563eb;
  --ce-blue-lt:  #dbeafe;
  --ce-blue-mid: #eff6ff;
  --font-head:   'Barlow', 'DM Sans', -apple-system, sans-serif;
}

/* ── Nav ──────────────────────────────────────────────────────── */
.ce-nav { background: #fff; border-top: 4px solid var(--ce-blue); border-bottom: 1px solid var(--border); box-shadow: 0 1px 6px rgba(26, 39, 68, .08); }
.ce-nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.ce-nav-brand img { height: 32px; display: block; }
.ts-app-tag {
  font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ce-blue);
  border-left: 2px solid var(--border); padding-left: 12px; line-height: 1.1; white-space: nowrap;
}
.ce-nav-user { color: #475569; }
.ce-nav-right .ce-btn-ghost { color: #64748b; }
.ce-nav-right .ce-btn-ghost:hover { color: var(--ce-navy); background: var(--ce-blue-mid); }

/* ── Page header band ─────────────────────────────────────────── */
.ce-page { max-width: 1200px; }
.ce-page-header {
  padding: 22px 26px; border-radius: var(--radius-lg); align-items: center;
  background: linear-gradient(120deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .18);
}
.ce-page-title { color: #fff; font-family: var(--font-head); font-size: 24px; font-weight: 600; letter-spacing: .01em; }
.ce-page-subtitle { color: rgba(255, 255, 255, .85); }
.ce-page-header .ce-btn-outline { background: #fff; color: var(--ce-navy); border-color: #fff; font-weight: 600; }
.ce-page-header .ce-btn-outline:hover { background: var(--ce-blue-lt); border-color: var(--ce-blue-lt); }
.ce-card { border-top: 3px solid var(--ce-blue-lt); }

/* ── Toolbar / week picker ────────────────────────────────────── */
.ts-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.ts-week { display: flex; align-items: center; gap: 6px; }
.ts-week strong { font-family: var(--font-head); font-size: 15px; color: var(--ce-navy); min-width: 200px; text-align: center; }
.ts-spacer { flex: 1; }
.ts-muted { color: var(--text-muted); font-size: 12px; }
.ts-input { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 13px; background: #fff; }
.ts-search { flex: 1; max-width: 300px; }

/* ── Summary tiles ────────────────────────────────────────────── */
.ts-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.ts-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); font: inherit;
}
.ts-tile:hover { border-color: var(--border-strong); }
.ts-tile.active { outline: 2px solid var(--ce-blue); outline-offset: -1px; }
.ts-tile .n { font-family: var(--font-head); font-size: 28px; font-weight: 600; line-height: 1.1; }
.ts-tile .l { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.ts-tile.bad .n { color: var(--ce-red); }
.ts-tile.warn .n { color: var(--ce-amber); }
.ts-tile.good .n { color: var(--ce-green); }

/* ── Table extras ─────────────────────────────────────────────── */
.ts-table-wrap { overflow-x: auto; }
.ts-table-wrap .ce-table td, .ts-table-wrap .ce-table th { white-space: nowrap; }
.ce-table td.num, .ce-table th.num { text-align: right; font-family: var(--font-mono); }
.ce-table th.chk, .ce-table td.chk { width: 34px; }
.ts-selbar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ce-blue-mid); border-bottom: 1px solid var(--border); }
.ts-selbar.show { display: flex; }
.ce-pill-none { background: #fef2f2; color: var(--ce-red); }
.ce-pill-rejected { background: #fef2f2; color: var(--ce-red); }
.ce-pill-draft { background: #fffbeb; color: var(--ce-amber); }

/* ── Detail drawer ────────────────────────────────────────────── */
.ts-drawer-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 250; }
.ts-drawer-bg.open { opacity: 1; pointer-events: auto; }
.ts-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(780px, 100%); background: #fff;
  border-left: 1px solid var(--border); box-shadow: var(--shadow-md); transform: translateX(100%);
  transition: transform .22s; z-index: 260; display: flex; flex-direction: column;
}
.ts-drawer.open { transform: none; }
.ts-drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.ts-drawer-head h2 { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--ce-navy); }
.ts-drawer-body { padding: 16px 20px; overflow: auto; flex: 1; }
.ts-drawer-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.ts-grow { flex: 1; }
.ts-meta { margin-bottom: 16px; }
.ts-days th, .ts-days td { padding: 7px 6px !important; font-size: 12px !important; }
.ts-days th { text-transform: none; letter-spacing: 0; font-family: var(--font); }
.ts-days td:first-child { white-space: normal !important; min-width: 170px; }
.ts-days tfoot td { font-weight: 600; background: #f8fafc; }
.ts-days td.zero { color: var(--text-muted); }
.ts-days tbody tr:hover td { background: transparent !important; cursor: default !important; }

/* ── Toast ────────────────────────────────────────────────────── */
.ts-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ce-navy); color: #fff;
  padding: 10px 16px; border-radius: var(--radius); font-size: 13px; opacity: 0; transition: opacity .2s;
  pointer-events: none; z-index: 400; max-width: 90vw;
}
.ts-toast.show { opacity: 1; }
.ts-modal-list { margin: 8px 0 12px 18px; max-height: 180px; overflow: auto; color: var(--text-muted); font-size: 13px; }

.ts-center { max-width: 520px; margin: 120px auto; text-align: center; color: var(--text-muted); }
[hidden] { display: none !important; }

@media (max-width: 768px) {
  .ts-tiles { grid-template-columns: repeat(2, 1fr); }
  .ts-hide-sm { display: none !important; }
  .ce-table th:nth-child(n+3), .ce-table td:nth-child(n+3) { display: table-cell; }
}
