:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1e2430 0%, #10131a 60%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #f2f3f5;
}

body.layout-centered {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: #1a1e27;
  border: 1px solid #2a2f3a;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-card {
  position: relative;
  overflow: hidden;
  border-color: #363d52;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(88, 101, 242, 0.15),
    0 0 50px rgba(88, 101, 242, 0.15);
}

.login-card::before {
  content: '';
  position: absolute;
  top: -70%;
  left: 50%;
  transform: translateX(-50%);
  width: 220%;
  height: 220%;
  background: radial-gradient(circle, rgba(88, 101, 242, 0.22) 0%, transparent 60%);
  pointer-events: none;
}

.login-badge {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #5865f2, #7289da);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow: 0 12px 30px rgba(88, 101, 242, 0.45);
}

.login-card h1,
.login-card .subtitle {
  position: relative;
}

.login-card h1 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 16px;
  border: 2px solid #5865f2;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid #2a2f3a;
  border-top-color: #5865f2;
  border-radius: 50%;
  animation: nb-spin 0.8s linear infinite;
}

@keyframes nb-spin {
  to {
    transform: rotate(360deg);
  }
}

h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.subtitle {
  color: #a3a9b7;
  margin: 0 0 28px;
}

.app-version {
  text-align: center;
  color: #5a6070;
  font-size: 0.75rem;
  padding: 24px 0 8px;
}

.error {
  background: #3a1e22;
  border: 1px solid #5c2a30;
  color: #f2a3ab;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 20px;
  font-size: 0.9rem;
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #3a3520;
  border: 1px solid #5c531f;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: #e8c76b;
}

.notice-bar span {
  flex: 1;
  min-width: 200px;
  font-weight: 600;
}

.notice-bar button {
  width: auto;
  margin-top: 0;
}

.success {
  background: #1e3a26;
  border: 1px solid #2a5c38;
  color: #a3f2b8;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 20px;
  font-size: 0.9rem;
}

.discord-btn,
.logout-btn {
  display: inline-block;
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.discord-btn {
  background: #5865f2;
  color: #fff;
}

.discord-btn:hover {
  background: #4752c4;
}

.logout-btn {
  background: #2a2f3a;
  color: #f2f3f5;
}

.logout-btn:hover {
  background: #363c48;
}

form {
  margin: 0 0 12px;
}

.text-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2a2f3a;
  background: #10131a;
  color: #f2f3f5;
  margin-bottom: 12px;
  font-size: 1rem;
  font-family: inherit;
}

.code-box {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: #10131a;
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  color: #5865f2;
}

.hint {
  color: #a3a9b7;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  border-bottom: 1px solid #2a2f3a;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  width: 260px;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #2a2f3a;
  background: #10131a;
  color: #f2f3f5;
  font-size: 0.9rem;
  font-family: inherit;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1a1e27;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #f2f3f5;
  text-decoration: none;
  font-size: 0.9rem;
}

.search-result:hover {
  background: #10131a;
}

.search-result img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Same look as the topbar staff search, reused for the Payroll Admin
   member picker - a <button> instead of an <a>, since picking a result
   fills a form field instead of navigating away. */
.member-search-wrap {
  position: relative;
}

button.search-result {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

.status-pill.pending {
  color: #e0a83c;
  background: rgba(224, 168, 60, 0.14);
}

.status-pill.paid {
  color: #3ba55d;
  background: rgba(59, 165, 93, 0.14);
}

.bulk-payroll-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a3a9b7;
  font-size: 0.85rem;
  cursor: pointer;
}

