/* Prime Rocks Management — hand-built stylesheet (no framework) */

:root {
  --navy: #0f2743;
  --navy-2: #17395f;
  --accent: #d97706;
  --bg: #f3f5f8;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #1c2733;
  --muted: #64748b;
  --green: #15803d;
  --red: #b91c1c;
  --amber: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 39, 67, .06), 0 4px 14px rgba(15, 39, 67, .06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */

.topbar {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }

.nav { display: flex; gap: 4px; flex-wrap: wrap; }

.nav a {
  color: #cdd9e8;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255,255,255,.16); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-right .who { color: #cdd9e8; font-size: 13px; }

/* ---------- Page ---------- */

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}

.page-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head h1 { font-size: 22px; margin: 0; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.page-head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---------- Cards & grids ---------- */

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

@media (max-width: 980px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.card .card-sub { color: var(--muted); font-size: 13px; margin-top: -8px; margin-bottom: 12px; }

/* Company tile header */
.tile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.tile-head .co-badge {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff;
  background: var(--navy-2);
  letter-spacing: .5px;
}
.tile-head .co-badge.pq { background: #b45309; }
.tile-head .co-badge.mre { background: #475569; }
.tile-head .co-badge.emc { background: #166534; }
.tile-head h2 { margin: 0; font-size: 16px; }
.tile-head .tile-link { margin-left: auto; }

/* KPI stat */
.stat { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 22px; font-weight: 800; margin-top: 2px; }
.stat .value small { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.good .value { color: var(--green); }
.stat.bad .value { color: var(--red); }
.stat.warn .value { color: var(--amber); }

/* ---------- Tables ---------- */

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f8fafc; }

/* ---------- Badges & pills ---------- */

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.pill.gray { background: #eef2f6; color: #475569; }
.pill.green { background: #dcfce7; color: #15803d; }
.pill.red { background: #fee2e2; color: #b91c1c; }
.pill.amber { background: #fef3c7; color: #b45309; }
.pill.blue { background: #dbeafe; color: #1d4ed8; }

/* ---------- Forms & buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--navy-2);
  color: #fff;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy-2); border-color: var(--line); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.accent { background: var(--accent); }

.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #334155; }

.input, select.input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.input:focus { outline: 2px solid #93b4d8; border-color: #93b4d8; }

.field { margin-bottom: 12px; }

.form-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- Alerts / flash ---------- */

.flash {
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.flash.ok { background: #dcfce7; color: #14532d; }
.flash.err { background: #fee2e2; color: #7f1d1d; }

.errors {
  background: #fee2e2;
  color: #7f1d1d;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}
.errors ul { margin: 0; padding-left: 18px; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a {
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy-2);
}
.tabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs a:hover { text-decoration: none; }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, #26517f 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.login-card .logo { display: flex; justify-content: center; margin-bottom: 12px; }
.login-card .logo img { height: 60px; width: auto; }
.login-card h1 { font-size: 19px; text-align: center; margin: 0 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }

/* ---------- Charts ---------- */

.chart-box { position: relative; width: 100%; height: 260px; }
.chart-box.tall { height: 320px; }
.spark-box { position: relative; width: 100%; height: 64px; margin-top: 10px; }

/* ---------- Misc ---------- */

.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.mt { margin-top: 16px; }
.section-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.offline {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
