/* ── Brand tokens ── */
:root {
  --navy:       #171726;
  --navy-light: #2a2a40;
  --cyan:       #4af7e9;
  --cyan-dark:  #3dd4c8;
  --teal:       #009099;
  --light:      #eef1fa;
  --light-mid:  #dde2f0;
  --white:      #ffffff;
  --text-body:  #3a3a58;
  --text-muted: #7878a0;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* ── Standalone card pages (login, error) ── */

.card-page {
  margin: 0;
  font-family: var(--font);
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.portal-card {
  width: 100%;
  max-width: 400px;
  border-radius: 10px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55), 0 4px 20px rgba(0, 0, 0, 0.35);
}
.portal-card__header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 28px 28px 24px;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.portal-card__header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--teal) 100%);
}
.portal-card__logo { height: 24px; width: auto; display: block; }
.portal-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.85;
}
.portal-card__body {
  background: var(--white);
  padding: 32px 28px 36px;
  border-radius: 0 0 10px 10px;
}
.portal-card__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
  line-height: 1.25;
}
.portal-card__note {
  margin-top: 18px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.portal-card__note a { color: var(--teal); text-decoration: none; }
.portal-card__note a:hover { text-decoration: underline; }
.card-footer {
  margin-top: 32px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font);
}

/* login.html */
.portal-card__subtitle {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.6;
  margin: 0 0 28px;
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 12px 16px;
  background: var(--cyan);
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s, box-shadow 0.14s;
}
.btn-google:hover { background: var(--cyan-dark); box-shadow: 0 4px 14px rgba(74, 247, 233, 0.3); }
.btn-google:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-google__icon { width: 17px; height: 17px; flex-shrink: 0; }

/* error.html */
.portal-card__message {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.6;
  margin: 0 0 28px;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s;
}
.btn-back:hover { background: var(--navy-light); }
.btn-back:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── Authenticated shell (base.html) ── */

body {
  margin: 0;
  font-family: var(--font);
  background: var(--light);
  color: var(--navy);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.portal-nav {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  height: 56px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.portal-nav::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--teal) 100%);
}
.nav-logo { height: 20px; width: auto; display: block; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-user { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.65); }
.btn-signout {
  padding: 5px 13px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8125rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn-signout:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.4); }
.btn-signout:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--light-mid);
  padding: 24px 2rem 0;
  flex-shrink: 0;
}
.page-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 18px;
}
.page-tabs { display: flex; }
.page-tab {
  padding: 7px 16px 9px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-body);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: default;
}
.page-tab--active {
  color: var(--navy);
  font-weight: 600;
  border-bottom-color: var(--cyan);
}

.portal-main {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  flex: 1;
}

.portal-footer {
  background: var(--navy);
  padding: 18px 2rem;
  flex-shrink: 0;
}
.portal-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-logo { height: 15px; width: auto; opacity: 0.7; }
.footer-copy { font-size: 0.75rem; color: rgba(255, 255, 255, 0.35); }

/* ── index.html ── */

.section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9090b8;
  margin: 0 0 12px;
}
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.account-card {
  background: var(--white);
  border: 1px solid var(--light-mid);
  border-radius: 9px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.account-card:hover {
  box-shadow: 0 4px 16px rgba(23, 23, 38, 0.08);
  transform: translateY(-1px);
}
.card-favicon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 4px;
}
.card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  flex: 1;
  line-height: 1.3;
}
.btn-view {
  padding: 6px 14px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.12s;
}
.btn-view:hover { background: var(--navy-light); }
.btn-view:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.accounts-empty {
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.accounts-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 16px;
}
.btn-toggle {
  padding: 6px 14px;
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--light-mid);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}
.btn-toggle:hover { background: var(--light-mid); }
.btn-toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── client.html ── */

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.month-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--light-mid);
  background: var(--white);
  color: var(--text-body);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.month-nav-btn:hover:not(:disabled) {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.month-nav-btn:disabled { opacity: 0.35; cursor: default; }
.month-nav-btn svg { width: 16px; height: 16px; }
.month-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  text-align: center;
  flex: 1;
}

.day-group { margin-bottom: 1.25rem; }
.day-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--light-mid);
}

.report-list { list-style: none; margin: 0; padding: 0; }
.report-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--white);
  border: 1px solid var(--light-mid);
  border-radius: 8px;
  margin-top: 6px;
}
.report-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--teal);
}
.report-icon svg { width: 16px; height: 16px; }
.report-info { flex: 1; min-width: 0; }
.report-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.report-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--light-mid);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-body);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.report-open:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.report-open svg { width: 11px; height: 11px; }

/* Staff-only rows for reports not yet published to the client. */
.report-row--hidden { background: var(--light); border-style: dashed; }
.report-row--hidden .report-icon { color: var(--text-muted); }
.report-row--hidden .report-name { color: var(--text-muted); font-weight: 500; }

.report-visibility-form { margin: 0; }
.report-visibility,
.report-share {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--light-mid);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-body);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.report-visibility:hover,
.report-share:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}
.report-visibility:focus-visible,
.report-share:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* Teal border and text on the Publish button, but not while hovered — this rule ties on specificity
   with :hover and would otherwise win on source order, leaving teal text on a teal background. */
.report-row--hidden .report-visibility:not(:hover) { border-color: var(--teal); color: var(--teal); }

.report-delete-form { margin: 0; }
.report-delete {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #d94f4f;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  color: #d94f4f;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.report-delete:hover {
  background: #d94f4f;
  color: var(--white);
}

.reports-empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-muted);
}
.reports-empty-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--light-mid);
}
.reports-empty-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-body);
  margin: 0 0 6px;
}
.reports-empty-sub { font-size: 0.8125rem; margin: 0; }

@media (max-width: 600px) {
  .portal-nav { padding: 0 1rem; }
  .nav-user { display: none; }
  .page-header { padding: 18px 1rem 0; }
  .portal-main { padding: 1.25rem 1rem 3rem; }
  .portal-footer { padding: 16px 1rem; }
}
