/* JML Timeclock styles. Bootstrap 5 does most of the work; these are the app's own touches.
   The signed-in layout follows the owner's look rule (JML Control / SwordChat owner dashboard): a light sidebar with
   section headings, Bootstrap's own colour variables (never light grey on white) and a Light/Dark/Same-as-computer
   switch. On phones the sidebar becomes a bottom tab bar (Docs/Timeclock-UI-Design-Plan.md §2, TSheets-style flow,
   our own look). States: on the clock = success, on break = warning, off the clock = secondary, always with a word. */

/* ===== Signed-in layout ===== */
.app-sidebar { width: 15rem; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
.app-logo { width: 2.25rem; height: 2.25rem; border-radius: .6rem; display: inline-flex; align-items: center; justify-content: center; background: #0f766e; color: #fff; font-size: 1.15rem; }
.app-eyebrow { text-transform: uppercase; font-size: .72rem; font-weight: 600; letter-spacing: .05em; color: var(--bs-secondary-color); padding: .9rem .75rem .3rem; }
.app-link { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .45rem .75rem; border: 0; border-radius: .5rem; background: none; color: var(--bs-body-color); text-decoration: none; font-size: .95rem; text-align: left; }
.app-link > .bi:first-child { width: 1.1rem; text-align: center; color: var(--bs-secondary-color); }
.app-link:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.app-link.active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; }
.app-link.active > .bi:first-child { color: var(--bs-primary-text-emphasis); }
.app-link:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 1px; }
.app-link .badge { margin-left: auto; }
.app-avatar { width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; font-size: .85rem; }
.status-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--bs-secondary-color); display: inline-block; flex-shrink: 0; }
.status-dot.ok, .status-dot.on { background: var(--bs-success); }
.status-dot.brk { background: var(--bs-warning); }
.status-dot.bad { background: var(--bs-danger); }
.app-shell .card { border-color: var(--bs-border-color-translucent); }
.app-main { min-width: 0; }
.app-topbar { position: sticky; top: 0; z-index: 1020; min-height: 3.25rem; }
.min-w-0 { min-width: 0 !important; }
.signed-out-bar { position: sticky; top: 0; z-index: 1040; }

/* The live status pill in the top bar: always says the state in words. */
.tc-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem; border-radius: 1rem; font-size: .85rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.tc-pill.s-off { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.tc-pill.s-on { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border-color: var(--bs-success-border-subtle); }
.tc-pill.s-break { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); border-color: var(--bs-warning-border-subtle); }
/* A thin bar under the top bar, in the state's colour. */
.tc-statebar { height: 4px; background: var(--bs-secondary-bg); }
.tc-statebar.s-on { background: var(--bs-success); }
.tc-statebar.s-break { background: var(--bs-warning); }

/* ===== Phones: sidebar hidden, bottom tab bar ===== */
.tc-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); padding-bottom: env(safe-area-inset-bottom); }
.tc-tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 3.5rem; border: 0; background: none; color: var(--bs-secondary-color); text-decoration: none; font-size: .72rem; font-weight: 600; }
.tc-tab .bi { font-size: 1.3rem; }
.tc-tab.active { color: var(--bs-primary-text-emphasis); }
.tc-tab:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: -2px; }
@media (max-width: 767.98px) {
  .app-sidebar { position: fixed; z-index: 1045; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .app-sidebar.open { transform: none; box-shadow: var(--bs-box-shadow-lg); }
  .app-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 1040; }
  .app-main main { padding-bottom: 5rem !important; }
}

