/* logga styles. Minimal, neutral, mirrors the look of other staff tools. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f5f7;
  color: #172b4d;
  font-size: 14px;
  line-height: 1.5;
}

.loading-overlay {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.9); z-index: 1000;
}
.spinner {
  width: 40px; height: 40px; border: 4px solid #dfe1e6; border-top-color: #4a90e2;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.app-container { max-width: 1200px; margin: 0 auto; padding: 0 16px 32px; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid #dfe1e6; margin-bottom: 16px;
}
.app-header h1 { margin: 0; font-size: 22px; }
.app-header .tagline { margin: 2px 0 0; color: #5e6c84; font-size: 12px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-name { font-weight: 500; color: #5e6c84; }

.error-banner {
  background: #ffebe6; color: #bf2600; padding: 12px 16px; border-radius: 4px;
  margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center;
}

.btn-ghost {
  background: transparent; border: 1px solid #dfe1e6; color: #172b4d;
  padding: 6px 12px; border-radius: 3px; cursor: pointer; font-size: 13px;
}
.btn-ghost:hover { background: #ebecf0; }
.btn-small { font-size: 12px; padding: 4px 8px; }
.btn-close {
  background: transparent; border: 0; font-size: 22px; line-height: 1;
  cursor: pointer; color: #5e6c84;
}

.target-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px;
}
.metric {
  background: #fff; padding: 16px; border-radius: 6px; border: 1px solid #dfe1e6;
}
.metric-label { font-size: 12px; color: #5e6c84; text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.metric-value .unit { font-size: 14px; font-weight: 400; color: #5e6c84; }
.metric-sub { font-size: 12px; color: #5e6c84; margin-top: 4px; }

.card {
  background: #fff; border: 1px solid #dfe1e6; border-radius: 6px;
  padding: 16px; margin-bottom: 16px;
}
.card-head { margin-bottom: 12px; }
.card-head h2 {
  margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px;
}
.card-head .muted { color: #5e6c84; font-size: 12px; margin: 4px 0 0; }
.card-controls {
  margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.card-controls select {
  padding: 4px 8px; border: 1px solid #dfe1e6; border-radius: 3px;
  background: #fff; font-size: 13px;
}
.muted { color: #5e6c84; }
.small { font-size: 12px; }

.chart-wrap { position: relative; height: 240px; }
.chart-wrap-tall { height: 320px; }

.tech-list { margin-top: 12px; display: grid; gap: 4px; }
.tech-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border: 1px solid #dfe1e6; border-radius: 4px;
  background: #fff; cursor: pointer; text-align: left;
  border-left: 4px solid #dfe1e6;
}
.tech-row:hover { background: #f4f5f7; }
.tech-row.on-track { border-left-color: #36b37e; }
.tech-row.near-target { border-left-color: #ffab00; }
.tech-row.below-target { border-left-color: #de350b; }
.tech-name { font-weight: 500; }
.tech-hours { color: #5e6c84; }
.tech-pct {
  display: inline-block; margin-left: 12px; padding: 2px 8px;
  border-radius: 12px; background: #ebecf0; font-size: 12px; font-weight: 500;
}

.calc-summary p { margin: 8px 0; }
.calc-detail {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #dfe1e6;
}
.calc-detail h3 { margin: 0 0 8px; font-size: 14px; }
.calc-detail ul { margin: 0 0 8px; padding-left: 20px; columns: 3; }
.calc-detail code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: #ebecf0; padding: 1px 4px; border-radius: 3px;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9, 30, 66, 0.54);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal {
  background: #fff; border-radius: 6px; max-width: 900px; width: 100%;
  max-height: 90vh; overflow-y: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid #dfe1e6;
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 16px; }
.modal-body h3 { margin: 16px 0 8px; font-size: 14px; }
.metric-row { display: flex; gap: 12px; margin-bottom: 12px; }

@media (max-width: 720px) {
  .target-row { grid-template-columns: 1fr; }
  .calc-detail ul { columns: 1; }
}