.bulk-select-checkbox {
  margin-right: 4px;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.logout-link {
  color: #a3a9b7;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-to-me-link {
  color: #5865f2;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.back-to-me-link:hover {
  color: #7d89f5;
}

.logout-link:hover {
  color: #f2f3f5;
}

.admin-link {
  color: #5865f2;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-link:hover,
.admin-link.active {
  color: #7d89f5;
  text-decoration: underline;
}

.admin-dropdown {
  position: relative;
}

.admin-dropdown-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #5865f2;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.admin-dropdown-summary::-webkit-details-marker {
  display: none;
}

.admin-dropdown-summary::after {
  content: '\25BE';
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.admin-dropdown[open] .admin-dropdown-summary::after {
  transform: rotate(180deg);
}

.admin-dropdown-summary:hover,
.admin-dropdown-summary.active {
  color: #7d89f5;
  text-decoration: underline;
}

.admin-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  padding: 6px;
  background: #181c25;
  border: 1px solid #262c3d;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.admin-dropdown-item {
  color: #f2f3f5;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.admin-dropdown-item:hover {
  background: #232838;
}

.admin-dropdown-item.active {
  color: #7d89f5;
  background: #1e2440;
}

.admin-dropdown-section {
  margin: 4px 0 0;
  padding: 8px 10px 2px;
  border-top: 1px solid #262c3d;
  color: #6b7280;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.topbar-form {
  margin: 0;
}

.view-as-link {
  background: none;
  border: none;
  color: #a3a9b7;
  text-decoration: underline;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.view-as-link:hover {
  color: #f2f3f5;
}

.view-as-badge {
  background: #3a3520;
  border: 1px solid #5c5220;
  color: #e8c76b;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}

.view-as-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #3a3520;
  color: #e8c76b;
  font-size: 0.85rem;
  padding: 8px 16px;
  text-align: center;
}

.view-as-banner-exit {
  background: none;
  border: 1px solid #e8c76b;
  color: #e8c76b;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.view-as-banner-exit:hover {
  background: #e8c76b;
  color: #10131a;
}

.dashboard {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid #5865f2;
  flex-shrink: 0;
  object-fit: cover;
  background: #10131a;
}

.profile-hero h1 {
  margin: 0 0 8px;
}

.job-title {
  display: inline-block;
  background: #2a2f3a;
  color: #c7ccd8;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #2a2f3a;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.tab {
  padding: 8px 16px;
  border-radius: 8px;
  color: #a3a9b7;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  background: #1a1e27;
  color: #f2f3f5;
}

.tab.active {
  background: #5865f2;
  color: #fff;
}

.content-card {
  background: #1a1e27;
  border: 1px solid #2a2f3a;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 20px;
}

.content-card:last-child {
  margin-bottom: 0;
}

.content-card h2 {
  margin: 0 0 16px;
}

.ops-eyebrow {
  color: #7d89f5;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.ops-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.ops-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #1a1e27;
  border: 1px solid #2a2f3a;
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ops-tile:hover {
  border-color: #5865f2;
  transform: translateY(-2px);
}

.ops-tile-title {
  color: #f2f3f5;
  font-size: 1.1rem;
  font-weight: 700;
}

.ops-tile-desc {
  color: #a3a9b7;
  font-size: 0.85rem;
}

.ops-footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.ops-footer-dot {
  color: #4b5160;
}

.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  margin-bottom: 20px;
}

.week-nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  color: #f2f3f5;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: #2a2f3a;
  transition: background 0.15s ease;
}

.week-nav-link:hover {
  background: #363c4a;
}

.week-nav-disabled {
  color: #5b6270;
  background: transparent;
  cursor: default;
}

.week-nav-label {
  color: #a3a9b7;
  font-size: 0.85rem;
  font-weight: 600;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-header h2 {
  margin: 0;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  color: #a3a9b7;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #10131a;
  color: #f2f3f5;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s ease;
}

.calendar-cell:hover {
  background: #1a1e27;
}

.calendar-cell-empty {
  background: transparent;
}

.calendar-cell.has-tasks {
  background: #1e2440;
}

.calendar-cell.has-tasks:hover {
  background: #262c4d;
}

.calendar-cell.today .calendar-day-number {
  color: #7289da;
}

.calendar-cell.selected {
  box-shadow: 0 0 0 2px #5865f2;
}

.calendar-day-number {
  font-size: 0.9rem;
}

.calendar-task-dot {
  position: absolute;
  bottom: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5865f2;
}

.stat-card {
  flex: 1;
  padding: 24px 28px;
  margin-bottom: 0;
}

.greeting-card {
  flex: 3;
  padding: 24px 28px;
  margin-bottom: 0;
}

.stat-card h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  line-height: 1.2;
  color: #a3a9b7;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: #5865f2;
}

.quota-track {
  width: 100%;
  height: 14px;
  background: #10131a;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.quota-fill {
  height: 100%;
  background: #5865f2;
  border-radius: 999px;
}

.quota-fill.quota-complete {
  background: #3ba55c;
}

.quota-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.quota-metrics--single {
  grid-template-columns: 1fr;
}

.quota-metric-card {
  background: #10131a;
  border: 1px solid #2a2f3a;
  border-left: 3px solid #5865f2;
  border-radius: 12px;
  padding: 18px 20px;
}

.quota-metric-card--complete {
  border-left-color: #3ba55c;
}

.quota-metric-card .quota-track {
  margin: 10px 0;
}

.quota-metric-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.quota-metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #a3a9b7;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.quota-metric-fraction {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f2f3f5;
}

