/* ProvidTime — base styles */

:root {
  --pt-primary: #0f3a5f;
  --pt-primary-dark: #0a2a44;
  --pt-accent: #1f8a70;
  --pt-bg: #f4f6f9;
  --pt-card: #ffffff;
  --pt-text: #1f2937;
  --pt-muted: #6b7280;
  --pt-border: #e5e7eb;
  --pt-danger: #b91c1c;
  --pt-success: #15803d;
  --pt-radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--pt-bg);
  color: var(--pt-text);
  line-height: 1.5;
}

a { color: var(--pt-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.center-card {
  max-width: 440px; margin: 64px auto; background: var(--pt-card);
  padding: 32px; border-radius: var(--pt-radius); box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

h1, h2, h3 { color: var(--pt-text); margin-top: 0; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }

label {
  display: block; margin: 12px 0 4px; font-weight: 600; font-size: 14px; color: var(--pt-text);
}
input[type=text], input[type=email], input[type=password], input[type=tel],
select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--pt-border);
  border-radius: 6px; font-size: 15px; font-family: inherit;
  background: #fff; color: var(--pt-text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pt-primary); border-color: var(--pt-primary); }

button, .btn {
  display: inline-block; padding: 10px 18px; background: var(--pt-primary); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 15px;
  font-family: inherit;
}
button:hover, .btn:hover { background: var(--pt-primary-dark); }
button.secondary, .btn.secondary { background: #fff; color: var(--pt-primary); border: 1px solid var(--pt-primary); }
button.secondary:hover { background: #eaf1f7; }
button:disabled { background: #9ca3af; cursor: not-allowed; }

/* Busy-state for buttons whose click fires an in-flight request. Add the
   `is-loading` class on submit, remove it in a finally{}. Greys the button,
   blocks further clicks, and renders a small spinning circle inside it. */
button.is-loading, .btn.is-loading {
  position: relative; opacity: .7; cursor: progress; pointer-events: none;
}
button.is-loading::before, .btn.is-loading::before {
  content: ''; display: inline-block; width: 12px; height: 12px;
  margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: pt-btn-spin .6s linear infinite;
}
@keyframes pt-btn-spin { to { transform: rotate(360deg); } }

.alert { padding: 10px 14px; border-radius: 6px; margin: 12px 0; font-size: 14px; }
.alert.error { background: #fef2f2; color: var(--pt-danger); border: 1px solid #fecaca; }
.alert.success { background: #f0fdf4; color: var(--pt-success); border: 1px solid #bbf7d0; }
.alert.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.brand { color: var(--pt-primary); font-weight: 700; font-size: 22px; }
header.appbar .brand img { height: 44px; width: auto; display: block; }

header.appbar {
  background: var(--pt-primary); color: #fff; padding: 8px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
header.appbar a { color: #fff; }
header.appbar nav a { margin: 0 12px; font-weight: 500; }

.muted { color: var(--pt-muted); font-size: 13px; }
.spacer { height: 16px; }

.bell {
  position: relative; cursor: pointer; padding: 4px 8px;
}
.bell .count {
  position: absolute; top: -4px; right: -4px; background: var(--pt-danger); color: #fff;
  border-radius: 999px; font-size: 11px; padding: 2px 6px; line-height: 1;
}

/* ── DensityHierarchy 2026-04-28: dashboard cards, sparklines, activity feed,
   stacked-bar legend, pay-period panel ─────────────────────────────────── */
.pt-card {
  background: #fff;
  border-radius: var(--pt-radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.pt-section { background: transparent; }
.pt-spark { display: block; width: 100%; height: 32px; margin-top: 12px; }

/* Activity feed */
.pt-activity-feed { list-style: none; padding: 0; margin: 0; }
.pt-activity-feed .pt-activity-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--pt-border);
  font-size: 14px;
}
.pt-activity-feed .pt-activity-item:last-child { border-bottom: none; }
.pt-activity-feed .pt-act-icon {
  width: 18px;
  flex: none;
  text-align: center;
  color: var(--pt-primary);
  font-size: 13px;
}
.pt-activity-feed .pt-act-ts {
  flex: none;
  color: var(--pt-muted);
  font-size: 12px;
  min-width: 80px;
}
.pt-activity-feed .pt-act-msg { flex: 1; min-width: 0; }
.pt-activity-feed .pt-activity-alert .pt-act-icon {
  background: #fef3c7;
  color: #92400e;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  font-weight: 700;
}
.pt-activity-feed .pt-alert-warn .pt-act-icon { background: #fee2e2; color: var(--pt-danger); }
.pt-activity-feed .pt-alert-info .pt-act-icon { background: #dbeafe; color: #1d4ed8; }

/* Pay-period panel — pill */
.pt-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #e0e7ef;
  color: var(--pt-primary);
}
.pt-pill-draft     { background: #e0e7ef; color: var(--pt-primary); }
.pt-pill-submitted { background: #fef3c7; color: #92400e; }
.pt-pill-approved  { background: #dcfce7; color: var(--pt-success); }
.pt-pill-rejected  { background: #fef2f2; color: var(--pt-danger); }
.pt-pill-locked    { background: #f3f4f6; color: var(--pt-muted); }
.pt-pill-none      { background: #f3f4f6; color: var(--pt-muted); }

/* Horizontal stacked bar (charge-code mix) */
.pt-stacked-bar {
  display: flex;
  width: 100%;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--pt-border);
}
.pt-stacked-seg { height: 100%; }
.pt-stacked-legend {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 12px;
}
.pt-stacked-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.pt-legend-sw {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}
.pt-empty {
  margin: 0;
  color: var(--pt-muted);
  font-size: 13px;
}

/* Mobile: stack below-grid summary on narrow screens */
@media (max-width: 760px) {
  #period-summary { grid-template-columns: 1fr !important; }
  #period-panel > div { grid-template-columns: 1fr !important; }
}

/* ── 2026-05-05 visual modernization (PageModernization Stage_) ───────── */
:root {
  --pt-radius-md: 12px;
  --pt-shadow-sm: 0 1px 3px rgba(15,58,95,.05);
  --pt-shadow-md: 0 4px 14px rgba(15,58,95,.08);
  --pt-shadow-lg: 0 12px 32px rgba(15,58,95,.12);
  --pt-gradient-primary: linear-gradient(180deg, #083e7d 0%, #0a58b0 100%);
  --pt-surface-soft: #f8fafc;
}

main.container { padding: 32px 24px; max-width: 1100px; }

h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: -.005em; }

.page-intro {
  margin: 4px 0 28px;
  color: var(--pt-muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 760px;
}

/* Modernized cards (overrides earlier .pt-card to add shadow + border + hover) */
.pt-card {
  background: #fff;
  border-radius: var(--pt-radius-md);
  padding: 24px 28px;
  box-shadow: var(--pt-shadow-md);
  border: 1px solid rgba(15,58,95,.06);
  transition: box-shadow .15s ease, transform .15s ease;
}
.pt-card:hover { box-shadow: var(--pt-shadow-lg); }
.pt-card + .pt-card { margin-top: 18px; }

.pt-card__header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 4px;
}
.pt-card__icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(8,62,125,.10), rgba(10,88,176,.18));
  color: var(--pt-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pt-card__sub {
  margin: 0 0 22px;
  color: var(--pt-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* Form layout: 2-col grid on wide, stacked on narrow */
.pt-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  margin-bottom: 4px;
}
.pt-form-grid--single { grid-template-columns: 1fr; }
.pt-field { display: flex; flex-direction: column; }
.pt-field__hint { margin: 6px 0 0; font-size: 12px; color: var(--pt-muted); line-height: 1.45; }

/* Modernized form fields (override earlier base styles) */
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], select, textarea {
  padding: 11px 14px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.02) inset;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pt-primary);
  box-shadow: 0 0 0 3px rgba(15,58,95,.12);
}

/* Modernized labels — Uppercase mini-labels */
.pt-card label, .pt-form-grid label, .pt-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--pt-muted);
  margin: 0 0 6px;
}

/* Modernized buttons (override earlier base) */
button, .btn {
  background: var(--pt-gradient-primary);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .005em;
  box-shadow: 0 4px 12px rgba(8,62,125,.18);
  transition: transform .12s ease, box-shadow .15s ease;
}
button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(8,62,125,.26);
}
button:active, .btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(8,62,125,.18); }
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--pt-primary);
  border: 1px solid rgba(15,58,95,.18);
  box-shadow: 0 1px 3px rgba(15,58,95,.06);
}
button.secondary:hover, .btn.secondary:hover { background: var(--pt-surface-soft); box-shadow: 0 4px 10px rgba(15,58,95,.10); }

/* Action row at bottom of cards */
.pt-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--pt-border);
}

/* Toggle list — modernized checkbox group (replaces bare checkboxes) */
.pt-toggle-list {
  display: flex; flex-direction: column; gap: 6px;
  list-style: none; padding: 0; margin: 0;
}
.pt-toggle-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--pt-surface-soft);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.pt-toggle-list li:hover { background: #eef2f7; border-color: rgba(15,58,95,.10); }
.pt-toggle-list li label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--pt-text);
  font-weight: 500;
  margin: 0;
  flex: 1;
  cursor: pointer;
}
.pt-toggle-list input[type=checkbox] {
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: var(--pt-primary);
  flex-shrink: 0;
}
.pt-toggle-list__divider {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--pt-muted);
  margin: 12px 4px 4px;
  padding: 0;
}

/* Shared in-app footer (inlined per page; no JS fetch)
   NOTE: display:block + line-height:44px (matches `height`) — NOT flex.
   Flex layout splits the footer's "© 2026 <span>ProvidTime</span>. ..."
   into separate flex items per text run, and CSS strips trailing
   whitespace at the end of each anonymous text-item — collapsing the
   space between "2026" and "ProvidTime" (visible bug 2026-05-19).
   Block keeps the inline content in a single anonymous box so the
   embedded whitespace is preserved. */
.ps-footer {
  position: fixed; left: 0; right: 0; bottom: 0; height: 44px;
  display: block; text-align: center;
  background: rgba(255,255,255,.96);
  border-top: 1px solid rgba(10,88,176,.10);
  backdrop-filter: blur(6px); z-index: 9999;
  font: 700 12px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial;
  /* line-height must follow `font:` — the shorthand resets it to 1.2.
     Matches `height: 44px` to vertically center the single-line text. */
  line-height: 44px;
  color: #0b3c7a; letter-spacing: .2px;
  padding: 0 12px;
}
body { padding-bottom: 56px; }

