/* ============================================================
   ADG TEAM SUITE — branded after adamdruckgroup.com
   Palette: CB Blue + Celestial + Warm Cream + Deep Ink
   Type: Fraunces (serif display) + Inter (sans body)
   ============================================================ */

:root {
  --cb-blue: #012169;
  --cb-blue-deep: #00174A;
  --celestial: #418FDE;
  --celestial-light: #7EB3EB;
  --cream: #F7F3EC;
  --cream-dark: #EDE6D7;
  --paper: #FDFCF8;
  --ink: #0E1420;
  --slate: #2B3344;
  --muted: #6B7280;
  --line: #D9D3C4;
  --hairline: rgba(14, 20, 32, 0.08);
  --serif: "Fraunces", "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --container: 1240px;
  --radius-card: 6px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--celestial); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
svg { display: block; }

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
.italic { font-style: italic; color: var(--cb-blue); }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--celestial);
  margin: 0 0 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1.5px solid transparent;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.btn--sm { padding: 0.55rem 1rem; font-size: 0.72rem; }
.btn--primary { background: var(--cb-blue); color: #fff; border-color: var(--cb-blue); }
.btn--primary:hover { background: var(--celestial); border-color: var(--celestial); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--cb-blue); border-color: var(--cb-blue); }
.btn--ghost:hover { background: var(--cb-blue); color: #fff; }

/* ---------- Top nav ---------- */
.topnav {
  background: rgba(253, 252, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.topnav__brand { display: flex; align-items: center; gap: 0.75rem; color: var(--cb-blue); }
.logo-mark { width: 56px; height: 21px; flex-shrink: 0; }
.topnav__brand-text { display: flex; flex-direction: column; line-height: 1; }
.topnav__brand-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 500; }
.topnav__brand-sub {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-top: 0.25rem;
  font-weight: 500;
}
.topnav__links { display: flex; align-items: center; gap: 1.5rem; }
.topnav__links a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.topnav__links a:hover, .topnav__links a.is-active { color: var(--celestial); }
.topnav__who { font-size: 0.8rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 1.5rem; }
.topnav__logout { margin: 0; }

/* ---------- Main / footer ---------- */
.main { flex: 1; width: 100%; }
.sitefoot {
  border-top: 1px solid var(--hairline);
  padding: 2rem;
  text-align: center;
}
.sitefoot p { margin: 0; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 2rem 2.5rem;
}
.hero--tight { padding-bottom: 1.5rem; }
.hero__title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0 0 1rem;
}
.hero__lede {
  max-width: 56ch;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--slate);
  margin: 0;
}

/* ---------- Tool grid ---------- */
.grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem 2rem 5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.tile {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  color: inherit;
  transition: all 0.25s var(--ease);
}
.tile:hover {
  border-color: var(--celestial);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(1, 33, 105, 0.1);
  color: inherit;
}
.tile__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.tile__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cb-blue) 0%, var(--celestial) 100%);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.tile__tag {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--celestial);
}
.tile__name {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
  color: var(--ink);
}
.tile__desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--slate);
  margin: 0 0 1.5rem;
  flex: 1;
}
.tile__open {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cb-blue);
}
.tile:hover .tile__open { color: var(--celestial); }

/* ---------- Tile status ---------- */
.tile__topright {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}
.tile__status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  flex-shrink: 0;
}
.dot--online { background: #1E7A3D; box-shadow: 0 0 0 3px rgba(30, 122, 61, 0.15); }
.dot--issue { background: #9A6700; box-shadow: 0 0 0 3px rgba(154, 103, 0, 0.15); }
.dot--offline { background: #B0281A; box-shadow: 0 0 0 3px rgba(176, 40, 26, 0.15); }
.dot--unknown { background: var(--line); }
.tile__meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tile__when {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.85;
}

/* ---------- Dashboard summary bar ---------- */
.dashbar {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.dashbar__summary { font-size: 0.95rem; color: var(--slate); }
.dashbar__count strong { color: var(--cb-blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.dashbar__controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.dashbar__search {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.55rem 0.9rem;
  width: 240px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.dashbar__search:focus { border-color: var(--cb-blue); box-shadow: 0 0 0 3px rgba(1, 33, 105, 0.1); }

/* ---------- Recently opened ---------- */
.recent {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem 2rem;
}
.recent__label { color: var(--cb-blue); margin: 0 0 1rem; }
.recent__grid {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

/* ---------- Auth pages ---------- */
.auth {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}
.auth__card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 2.5rem;
  text-align: center;
}
.auth__brand { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.auth__brand .logo-mark { width: 84px; height: 32px; }
.auth__title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0.25rem 0 0.5rem;
}
.auth__sub { color: var(--slate); font-size: 0.95rem; margin: 0 0 1.75rem; }
.auth__alt { margin: 1.5rem 0 0; font-size: 0.9rem; color: var(--muted); }
.auth__alt a { color: var(--cb-blue); font-weight: 600; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.form label { display: flex; flex-direction: column; gap: 0.4rem; }
.form label span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
}
.form input {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.8rem 1rem;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form input:focus { border-color: var(--cb-blue); box-shadow: 0 0 0 3px rgba(1, 33, 105, 0.1); }
.form__submit { margin-top: 0.5rem; width: 100%; }

.alert {
  font-size: 0.88rem;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  margin: 0 0 1.25rem;
  text-align: left;
}
.alert--error { background: #FCEBEA; color: #8A1C12; border: 1px solid #F3C9C5; }
.alert--ok { background: #E9F2FB; color: var(--cb-blue); border: 1px solid #C5DBF1; }

/* ---------- Admin panel ---------- */
.panel {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem 2rem 5rem;
}
.panel .alert { max-width: var(--container); }
.utable {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.utable th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1rem 1.25rem;
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
}
.utable td { padding: 1rem 1.25rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.utable tr:last-child td { border-bottom: none; }
.u-name { font-weight: 600; color: var(--ink); }
.u-email { font-size: 0.85rem; color: var(--muted); }
.u-date { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.u-actions__form { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center; }
.linkbtn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cb-blue);
  padding: 0;
}
.linkbtn:hover { color: var(--celestial); text-decoration: underline; }
.linkbtn--ok { color: #1E7A3D; }
.linkbtn--warn { color: #9A6700; }
.linkbtn--danger { color: #B0281A; }
.muted { color: var(--muted); font-size: 0.82rem; }

.pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.pill--active { background: #E4F3E9; color: #1E7A3D; }
.pill--pending { background: #FBF0DA; color: #9A6700; }
.pill--blocked { background: #FCEBEA; color: #B0281A; }
.pill--role-admin { background: var(--cb-blue); color: #fff; }
.pill--role-user { background: var(--cream-dark); color: var(--slate); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .topnav__inner { flex-wrap: wrap; gap: 1rem; }
  .topnav__who { border-left: none; padding-left: 0; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .topnav__inner { padding: 1rem 1.25rem; }
  .hero { padding: 2.5rem 1.25rem 1.5rem; }
  .grid { padding: 1rem 1.25rem 3rem; }
  .auth__card { padding: 1.75rem; }
  .utable { display: block; overflow-x: auto; }
}
