/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fb;
  color: #222;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  margin: 0 0 8px 0;
  font-weight: 600;
}

.muted {
  color: #666;
  font-size: 0.9em;
}

/* ---------- Layout ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #1f2937;
  color: #fff;
}

.topbar .brand {
  font-size: 1.2em;
  font-weight: 700;
}

.wrap { padding: 20px; }


.grid {
  display: grid;
  gap: 20px;
  padding-top:10px;
}

/* ---------- Panels ---------- */
.panel {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

/* Add nice spacing between stacked panels (only when stacked in normal flow) */
.wrap > .panel + .panel { margin-top: 20px; }

/* ---------- Rows ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.row.space-between { justify-content: space-between; }

/* ---------- Buttons ---------- */
.btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;

  /* nicer alignment for mixed icon/text buttons */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover { background: #1d4ed8; }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Inputs ---------- */
input,
select,
textarea {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9em;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus,
.btn:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
}

/* Make table inputs behave */
table input { width: 100%; }

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

thead th {
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
  padding: 8px;
}

tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
}

tfoot th {
  padding: 8px;
  border-top: 2px solid #e5e7eb;
}

/* ---------- Menu items ---------- */
#menu > div {
  transition: background 0.15s ease, transform 0.05s ease;
}

#menu > div:hover {
  background: #e5edff !important;
}

/* ---------- Alerts ---------- */
.alert {
  background: #fee2e2;
  color: #7f1d1d;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  line-height: 1.35;
}

/* ---------- Utility ---------- */
hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 16px 0;
}

/* =========================================================
   FIX #1: SelfEmp staff names are white (because they use .btn)
   Your JS uses: <button class="btn" style="background:#fff">
   So we force SELFEMP staff buttons to have dark text + border.
   ========================================================= */
#se_staff .btn {
  color: #111 !important;          /* fixes white-on-white */
  background: #fff !important;     /* looks like a list item */
  border: 1px solid #ddd !important;
}

#se_staff .btn:hover {
  background: #f3f6ff !important;
}

#se_staff .btn[style*="#eef2ff"] {
  background: #eef2ff !important;  /* selected state */
  border-color: #2563eb !important;
}

/* =========================================================
   FIX #2: FireLog header panel has no space above the list panel
   The header panel and #fl_list are siblings. Add top spacing.
   ========================================================= */
#fl_list.panel {
  margin-top: 20px;
}

/* Make FireLog rows clickable without making ALL tables clickable */
#fl_list tbody tr { cursor: pointer; }
#fl_list tbody tr:hover { background: #f3f6ff; }

/* Keep your modal above everything */
#fl_modal { z-index: 99999 !important; }

/* Optional: sticky table header for FireLog list (nice on long lists) */
#fl_list thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}


/* =========================
   Rivo top-right hover menu
   ========================= */

.navMenu { position: relative; }

.navItem { position: relative; }

.navTrigger {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.navTrigger:hover {
  background: rgba(255,255,255,0.12);
}

.navCaret {
  opacity: 0.9;
  font-size: 0.9em;
}

/* dropdown panel */
.navDropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  padding: 8px;
  display: none;
  z-index: 9999;
}

/* show on hover (desktop) */
@media (hover:hover) {
  .navItem:hover .navDropdown { display: block; }
}

/* show on click (mobile / touch) */
.navItem.open .navDropdown { display: block; }

.navLink {
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  color: #111;
  font-weight: 600;
}

.navLink:hover {
  background: #f3f6ff;
}

.navLink.active {
  background: #eef2ff;
  outline: 2px solid rgba(37,99,235,0.35);
}

/* Optional: make the topbar muted text readable on dark bg */
.topbar .muted { color: rgba(255,255,255,0.75); }