.quota-metric-status {
  margin: 0;
  font-size: 0.85rem;
  color: #a3a9b7;
}

.quota-metric-card--complete .quota-metric-status {
  color: #3ba55c;
  font-weight: 600;
}

.person-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #10131a;
}

.person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #5865f2;
  flex-shrink: 0;
}

.person-name {
  font-weight: 600;
  flex: 1;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-cell .person-avatar {
  width: 28px;
  height: 28px;
}

.person-date {
  color: #a3a9b7;
  font-size: 0.85rem;
}

.online-indicator {
  color: #3ba55c;
  font-weight: 600;
}

.timeoff-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  color: #a3a9b7;
  margin-bottom: 4px;
}

.field-label .text-input {
  margin-top: 6px;
}

textarea.text-input {
  resize: vertical;
  font-family: inherit;
}

.logbook-entry {
  background: #10131a;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
}

.logbook-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.logbook-entry-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logbook-delete-form {
  margin: 0;
}

.logbook-delete-btn {
  background: none;
  border: none;
  color: #a3a9b7;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.logbook-delete-btn:hover {
  color: #f2a3ab;
}

.logbook-details {
  margin: 0 0 8px;
  color: #f2f3f5;
  white-space: pre-wrap;
}

.logbook-redacted {
  color: #a3a9b7;
  font-style: italic;
}

.logbook-meta {
  margin: 0;
  color: #a3a9b7;
  font-size: 0.8rem;
}

.logbook-type-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.logbook-warning {
  background: #3a3520;
  color: #e8c76b;
}

.logbook-suspension {
  background: #3a2a1a;
  color: #f2a35c;
}

.logbook-note {
  background: #1a2a3a;
  color: #6ba8f2;
}

.logbook-termination {
  background: #3a1e22;
  color: #f2a3ab;
}

.timeoff-form .discord-btn {
  width: auto;
  align-self: flex-start;
  margin-top: 8px;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.button-row .discord-btn,
.button-row .logout-btn {
  width: auto;
  margin-top: 0;
}

.requests-table {
  width: 100%;
  border-collapse: collapse;
}

.requests-table th,
.requests-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #2a2f3a;
  font-size: 0.9rem;
}

