/* ═══════════════════════════════════════════
   TalentSheets — App / Dashboard Styles
   Supplements styles.css for authenticated pages.
   ═══════════════════════════════════════════ */

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth-page {
  background: var(--color-off-white, #f8f9fa);
  min-height: 100vh;
}

.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 72px);
  padding: 2rem 1rem;
}

.auth-card {
  position: relative;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.10);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

/* Light-theme overrides: the .auth-modal__* classes are styled for the dark
   homepage modal (white text/inputs). On the standalone white auth card we
   need dark-on-light styling so fields are visible. */
.auth-card .auth-modal__logo { color: #111; justify-content: center; }
.auth-card .auth-modal__title { color: #111; }
.auth-card .auth-modal__subtitle { color: #666; }
.auth-card .auth-modal__field label { color: #374151; }
.auth-card .auth-modal__field input {
  background: #fff;
  border: 1.5px solid #d1d5db;
  color: #111;
}
.auth-card .auth-modal__field input::placeholder { color: #9ca3af; }
.auth-card .auth-modal__field input:focus {
  border-color: var(--color-primary, #5a84f0);
  box-shadow: 0 0 0 3px rgba(90, 132, 240, 0.18);
  background: #fff;
}
.auth-card .auth-modal__options { color: #374151; }
.auth-card .auth-modal__link { color: #666; }
/* Hide decorative dark-modal orbs on the light card */
.auth-card .auth-modal__orb { display: none; }

.auth-modal__link {
  display: block;
  margin-top: .35rem;
  font-size: .8rem;
  color: var(--color-muted, #666);
  text-decoration: none;
}
.auth-modal__link:hover { text-decoration: underline; }

.auth-modal__divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--color-muted, #888);
  font-size: .8rem;
}
.auth-modal__divider::before,
.auth-modal__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.btn--google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  color: #111;
  font-weight: 500;
}
.btn--google:hover { background: #f8f9fa; border-color: #d1d5db; }

.auth-modal__footer-text {
  margin-top: 1.25rem;
  text-align: center;
  font-size: .875rem;
  color: var(--color-muted, #666);
}
.auth-modal__footer-text a { color: var(--color-primary, #5a84f0); text-decoration: none; font-weight: 500; }

.auth-modal__legal {
  font-size: .75rem;
  color: var(--color-muted, #888);
  text-align: center;
  margin-top: .5rem;
}
.auth-modal__legal a { color: inherit; text-decoration: underline; }

/* ── Form error / success ──────────────────────────────────────────────────── */
.ts-form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: .5rem;
  padding: .65rem .9rem;
  font-size: .875rem;
  margin-bottom: 1rem;
}
.ts-form-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  border-radius: .5rem;
  padding: .65rem .9rem;
  font-size: .875rem;
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.ts-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1f2937;
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: .75rem;
  font-size: .9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  max-width: 320px;
}
.ts-toast--show { opacity: 1; transform: translateY(0); }
.ts-toast--success { background: #15803d; }
.ts-toast--error   { background: #dc2626; }

/* ── App layout (dashboard / account / admin) ─────────────────────────────── */
.app-page {
  display: flex;
  min-height: 100vh;
  background: #f4f6fb;
  font-family: 'Space Grotesk', sans-serif;
}

.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #111827;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: .5rem;
  position: fixed;
  top: 0; left: 0;
  bottom: 0;
  z-index: 100;
}

.app-sidebar__logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: .25rem .5rem;
  margin-bottom: 1rem;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: #9ca3af;
  font-size: .875rem;
  font-weight: 500;
  padding: .6rem .75rem;
  border-radius: .6rem;
  transition: background .15s, color .15s;
}
.app-sidebar__link:hover { background: #1f2937; color: #fff; }
.app-sidebar__link--active { background: #1d3a7a; color: #fff; }

.app-sidebar__logout {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: .875rem;
  font-weight: 500;
  padding: .6rem .75rem;
  border-radius: .6rem;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.app-sidebar__logout:hover { background: #1f2937; color: #fff; }

.app-main {
  margin-left: 220px;
  flex: 1;
  padding: 2rem 2.5rem;
  min-width: 0;
}

.app-header {
  margin-bottom: 2rem;
}
.app-header__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.app-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.app-stat-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.app-stat-card--action { display: flex; flex-direction: column; gap: .75rem; }

.app-stat-card__label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  margin: 0 0 .4rem;
}
.app-stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

/* ── Sections ──────────────────────────────────────────────────────────────── */
.app-section {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  margin-bottom: 1.5rem;
}
.app-section--danger { border: 1.5px solid #fecaca; }
.app-section__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.app-section__title { font-size: 1rem; font-weight: 700; color: #111827; margin: 0 0 .5rem; }
.app-section__desc  { font-size: .875rem; color: #6b7280; margin: 0 0 1rem; }

/* ── API token row ─────────────────────────────────────────────────────────── */
.app-token-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.app-token {
  flex: 1;
  min-width: 0;
  background: #f3f4f6;
  border-radius: .5rem;
  padding: .6rem .9rem;
  font-size: .8rem;
  font-family: 'Courier New', monospace;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* ── Chart ─────────────────────────────────────────────────────────────────── */
.app-chart-wrap {
  width: 100%;
  overflow-x: auto;
}
.app-chart-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Table ─────────────────────────────────────────────────────────────────── */
.app-table-wrap { overflow-x: auto; }
.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.app-table th {
  text-align: left;
  padding: .6rem .75rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
}
.app-table td {
  padding: .75rem;
  color: #374151;
  border-bottom: 1px solid #f9fafb;
}
.app-table tr:last-child td { border-bottom: none; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.app-form { max-width: 480px; }
.app-form__field { margin-bottom: 1rem; }
.app-form__field label { display: block; font-size: .875rem; font-weight: 600; color: #374151; margin-bottom: .4rem; }
.app-form__field input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid #e5e7eb;
  border-radius: .6rem;
  font-size: .9rem;
  font-family: inherit;
  color: #111827;
  background: #fff;
  transition: border-color .15s;
  box-sizing: border-box;
}
.app-form__field input:focus { outline: none; border-color: #5a84f0; }

/* ── Search ────────────────────────────────────────────────────────────────── */
.app-search-form { display: flex; gap: .5rem; }
.app-search-input {
  padding: .5rem .85rem;
  border: 1.5px solid #e5e7eb;
  border-radius: .6rem;
  font-size: .875rem;
  font-family: inherit;
  background: #f9fafb;
  color: #111827;
  flex: 1;
}
.app-search-input:focus { outline: none; border-color: #5a84f0; background: #fff; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge--green { background: #dcfce7; color: #15803d; }
.badge--red   { background: #fee2e2; color: #dc2626; }

/* ── Danger button ─────────────────────────────────────────────────────────── */
.btn--danger {
  background: #dc2626;
  color: #fff;
  border: none;
}
.btn--danger:hover { background: #b91c1c; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 1rem;
    bottom: auto;
  }
  .app-sidebar__nav { flex-direction: row; flex-wrap: wrap; }
  .app-main { margin-left: 0; padding: 1.25rem 1rem; }
  .app-stats { grid-template-columns: 1fr 1fr; }
}