/* ===== Sign-in pages (layout auth; adapted from SwordPMS with Timeclock's own colours) ===== */
.auth-body { min-height: 100vh; background-color: #053d38; }
.auth-background { position: fixed; inset: 0; z-index: 0; background-image: linear-gradient(135deg, #14b8a6 0%, #0f766e 45%, #053d38 100%); }
.auth-overlay { position: fixed; inset: 0; z-index: 0; background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .18), transparent 40%), radial-gradient(circle at 85% 85%, rgba(255, 255, 255, .12), transparent 45%); }
.auth-main { position: relative; z-index: 1; }
.auth-card { max-width: 27rem; background-color: rgba(var(--bs-body-bg-rgb), .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.auth-card .input-group-text { background-color: var(--bs-tertiary-bg); }
.auth-footer { color: rgba(255, 255, 255, .85); text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.tc-mark { width: 3.5rem; height: 3.5rem; margin: 0 auto; border-radius: 1rem; display: flex; align-items: center; justify-content: center; background: #0f766e; color: #fff; font-size: 1.8rem; }
.twofa-code { letter-spacing: .4em; }

/* ===== Clock screen ===== */
.tc-clock-card { border-top: 6px solid var(--bs-secondary-bg) !important; }
.tc-clock-card.s-on { border-top-color: var(--bs-success) !important; }
.tc-clock-card.s-break { border-top-color: var(--bs-warning) !important; }
.tc-state { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1rem; padding: .3rem .8rem; border-radius: 1rem; }
.tc-state.s-off { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.tc-state.s-on { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.tc-state.s-break { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.tc-timer { font-size: clamp(2.8rem, 9vw, 4.2rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tc-sub { color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.tc-big-btn { min-height: 4rem; font-size: 1.25rem; font-weight: 700; border-radius: 1rem; }
.tc-mid-btn { min-height: 3.1rem; font-weight: 600; border-radius: .8rem; }
.tc-job { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .75rem 1rem; border: 1px solid var(--bs-border-color); border-radius: .8rem; background: var(--bs-body-bg); color: var(--bs-body-color); text-align: left; }
.tc-job:hover { background: var(--bs-tertiary-bg); }
.tc-job .bi-chevron-right { margin-left: auto; color: var(--bs-secondary-color); }
.tc-timeline { display: flex; height: 1.4rem; border-radius: .5rem; overflow: hidden; background: var(--bs-tertiary-bg); }
.tc-timeline > span { display: block; height: 100%; }
.tc-timeline > .seg-work { background: var(--bs-success); }
.tc-timeline > .seg-break { background: var(--bs-warning); }
.tc-week-bar { height: .6rem; border-radius: .3rem; background: var(--bs-tertiary-bg); overflow: hidden; position: relative; }
.tc-week-bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bs-success); }
.tc-week-bar > span.over { background: var(--bs-danger); }
.tc-num { font-variant-numeric: tabular-nums; }

/* ===== Lists and tables (JML Control's svc-* look) ===== */
.svc-card { border: 1px solid var(--bs-border-color-translucent); border-radius: .75rem; background: var(--bs-body-bg); overflow: hidden; }
.svc-card-head { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--bs-border-color-translucent); font-weight: 600; font-size: .95rem; }
.svc-card-head .bi { color: var(--bs-secondary-color); }
.svc-table { margin: 0; font-size: .875rem; --bs-table-bg: transparent; --bs-table-hover-bg: var(--bs-tertiary-bg); }
.svc-table thead th { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); background: transparent; border-bottom-width: 1px; white-space: nowrap; }
.svc-table td { white-space: nowrap; vertical-align: middle; border-color: var(--bs-border-color-translucent); }
.svc-table tbody tr:last-child td { border-bottom: 0; }
.svc-muted { color: var(--bs-secondary-color); }
.svc-num { font-variant-numeric: tabular-nums; text-align: right; }
.tc-chip { display: inline-block; padding: .05rem .5rem; border-radius: 1rem; font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.tc-chip.c-open { background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); }
.tc-chip.c-submitted { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.tc-chip.c-approved { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.tc-chip.c-rejected { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.tc-chip.c-ot { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
/* Phones: the company crumb is hidden, so the next crumb drops its divider */
@media (max-width: 575.98px) { .app-topbar .breadcrumb-item:first-child + .breadcrumb-item::before { content: none; padding-right: 0; } }
