/* ==========================================================================
   Revma Hire — Admin back-office styles (staff only).
   Self-contained: does NOT use the public marketing navbar/footer.
   Uses the brand palette from styles.css where available.
   ========================================================================== */
:root {
  --rv-red: #cc2229;
  --rv-navy: #1a1a2e;
  --rv-ink: #20242c;
  --rv-muted: #6b727e;
  --rv-line: #e6e8ec;
  --rv-bg: #f4f5f7;
  --rv-card: #ffffff;
}
* { box-sizing: border-box; }
body.rv-admin {
  margin: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--rv-bg);
  color: var(--rv-ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--rv-red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: 'Poppins', sans-serif; color: var(--rv-navy); margin: 0 0 .4em; }

/* ---- Shell layout ---- */
.rv-shell { display: flex; min-height: 100vh; }
.rv-side {
  width: 230px; flex-shrink: 0; background: var(--rv-navy); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.rv-side-brand { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.10); }
.rv-side-brand .rv-logo { font-family: 'Poppins'; font-weight: 700; font-size: 1.15rem; color: #fff; }
.rv-side-brand .rv-logo b { color: var(--rv-red); }
.rv-side-brand .rv-sub { font-size: .72rem; color: rgba(255,255,255,.55); letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.rv-nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.rv-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 20px;
  color: rgba(255,255,255,.78); font-size: .92rem; border-left: 3px solid transparent;
}
.rv-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.rv-nav a.active { background: rgba(204,34,41,.16); color: #fff; border-left-color: var(--rv-red); font-weight: 600; }
.rv-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.rv-nav .rv-nav-sec { padding: 14px 20px 5px; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.38); }
.rv-side-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.10); font-size: .82rem; }
.rv-side-foot .rv-who { color: #fff; font-weight: 600; }
.rv-side-foot .rv-role { color: rgba(255,255,255,.5); font-size: .74rem; text-transform: capitalize; }
.rv-side-foot form { margin-top: 8px; }
.rv-side-foot button {
  background: rgba(255,255,255,.08); color: #fff; border: 0; border-radius: 6px;
  padding: 7px 12px; font-size: .82rem; cursor: pointer; width: 100%;
}
.rv-side-foot button:hover { background: rgba(204,34,41,.5); }

.rv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rv-topbar {
  background: var(--rv-card); border-bottom: 1px solid var(--rv-line);
  padding: 14px 26px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.rv-topbar h1 { font-size: 1.3rem; margin: 0; }
.rv-topbar .rv-preview-pill {
  background: #fff3cd; color: #8a6d00; font-size: .72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; border: 1px solid #ffe69c;
}
.rv-content { padding: 26px; max-width: 1400px; width: 100%; }

/* ---- Cards / panels ---- */
.rv-card { background: var(--rv-card); border: 1px solid var(--rv-line); border-radius: 12px; padding: 20px; }
.rv-card + .rv-card { margin-top: 18px; }
.rv-card h2, .rv-card h3 { margin-top: 0; }
.rv-grid { display: grid; gap: 18px; }
.rv-grid-4 { grid-template-columns: repeat(4, 1fr); }
.rv-grid-3 { grid-template-columns: repeat(3, 1fr); }
.rv-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---- Stat tiles ---- */
.rv-stat { background: var(--rv-card); border: 1px solid var(--rv-line); border-radius: 12px; padding: 18px 20px; }
.rv-stat .rv-stat-num { font-family: 'Poppins'; font-size: 2rem; font-weight: 700; color: var(--rv-navy); line-height: 1.1; }
.rv-stat .rv-stat-lbl { color: var(--rv-muted); font-size: .82rem; margin-top: 3px; }
.rv-stat.rv-stat-alert .rv-stat-num { color: var(--rv-red); }

/* ---- Tables ---- */
.rv-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rv-table th { text-align: left; padding: 10px 12px; color: var(--rv-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--rv-line); white-space: nowrap; }
.rv-table td { padding: 11px 12px; border-bottom: 1px solid var(--rv-line); vertical-align: middle; }
.rv-table tr:last-child td { border-bottom: 0; }
.rv-table tr:hover td { background: #fafbfc; }
.rv-table .rv-ref { font-family: 'Poppins'; font-weight: 600; }

/* ---- Buttons ---- */
.rv-btn { display: inline-block; padding: 8px 15px; border-radius: 7px; font-size: .86rem; font-weight: 600; border: 1px solid transparent; cursor: pointer; background: #eef0f3; color: var(--rv-ink); }
.rv-btn:hover { text-decoration: none; filter: brightness(.97); }
.rv-btn-primary { background: var(--rv-red); color: #fff; }
.rv-btn-navy { background: var(--rv-navy); color: #fff; }
.rv-btn-ghost { background: #fff; border-color: var(--rv-line); color: var(--rv-ink); }
.rv-btn-sm { padding: 5px 11px; font-size: .8rem; }
.rv-btn-danger { background: #fff; border-color: #f1c2c2; color: var(--rv-red); }
.rv-btn-danger:hover { background: #fde8e8; }

/* ---- Status badges (mirror the customer app.css palette) ---- */
.rv-badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.rv-badge-grey  { background: #eceef1; color: #555c66; }
.rv-badge-blue  { background: #e1ecfb; color: #1a5fb4; }
.rv-badge-amber { background: #fdf0d5; color: #9a6700; }
.rv-badge-green { background: #e3f6e8; color: #1b7a3d; }
.rv-badge-red   { background: #fde1e1; color: #b3261e; }

/* ---- Forms ---- */
.rv-field { margin-bottom: 16px; }
.rv-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--rv-ink); margin-bottom: 5px; }
.rv-field input, .rv-field select, .rv-field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--rv-line); border-radius: 7px;
  font-size: .92rem; font-family: inherit; background: #fff;
}
.rv-field input:focus, .rv-field select:focus, .rv-field textarea:focus { outline: 2px solid rgba(204,34,41,.25); border-color: var(--rv-red); }
.rv-field .rv-hint { font-size: .78rem; color: var(--rv-muted); margin-top: 4px; }
.rv-err { background: #fde1e1; color: #b3261e; padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-bottom: 14px; }
.rv-ok  { background: #e3f6e8; color: #1b7a3d; padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-bottom: 14px; }

/* ---- Calendar / Gantt ---- */
.rv-cal-wrap { overflow-x: auto; border: 1px solid var(--rv-line); border-radius: 12px; background: #fff; }
.rv-cal { border-collapse: collapse; font-size: .8rem; table-layout: fixed; }
.rv-cal th, .rv-cal td { border: 1px solid var(--rv-line); }
.rv-cal .rv-cal-machine { position: sticky; left: 0; background: #fff; z-index: 2; width: 180px; min-width: 180px; max-width: 180px; padding: 8px 12px; font-weight: 600; color: var(--rv-navy); }
.rv-cal thead th { background: #fafbfc; padding: 5px 0; font-size: .68rem; color: var(--rv-muted); text-align: center; width: 27px; min-width: 27px; max-width: 27px; }
.rv-cal thead th.rv-cal-wk { background: #eef0f3; }
.rv-cal thead th.rv-today { background: var(--rv-red); color: #fff; }
.rv-cal tbody td { height: 34px; padding: 0; text-align: center; position: relative; }
.rv-cal td.rv-cal-wkend { background: #f7f8fa; }
.rv-cal td.rv-today-col { background: rgba(204,34,41,.05); }
.rv-cal .rv-bar { position: absolute; top: 5px; bottom: 5px; left: 1px; right: 1px; border-radius: 4px; }
.rv-cal .rv-bar-firm  { background: #1a5fb4; }
.rv-cal .rv-bar-soft  { background: #b9c9e0; }
.rv-cal .rv-bar-maint { background: #9a6700; background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,255,255,.25) 4px, rgba(255,255,255,.25) 8px); }
.rv-cal .rv-bar-block { background: #555c66; }
.rv-cal-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: .82rem; color: var(--rv-muted); }
.rv-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rv-cal-legend i { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }

.rv-muted { color: var(--rv-muted); }
.rv-right { text-align: right; }
.rv-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rv-mb0 { margin-bottom: 0; }
.rv-actions-row { display: flex; gap: 7px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .rv-side { position: fixed; transform: translateX(-100%); transition: transform .2s; z-index: 50; }
  .rv-side.open { transform: translateX(0); }
  .rv-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .rv-grid-3, .rv-grid-2 { grid-template-columns: 1fr; }
  .rv-burger { display: inline-flex !important; }
}
.rv-burger { display: none; background: none; border: 0; cursor: pointer; }
