:root {
  --osmg-navy: #0a1f44;
  --osmg-red: #c41e3a;
  --osmg-red-dark: #a01830;
  --surface: #ffffff;
  --surface-soft: #f4f6fb;
  --text: #132238;
  --muted: #60708a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
}

.signin-body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #1b3a6b 0%, var(--osmg-navy) 45%, #06132b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.signin-wrap {
  width: 100%;
  max-width: 430px;
}

.signin-card {
  background: var(--surface);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(5, 18, 41, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-header {
  border-bottom: 3px solid var(--osmg-red);
  padding: 2rem 2rem 1.25rem;
}

.brand-header h1 {
  margin: 0;
  color: var(--osmg-navy);
  font-size: 1.4rem;
}

.brand-header p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

#sign-in-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem 2rem 2rem;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #3a4a61;
}

input {
  width: 100%;
  margin-top: 0.35rem;
  margin: 10px;
  border-radius: 0.65rem;
  border: 1px solid #d8deea;
  padding: 0.72rem 0.8rem;
  font-size: 0.95rem;
  background: #f9fbff;
}

input:focus {
  border-color: #2b4f88;
  outline: none;
  box-shadow: 0 0 0 3px rgba(43, 79, 136, 0.12);
  background: #fff;
}

button {
  border: 0;
  border-radius: 0.65rem;
  cursor: pointer;
  margin: 10px;
  font-weight: 700;
}

#sign-in-submit,
#log-time-submit,
#my-submissions-save {
  margin-top: 0.8rem;
  background: var(--osmg-red);
  color: #fff;
  padding: 0.85rem 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#sign-in-submit:hover,
#log-time-submit:hover,
#my-submissions-save:hover:not(:disabled) {
  background: var(--osmg-red-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.error-banner,
.info-banner {
  margin: 0.4rem 0 0;
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.86rem;
}

.error-banner {
  background: #fff2f4;
  color: #8f1a2f;
  border: 1px solid #f6ccd5;
}

.info-banner {
  background: #edf5ff;
  color: #14345d;
  border: 1px solid #cbddf5;
}

.app-body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #1b3a6b 0%, var(--osmg-navy) 45%, #06132b 100%);
}

.shell-inner {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.top-shell {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #e1e6f2;
  position: sticky;
  top: 0;
  z-index: 9;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--osmg-navy);
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 0.45rem;
}

.main-nav a {
  text-decoration: none;
  color: #3e4d65;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
}

.main-nav a.active {
  background: #eaf1ff;
  color: var(--osmg-navy);
}

.main-nav a:hover {
  background: #f3f6fd;
}

.user-shell {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.user-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.user-email {
  font-size: 0.78rem;
  color: var(--muted);
}

.link-button {
  background: transparent;
  color: var(--osmg-red);
  font-size: 0.84rem;
  padding: 0.3rem 0.4rem;
}

.content-shell {
  padding: 1.15rem 0 2.4rem;
}

.card {
  background: #fff;
  border-radius: 0.95rem;
  border: 1px solid #e0e7f2;
  box-shadow: 0 10px 26px rgba(17, 35, 66, 0.09);
  padding: 1.2rem;
}

.card h1 {
  margin: 0;
  color: var(--osmg-navy);
  font-size: 1.25rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.stacked {
  margin-top: 1rem;
  max-width: 780px;
}

.client-results {
  margin-top: 0.3rem;
  border: 1px solid #d8deea;
  border-radius: 0.65rem;
  background: #fff;
  max-height: 220px;
  overflow: auto;
}

.client-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 0.62rem 0.72rem;
}

.client-option:hover {
  background: #f5f8ff;
}

.client-option-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.selected-client {
  margin-top: 0.5rem;
  border: 1px solid #d8deea;
  border-radius: 0.65rem;
  background: #f9fbff;
  padding: 0.55rem 0.65rem;
  font-size: 0.86rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

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

th,
td {
  text-align: left;
  border-bottom: 1px solid #e7edf6;
  padding: 0.62rem 0.45rem;
  font-size: 0.86rem;
}

th {
  color: #52617a;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.client-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.client-cell img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 4px;
}

.hours-input {
  margin-top: 0;
  max-width: 110px;
  margin: 10px;
  background: #fff;
}

.table-danger-button {
  background: #fff2f4;
  color: #8f1a2f;
  border: 1px solid #f6ccd5;
  padding: 0.45rem 0.65rem;
  border-radius: 0.55rem;
  font-size: 0.8rem;
}

.table-action-button {
  background: #edf5ff;
  color: #14345d;
  border: 1px solid #cbddf5;
  padding: 0.45rem 0.65rem;
  border-radius: 0.55rem;
  font-size: 0.8rem;
}

.table-secondary-button {
  background: #f5f7fb;
  color: #3a4a61;
  border: 1px solid #d8deea;
  padding: 0.55rem 0.8rem;
  border-radius: 0.55rem;
  font-size: 0.84rem;
}

.inline-number-button {
  background: transparent;
  color: #14345d;
  margin: 0;
  padding: 0.2rem 0.25rem;
  border-radius: 0.35rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-number-button:hover {
  background: #edf5ff;
}

.submissions-edit-header {
  margin-top: 0.45rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.row-edit-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.aggregate-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.card-subsection {
  border: 1px solid #e4eaf4;
  border-radius: 0.75rem;
  padding: 0.9rem;
  background: #fbfdff;
}

.card-subsection h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  color: var(--osmg-navy);
}

.pie-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  align-items: center;
}

.pie-chart {
  width: 180px;
  height: 180px;
  border-radius: 999px;
  border: 1px solid #d5dfef;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.82rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.completion-table th,
.completion-table td {
  white-space: nowrap;
}

.completion-cell {
  display: inline-block;
  min-width: 36px;
  text-align: center;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.12rem 0.35rem;
}

.completion-cell.done {
  background: #e7f8ee;
  color: #1c6a43;
}

.completion-cell.missing {
  background: #ffeef0;
  color: #9d2a43;
}

@media (max-width: 760px) {
  .nav-shell {
    flex-wrap: wrap;
    padding: 0.5rem 0;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .user-email {
    display: none;
  }

  .pie-wrap {
    grid-template-columns: 1fr;
  }
}

/* Aggregate dashboard */
.aggregate-page { max-width: 1180px; }
.dashboard-hero { display:flex; align-items:flex-end; justify-content:space-between; gap:2rem; color:#fff; padding:2.15rem 0 1.5rem; }
.dashboard-hero h1 { margin:.25rem 0 .55rem; font-size:clamp(1.8rem, 4vw, 2.7rem); letter-spacing:-.045em; }
.dashboard-hero p:not(.eyebrow) { margin:0; max-width:620px; color:#c9d5ea; line-height:1.6; font-size:.95rem; }
.eyebrow { margin:0; color:#859ac0; font-size:.68rem; font-weight:800; letter-spacing:.14em; }
.hero-export { background:#fff; color:var(--osmg-navy); text-decoration:none; border-radius:9px; padding:.7rem .9rem; font-size:.78rem; font-weight:800; white-space:nowrap; }
.hero-export span { color:var(--osmg-red); font-size:1.05rem; margin-left:.3rem; }
.kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:.8rem; }
.kpi-card { background:#fff; border:1px solid #e1e8f2; border-radius:12px; padding:1.05rem 1.1rem; box-shadow:0 8px 20px rgba(8,24,54,.1); position:relative; overflow:hidden; }
.kpi-card.accent:before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--osmg-red); }
.kpi-card span { display:block; color:#63718a; font-size:.75rem; font-weight:700; }
.kpi-card strong { display:block; color:var(--osmg-navy); font-size:1.8rem; letter-spacing:-.04em; margin:.35rem 0 .2rem; }
.kpi-card em { font-size:.78rem; font-style:normal; letter-spacing:0; margin-left:.18rem; color:#6f7e94; }
.kpi-card small { color:#8b98ab; font-size:.72rem; }
.insight-strip { display:grid; grid-template-columns:repeat(3,1fr); margin:1.2rem 0; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); border-radius:12px; color:#fff; }
.insight-strip > div { display:flex; align-items:center; gap:.7rem; padding:.9rem 1rem; border-right:1px solid rgba(255,255,255,.1); }
.insight-strip > div:last-child { border:0; }
.insight-strip p { margin:0; color:#bfcee5; font-size:.76rem; line-height:1.5; }
.insight-strip b { color:#fff; font-size:.8rem; }
.insight-icon { display:grid; place-items:center; width:28px; height:28px; border-radius:8px; color:#fff; background:#c41e3a; font-weight:800; }
.insight-icon.low { background:#4d72ac; } .insight-icon.neutral { background:#7686a1; }
.chart-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:1rem; margin-bottom:1rem; }
.chart-card,.data-card { background:#fff; border-radius:12px; padding:1.2rem; border:1px solid #e1e8f2; box-shadow:0 8px 20px rgba(8,24,54,.06); }
.chart-wide { grid-column:1 / -1; }
.section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
.section-heading h2 { margin:.25rem 0 0; color:var(--osmg-navy); font-size:1.05rem; letter-spacing:-.02em; }
.heading-note { color:#8a97aa; font-size:.7rem; padding-top:.2rem; text-align:right; }
.chart-canvas { height:250px; position:relative; margin-top:1rem; }
.chart-wide .chart-canvas { height:285px; }
.data-grid { display:grid; grid-template-columns:1.15fr .85fr; gap:1rem; }
.dashboard-table th { color:#8b98aa; font-size:.67rem; border-bottom:1px solid #e5ebf3; padding-top:.2rem; }
.dashboard-table td { font-size:.77rem; color:#52627a; vertical-align:middle; padding:.75rem .4rem; }
.dashboard-table td:first-child { color:#1b2b45; font-weight:700; }
.dashboard-table td small { display:block; color:#9ca8b8; font-size:.65rem; font-weight:500; margin-top:.1rem; }
.table-client-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:.45rem; }
.share-pill,.status-pill { display:inline-block; border-radius:99px; background:#edf3fb; color:#41628f; padding:.22rem .45rem; font-size:.67rem; font-weight:800; }
.status-pill.On\ target { background:#e8f7ee; color:#247048; }.status-pill.Partial { background:#fff7e5; color:#98701c; }.status-pill.Needs\ attention { background:#fff0f2; color:#a42a43; }
.raw-details { background:#fff; border:1px solid #e1e8f2; border-radius:12px; margin-top:1rem; padding:1rem 1.2rem; color:#2a3c58; }
.raw-details summary { cursor:pointer; font-weight:800; font-size:.82rem; list-style:none; }.raw-details summary::-webkit-details-marker { display:none; }.raw-details summary span { float:right; color:#9aa6b6; font-weight:600; }
@media (max-width: 850px) { .kpi-grid{grid-template-columns:repeat(2,1fr)} .data-grid{grid-template-columns:1fr} }
@media (max-width: 620px) { .dashboard-hero{display:block}.hero-export{display:inline-block;margin-top:1rem}.insight-strip{grid-template-columns:1fr}.insight-strip > div{border-right:0;border-bottom:1px solid rgba(255,255,255,.1)}.chart-grid{grid-template-columns:1fr}.chart-wide{grid-column:auto}.heading-note{display:none} }