.requests-table th {
  color: #a3a9b7;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.requests-table tr:last-child td {
  border-bottom: none;
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-pending {
  background: #3a3520;
  color: #e8c76b;
}

.status-approved {
  background: #1e3a24;
  color: #6be89a;
}

.status-denied {
  background: #3a1e22;
  color: #f2a3ab;
}

.decided-by {
  margin: 4px 0 0;
  color: #a3a9b7;
  font-size: 0.75rem;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions-cell form {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.small-btn {
  width: auto;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.small-input {
  width: 64px;
  margin: 0;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.trainee-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.trainee-row .text-input {
  margin: 0;
}

.trainee-row input.text-input {
  flex: 1;
  min-width: 140px;
}

.trainee-row select.text-input {
  flex: 0 0 90px;
  width: auto;
}

.candidate-card {
  background: #10131a;
  border: 1px solid #2a2f3a;
  border-left: 3px solid #2a2f3a;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  transition: border-left-color 0.15s ease;
}

/* Left-edge accent mirrors the live status badge - green/red/amber, same
   colors as .status-approved/.status-denied/.status-pending's own text
   color, so a whole row of cards reads at a glance without hunting for
   the small badge in each header. */
.candidate-card--pass {
  border-left-color: #6be89a;
}

.candidate-card--fail {
  border-left-color: #f2a3ab;
}

.candidate-card--void {
  border-left-color: #e8c76b;
}

.candidate-card--pending {
  border-left-color: #6b7280;
}

.candidate-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.candidate-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a1e27;
  border: 2px solid #5865f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f2f3f5;
  flex-shrink: 0;
}

.candidate-index {
  font-weight: 700;
  color: #f2f3f5;
  margin-right: auto;
}

.candidate-status-badge {
  text-transform: capitalize;
}

.candidate-section-label {
  color: #7d89f5;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 8px;
}

.candidate-card > .candidate-grid:first-of-type,
.candidate-card > .candidate-section-label:first-of-type {
  margin-top: 0;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 12px;
  margin-bottom: 4px;
}

.candidate-grid .field-label,
.candidate-card > .field-label {
  margin-bottom: 0;
}

.candidate-grid .text-input,
.candidate-card > .field-label .text-input {
  margin-bottom: 0;
}

.edit-amount-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.edit-reason-input {
  flex: 1;
  min-width: 160px;
  margin: 0;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.track-select {
  width: auto;
  margin: 0;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.trainee-stage-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trainee-stage {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.trainee-stage.done {
  opacity: 0.6;
  text-decoration: line-through;
}

.trainee-stage.current {
  font-weight: 600;
  border-color: #5865f2;
}

.trainee-stage.upcoming {
  opacity: 0.6;
}

.hosting-task-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.hosting-task-item {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.hosting-task-item.signed {
  color: #f2f3f5;
  border-color: #3ba55d;
}

.hosting-task-item.pending {
  opacity: 0.6;
}

.trainee-links {
  margin: 8px 0;
  padding-left: 20px;
  text-align: left;
}

.trainee-links li {
  margin-bottom: 6px;
}

.trainee-links a {
  color: #5865f2;
}

.onboarding-card {
  max-width: 520px;
}

.onboarding-body {
  text-align: left;
}

.onboarding-terms-text {
  color: #f2f3f5;
  line-height: 1.5;
  margin: 0 0 16px;
}

.onboarding-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  font-weight: normal;
  margin-bottom: 16px;
}

.small-datetime {
  width: 150px;
  margin: 0;
  padding: 6px 8px;
  font-size: 0.8rem;
}

.arrow-sep {
  color: #a3a9b7;
}

.inline-time-form {
  flex-wrap: wrap;
}

.table-scroll {
  overflow-x: auto;
}

.danger-btn {
  background: #7a2530;
  color: #fff;
}

.danger-btn:hover {
  background: #932c39;
}

.subsection-title {
  margin: 24px 0 12px;
  font-size: 1rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #10131a;
}

.activity-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.activity-minutes {
  font-weight: 600;
  flex: 1;
}

.activity-date {
  color: #a3a9b7;
  font-size: 0.85rem;
}

.dev-task-entry {
  border-radius: 10px;
  background: #10131a;
  overflow: hidden;
}

.dev-task-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.dev-task-summary::-webkit-details-marker {
  display: none;
}

.dev-task-summary::after {
  content: '\25B8';
  color: #a3a9b7;
  transition: transform 0.15s ease;
}

.dev-task-entry[open] .dev-task-summary::after {
  transform: rotate(90deg);
}

.dev-task-body {
  padding: 0 12px 12px 44px;
}

.dev-task-description {
  margin: 0 0 8px;
  color: #f2f3f5;
  white-space: pre-wrap;
}

.dev-task-meta {
  margin: 0;
  color: #a3a9b7;
  font-size: 0.85rem;
}

.dev-task-body form {
  margin-top: 10px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 10px;
  background: #10131a;
  text-align: center;
}

.team-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #5865f2;
}

.team-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-word;
}

.chain-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chain-list .team-card {
  width: 160px;
}

.chain-connector {
  color: #a3a9b7;
  font-size: 1.2rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .card {
    padding: 36px 24px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 16px;
  }

  .search-wrap {
    width: 100%;
    order: 3;
  }

  .topbar-right {
    gap: 10px;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .dashboard {
    padding: 20px 14px 48px;
  }

  .quota-metrics {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    gap: 14px;
    margin-bottom: 20px;
  }

  .hero-avatar {
    width: 64px;
    height: 64px;
  }

  .profile-hero h1 {
    font-size: 1.3rem;
  }

  .tabs {
    gap: 6px;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }

  .tab {
    padding: 7px 12px;
    font-size: 0.85rem;
  }

  .content-card {
    padding: 20px;
  }

  /* Stat cards get squeezed unreadable at phone widths in a row - stack instead. */
  .stats-row {
    flex-direction: column;
  }

  .greeting-card,
  .stat-card {
    flex: none;
    width: 100%;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .actions-cell {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-cell form {
    justify-content: center;
  }

  .calendar-header {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 10px;
  }

  .calendar-header h2 {
    order: -1;
    width: 100%;
    font-size: 1.2rem;
  }

  /* Long activity/logbook lines wrap onto their own line instead of
     overflowing or getting clipped against the icon/button next to them. */
  .activity-entry,
  .logbook-entry-header {
    flex-wrap: wrap;
  }

  .activity-date {
    flex-basis: 100%;
  }

  .view-as-banner {
    flex-wrap: wrap;
  }
}
