/* Full Circle AT CMS — accessible design system (WCAG 2.1 AA) */
:root {
  --ink: #1a1a2e;
  --ink-soft: #3d3d56;
  --bg: #f7f7fa;
  --card: #ffffff;
  --brand: #1d4ed8;      /* 4.5:1+ on white */
  --brand-dark: #1e3a8a;
  --accent: #0f766e;
  --danger: #b91c1c;
  --ok-bg: #ecfdf5; --ok-ink: #065f46; --ok-border: #059669;
  --err-bg: #fef2f2; --err-ink: #991b1b; --err-border: #dc2626;
  --line: #d4d4dd;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1rem; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--brand-dark); color: #fff;
  padding: .6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* Header / nav */
.site-header { background: var(--brand-dark); color: #fff; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand-sub { font-weight: 400; opacity: .95; }
.main-nav { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.main-nav a, .nav-logout {
  display: inline-block; color: #fff; text-decoration: none; padding: .5rem .8rem;
  border-radius: var(--radius); font-size: 1rem;
}
.main-nav a:hover, .nav-logout:hover { background: rgba(255,255,255,.18); text-decoration: underline; }
.main-nav a[aria-current="page"] { background: rgba(255,255,255,.24); font-weight: 700; text-decoration: underline; }
.inline-form { display: inline; }
.nav-logout { background: none; border: none; cursor: pointer; font-family: inherit; }
.nav-search input {
  width: 9rem; padding: .35rem .6rem; font-size: .95rem; border: none; border-radius: var(--radius);
}

main { padding: 1.5rem 1rem 3rem; }
h1 { font-size: 1.6rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* Focus visibility (AA 2.4.7) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #f59e0b; outline-offset: 2px;
}

/* Cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Stat tiles */
.stat { text-align: left; }
.stat .stat-num { display: block; font-size: 1.9rem; font-weight: 700; color: var(--brand-dark); }
.stat .stat-label { color: var(--ink-soft); }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 2px solid; font-weight: 500; }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-border); }
.alert-error { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-border); }

/* Badges */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1.5px solid; }
.badge-pending { background: #fffbeb; color: #92400e; border-color: #b45309; }
.badge-active { background: #eff6ff; color: #1e40af; border-color: #1d4ed8; }
.badge-hold { background: #f5f5f5; color: #44403c; border-color: #57534e; }
.badge-closed { background: #ecfdf5; color: #065f46; border-color: #059669; }

/* Forms */
form.stacked { max-width: 44rem; }
.field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .9rem; display: block; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: .55rem .7rem; font-size: 1rem; font-family: inherit;
  border: 2px solid var(--ink-soft); border-radius: var(--radius); background: #fff; color: var(--ink);
}
textarea { min-height: 7rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; }
legend { font-weight: 700; padding: 0 .4rem; }
.field-error { color: var(--danger); font-weight: 600; margin-top: .25rem; }

/* Buttons */
.btn {
  display: inline-block; padding: .55rem 1.1rem; font-size: 1rem; font-family: inherit; font-weight: 600;
  border-radius: var(--radius); border: 2px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand-dark); border-color: var(--brand-dark); }
.btn-secondary:hover { background: #eff6ff; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: .3rem .7rem; font-size: .9rem; }
.btn-link { background: none; border: none; color: var(--brand); text-decoration: underline; cursor: pointer; font-size: 1rem; font-family: inherit; padding: 0; }

/* Tables */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--card); }
caption { text-align: left; font-weight: 700; padding: .5rem 0; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef1f6; color: var(--ink); }
tbody tr:hover { background: #f0f4ff; }
td.num, th.num { text-align: right; }

/* Progress bar */
.progress-wrap { margin: .5rem 0 1rem; }
progress.hours { width: 100%; height: 1.4rem; accent-color: var(--brand); }
.progress-caption { font-size: .95rem; color: var(--ink-soft); }

/* Tabs (link-based, accessible) */
.tab-nav { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; padding: 0; list-style: none; }
.tab-nav a { display: inline-block; padding: .5rem .9rem; text-decoration: none; color: var(--ink-soft); font-weight: 600; border: 2px solid transparent; border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; }
.tab-nav a[aria-current="page"] { background: var(--card); border-color: var(--line); color: var(--brand-dark); border-bottom: 2px solid var(--card); margin-bottom: -2px; }
.tab-nav a:hover { color: var(--brand-dark); text-decoration: underline; }

/* Definition lists */
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.25rem; margin: 0; }
dl.props dt { font-weight: 700; color: var(--ink-soft); }
dl.props dd { margin: 0; }

/* Utility */
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }
.muted { color: var(--ink-soft); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.otp-input { font-size: 1.6rem; letter-spacing: .5rem; text-align: center; max-width: 14rem; }
.auth-card { max-width: 26rem; margin: 3rem auto; }
.honeypot { position: absolute; left: -9999px; }

.site-footer { border-top: 1px solid var(--line); padding: 1rem 0 2rem; color: var(--ink-soft); }
.site-footer a { color: var(--brand); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
