/* FlareShift UI skin (aligned to FlareSync look + improved UX) */
:root{
  --container-max: 1420px;
  --bg:#111111;
  --surface:#121212;
  --card:#1e1e1e;
  --card2:#252525;
  --border:#333333;
  --border2:#444444;

  --text:#f5f5f5;
  --muted:#c7c7c7;

  --accent:#aa9450;
  --accentHover:#c5ad5f;
  --accentText:#111111;

  --ok:#22c55e;
  --danger:#ef4444;

  --radius:12px;
  --radiusSm:8px;
  --pill:999px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a{color:var(--accent); text-decoration:none}
a:hover{color:var(--accentHover)}
code{
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
}

/* Layout */
.container{
  max-width: var(--container-max);
  margin:0 auto;
  padding: 20px 14px;
}

.topbar{
  position: sticky;
  top:0;
  z-index: 10;
  background: rgba(17,17,17,0.98);
  border-bottom: 1px solid var(--border);
}
.topbar .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand a{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: var(--text);
}
.brand-link{ text-decoration:none; }
.brand-logo{
  height: 46px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  display:block;
}

@media (max-width: 700px){
  .brand-logo{ height: 56px; max-width: 420px; }
}

@media (max-width: 520px){
  .brand-logo{ height: 52px; max-width: 360px; }
}

@media (max-width: 390px){
  .brand-logo{ height: 48px; max-width: 300px; }
}

/* Mobile nav layout: logo left, links right, logout below */
@media (max-width: 700px){
  /* grid layout: logo on left, nav stack on right */
  .topbar .container{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand{
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    min-width: 0;
  }

  .nav{
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: center;

    flex: none;
    width: auto;
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .nav-links{
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar{ display:none; }

  /* Logout becomes a bar under the nav links (right column only) */
  .nav-logout{
    width: 100%;
    margin-top: 0;
    display:flex;
    justify-content: flex-end;
  }
  .nav-logout form{
    width: auto;
    display:flex;
    justify-content: flex-end;
  }
  .nav-logout .logout-btn{
    width: clamp(220px, 56vw, 320px);
    justify-content: center;
  }
}

.nav .logout-btn{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  font-weight: 850;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
}
.nav .logout-btn:hover{ border-color: var(--accent); }
.nav form{ margin:0 }
.nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-links{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-logout{ display:flex; align-items:center; }

.nav a{color: var(--muted); font-weight: 750; white-space: nowrap}
.nav a:hover{color: var(--accent)}

/* Typography */
h1{margin:0 0 8px 0; font-size: 28px; font-weight: 900}
h2{margin:0 0 10px 0; font-size: 18px; font-weight: 850}
.muted{color: var(--muted); font-size: 13px}
.pill{
  display:inline-block;
  padding: 2px 8px;
  border-radius: var(--pill);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #2b2b2b;
  color: var(--muted);
  white-space: nowrap;
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.card.soft{background: var(--card2);}
hr.sep{border:none; border-top:1px solid var(--border); margin: 18px 0}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: #2b2b2b;
  color: var(--text);
  font-weight: 850;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  cursor:pointer;
  text-decoration:none;
}
.btn:hover{background:#303030; border-color:#3a3a3a; color: var(--text)}
.btn.primary{
  background: var(--accent);
  color: var(--accentText);
  border: none;
}
.btn.primary:hover{background: var(--accentHover); color: var(--accentText)}
.btn.secondary{
  background:#2b2b2b;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.danger{
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.35);
  color: #ffb3b3;
}
.btn.danger:hover{background: rgba(239,68,68,0.18)}
.btn.block{width: 100%}
.btn.small{padding: 7px 10px; font-size: 13px;}
@media (max-width: 700px){ .btn.small{padding: 6px 9px; font-size: 12px;} }

button.btn,
input.btn{
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

/* Forms */
.form{
  display:grid;
  gap: 10px;
  max-width: 520px;
}
.form.wide{max-width: 760px}
.form label{
  display:grid;
  gap: 6px;
  font-weight: 650;
  color: var(--text);
}

input, select, textarea{
  width:100%;
  padding: 10px 12px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
input::placeholder, textarea::placeholder{color:#777}
textarea{resize:vertical; min-height: 90px}
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color: var(--accent);
}

/* Login / auth */
.auth-wrap{
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 0 6px 0;
}
.auth-card{padding: 22px 24px}
.auth-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.err{margin-top: 12px; font-size: 13px; color: #ffb3b3}

/* Flash messages */
.flash-wrap{display:grid; gap: 10px; margin: 12px 0}
.flash{
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.flash.success{border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.08)}
.flash.error{border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.08)}

/* Tables */
.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th{
  text-align:left;
  font-size: 12px;
  color: var(--muted);
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tr:last-child td{border-bottom:none}
.table tr:hover td{background: rgba(255,255,255,0.03)}

/* Payroll: reduce action clutter + make "More" usable */
.payroll-actions{
  display:inline-flex;
  flex-direction:row;
  align-items:center;
  justify-content:flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}
.payroll-actions form{margin:0}
.payroll-actions .btn{white-space: nowrap;}
.action-more{position:relative;}
.action-more summary{list-style:none;}
.action-more summary::-webkit-details-marker{display:none;}
.action-more[open] summary{border-color: var(--accent);}

/* Timezone picker: make it visually obvious this is a dropdown */
.tz-switcher > summary.btn::after{
  content: "▾";
  display: inline-block;
  margin-left: 1px;
  font-size: 12px;
  opacity: .85;
  transform: translateY(-1px);
}
.tz-switcher[open] > summary.btn::after{
  transform: rotate(180deg) translateY(1px);
}
.page-payroll .action-more summary.btn{
  width: 44px;
  padding-left: 0;
  padding-right: 0;
}

.action-menu{
  /* Desktop: overlay menu so it doesn't expand table width/height */
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;

  min-width: 200px;
  max-width: 320px;

  display:grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);

  /* keep large inputs/buttons from spilling outside the popover */
  overflow: hidden;
}

/* Popover content: keep forms stacked and contained */
.action-menu form{margin:0;}
.action-menu form:not(.inline){
  display: grid;
  gap: 8px;
}
.action-menu .menu-label{
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.action-menu textarea{max-width: 100%;}
.action-menu form:not(.inline) .btn{justify-self: end;}

@media (max-width: 700px){
  .payroll-actions{align-items:stretch;}
  .payroll-actions .btn{width:100%;}
  .action-menu{
    position: static;
    min-width: 0;
    padding: 8px 0 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }
}

/* Calendar timezone picker */
.tz-row{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.tz-row .muted{margin:0;}

/* Admin calendar: keep "Times shown in" and timezone button on the same line (desktop) */
.cal-tz-line{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cal-tz-line .tz-picker-wrap{display:inline-flex;}
@media (min-width: 821px){
  .cal-tz-line{flex-wrap: nowrap;}
}

/* Payroll: nicer vertical spacing in Paid/Invoice columns */
.cell-stack{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Scroll wrapper for wide tables */
.table-scroll{overflow-x:auto; -webkit-overflow-scrolling:touch;}
.table-scroll::-webkit-scrollbar{height:10px;}

/* Responsive table helper (used by Audit and other dense tables) */
.table.responsive th, .table.responsive td, .table.responsive-table th, .table.responsive-table td{white-space:nowrap}
@media (max-width: 820px){
  .table.responsive, .table.responsive-table{display:block}
  .table.responsive thead, .table.responsive-table thead{display:none}
  .table.responsive tr, .table.responsive-table tr{display:block; padding: 10px 0; border-bottom: 1px solid var(--border)}
  .table.responsive tr:last-child, .table.responsive-table tr:last-child{border-bottom:0}
  .table.responsive td, .table.responsive-table td{display:flex; justify-content:space-between; gap: 12px; padding: 10px 14px; border:0}
  .table.responsive td::before, .table.responsive-table td::before{
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 12px;
    flex: 0 0 auto;
    padding-right: 10px;
  }
}

/* === Payroll: button-like chips for Paid/Invoice/Status + inline notes box === */
.page-payroll td.col-status .cell-stack.cell-center,
.page-payroll td.col-paid .cell-stack.cell-center,
.page-payroll td.col-invoice .cell-stack.cell-center{ align-items: center; }

.page-payroll th.col-status,
.page-payroll th.col-paid,
.page-payroll th.col-invoice,
.page-payroll td.col-status,
.page-payroll td.col-paid,
.page-payroll td.col-invoice{
  text-align: center;
}

/* Slightly taller status chips so "WORKED" doesn't look squished */
.page-payroll .pill{ display: inline-flex; align-items: center; line-height: 1; }
.page-payroll .pill.pill-static{ padding: 4px 10px; }

.page-payroll .chip-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.92);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  font-family: inherit;
}
.page-payroll .chip-btn:hover{ background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.18); }
.page-payroll .chip-btn:focus-visible{ outline: none; box-shadow: 0 0 0 3px rgba(170,148,80,0.35); }

.page-payroll .chip-btn.chip-subtle{
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
}

.page-payroll .chip-btn.has-caret{ position: relative; padding-right: 28px; }
.page-payroll .chip-btn.has-caret::after{
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.65;
  pointer-events: none;
}

/* Notes: always-visible textbox, compact for table rows */
.page-payroll .note-inline{
  display: grid;
  gap: 8px;
  margin-top: 2px;
}
.page-payroll .note-inline .btn{ justify-self: end; }
.page-payroll .note-textarea{
  width: 100%;
  min-height: 44px;
  resize: vertical;
}

@media (max-width: 820px){
  .page-payroll th.col-status,
  .page-payroll th.col-paid,
  .page-payroll th.col-invoice,
  .page-payroll td.col-status,
  .page-payroll td.col-paid,
  .page-payroll td.col-invoice{
    text-align: left;
  }
  .page-payroll .cell-stack.cell-center{ align-items: flex-start; }
  .page-payroll .chip-btn{ padding: 7px 12px; font-size: 12px; }
}

/* === Audit: fix mobile "missing" details by avoiding flex + forcing safe wrapping === */
.page-audit .audit-details{
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.audit-details{display:flex; flex-wrap:wrap; gap: 10px; align-items:center}
@media (max-width: 820px){ .audit-details{align-items:flex-start} }

/* Hosts table: keep rows compact + keep action button aligned */
.hosts-table{table-layout: fixed;}
.hosts-table th, .hosts-table td{
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hosts-table th.actions, .hosts-table td.actions{width: 90px; text-align: right;}

@media (max-width: 700px){
  .hosts-table th, .hosts-table td{padding: 10px 8px;}
  /* Hide less-critical columns on small screens */
  .hosts-table th:nth-child(4), .hosts-table td:nth-child(4),
  .hosts-table th:nth-child(5), .hosts-table td:nth-child(5){
    display: none;
  }
  .hosts-table th.actions, .hosts-table td.actions{width: 86px;}
}

/* Utility rows */
.row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.right{display:flex; align-items:center; justify-content:flex-end; gap: 10px; flex-wrap: wrap}

/* Filters */
.filters{
  display:flex;
  align-items:flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 14px 0;
}
.filters label{display:grid; gap:6px; font-weight: 650}
.filters input, .filters select{min-width: 170px}

/* Calendar filter bar (slimmer, single-row feel like the old "bar" UI) */
.calendar-filters{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 14px;
  flex-wrap: nowrap;

  padding: 12px 14px;
  margin: 14px 0 18px;
  border-radius: 18px;

  /* dark neutral bar (no blue tint) */
  background: rgba(27,27,27,0.92);
  border: 1px solid var(--border);
}

.calendar-filters .filters-left,
.calendar-filters .filters-right{
  display:flex;
  align-items:flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.calendar-filters .label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calendar-filters input[type="month"],
.calendar-filters select{
  min-width: 170px;
  height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(17,17,17,0.55);
  border: 1px solid rgba(255,255,255,0.12);
}

.calendar-filters .btn{
  height: 40px;
  padding: 0 14px;
}

.calendar-filters .filters-go{display:flex; align-items:flex-end;}
.calendar-filters .cal-arrows{display:flex; gap: 10px;}

@media (max-width: 900px){
  .calendar-filters{flex-wrap: wrap;}
  .calendar-filters .filters-left{flex: 1 1 520px;}
  .calendar-filters .filters-right{margin-left:auto;}
}

@media (max-width: 700px){
  .calendar-filters{
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    margin: 12px 0 16px;
  }

  /* Row 1: City / Month / Go (same line) */
  .calendar-filters .filters-left{
    flex: 1 1 100%;
    display:flex;
    align-items:flex-end;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .calendar-filters .filters-left label{
    flex: 1 1 0;
    min-width: 0;
  }
  .calendar-filters .filters-go{
    flex: 0 0 auto;
  }
  .calendar-filters input[type="month"],
  .calendar-filters select{
    min-width: 0;
    width: 100%;
  }

  /* Row 2: Current month + arrows (pulled up, no dead space) */
  .calendar-filters .filters-right{
    flex: 1 1 100%;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .calendar-filters .cal-today{
    flex: 0 0 auto;
    width: clamp(160px, 46vw, 220px);
    text-align: center;
  }
  .calendar-filters .cal-arrows{
    flex: 0 0 auto;
    gap: 8px;
  }
  }

/* Calendar controls */
.cal-tools{
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.cal-arrows{
  display:flex;
  gap:10px;
}
.btn.arrow{
  padding: 0;
  width: 44px;
  height: 44px;
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

/* Calendar scroll wrapper (mobile: horizontal scroll instead of squished columns) */
.calendar-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  max-width:100%;
}
.calendar-scroll::-webkit-scrollbar{height:10px;}

/* Calendar */
.calendar{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

@media (max-width: 700px){
  /* Don't squash the 7-day grid on phones; scroll instead */
  .calendar{min-width: 840px;}
}

/* Keep wrapper for older browsers, but prefer flattening for perfect alignment */
.cal-grid{
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

@supports (display: contents){
  /* Day cells become direct grid children so header + days share the same tracks */
  .cal-grid{
    display: contents;
    grid-column: auto;
    grid-template-columns: none;
  }
}

.cal-dow{
  min-width: 0;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-weight: 800;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cal-dow:nth-child(7n){border-right:none}

.day-cell{
  min-width: 0;
  min-height: 120px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 10px 12px 10px;
}
.day-today{
  background: rgba(170,148,80,0.10);
  box-shadow: inset 0 0 0 2px rgba(170,148,80,0.45);
}
.day-today .day-num{
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--pill);
  background: rgba(170,148,80,0.18);
  color: var(--accent);
}
.day-cell:nth-child(7n){border-right:none}
.day-num{font-weight: 900; font-size: 13px; color: var(--text); opacity: 0.9}
.day-muted .day-num{opacity: 0.45}
.day-events{display:grid; gap: 6px; margin-top: 8px}
.event-pill{
  position: relative;
  display:block;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  padding: 8px 9px;
  color: var(--text);
}
.event-pill:hover{border-color: rgba(170,148,80,0.65); border-left-color: var(--city, rgba(170,148,80,0.65)); background: rgba(170,148,80,0.08)}
.event-pill.assigned{
  border-color: rgba(170,148,80,0.55);
  border-left-color: rgba(170,148,80,0.85);
  background: rgba(170,148,80,0.10);
  box-shadow: inset 0 0 0 1px rgba(170,148,80,0.10);
}
.event-pill.assigned:hover{background: rgba(170,148,80,0.14)}
.assigned-badge{
  position:absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(170,148,80,0.20);
  border: 1px solid rgba(170,148,80,0.45);
  pointer-events: none;
}
.assigned-badge svg{width: 12px; height: 12px; display:block; color: var(--accent)}
.day-has-assigned{background: rgba(170,148,80,0.05)}
.event-pill .time{color: var(--accent); font-weight: 900; font-size: 12px}
.event-pill .title{font-weight: 850; font-size: 13px; margin-top: 2px}
.event-pill .meta{color: var(--muted); font-size: 12px; margin-top: 2px}

/* Footer */
.footer{
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
}



/* ----------------------------
   City colour-coding
   ---------------------------- */
:root{
  --city-default: #D4A72C;
  --city-toronto: #5B6C8F;
  --city-ottawa: #FACC15;
  --city-montreal: #14B8A6;
  --city-quebec-city: #2563EB;
  --city-winnipeg: #E67E22;
  --city-calgary: #DC2626;
  --city-edmonton: #8B5CF6;
  --city-vancouver: #22C55E;
}

.event-pill{ border-left-width: 4px; }
.event-pill{ border-left-color: var(--city, var(--city-default)); }
.event-pill .time{ display:flex; align-items:center; gap:8px; }
.event-pill .time::before{
  content:"";
  display: inline-block;
  flex: 0 0 auto;
  width:8px;
  height:8px;
  border-radius: 999px;
  background: var(--city, var(--city-default));
  opacity: 0.95;
}

/* map cities to CSS variables */
.event-pill.city-toronto, .city-dot.city-toronto{ --city: var(--city-toronto); }
.event-pill.city-ottawa, .city-dot.city-ottawa{ --city: var(--city-ottawa); }
.event-pill.city-montreal, .city-dot.city-montreal{ --city: var(--city-montreal); }
.event-pill.city-quebec-city, .city-dot.city-quebec-city{ --city: var(--city-quebec-city); }
.event-pill.city-winnipeg, .city-dot.city-winnipeg{ --city: var(--city-winnipeg); }
.event-pill.city-calgary, .city-dot.city-calgary{ --city: var(--city-calgary); }
.event-pill.city-edmonton, .city-dot.city-edmonton{ --city: var(--city-edmonton); }
.event-pill.city-vancouver, .city-dot.city-vancouver{ --city: var(--city-vancouver); }
.event-pill.city-default, .city-dot.city-default,
.event-pill.city-unknown, .city-dot.city-unknown{ --city: var(--city-default); }

.city-dot{
  display:inline-block;
  width:10px; height:10px;
  border-radius: 999px;
  margin-right: 8px;
  background: var(--city, var(--city-default));
  vertical-align: middle;
}

.help{display:block;margin-top:6px;color:var(--muted);font-size:12px;line-height:1.4}


.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;}


/* Payroll column helpers */
.col-paid{ white-space: nowrap; }



/* ----------------------------
   Calendar month nav arrows (SVG) — thin + slightly smaller
   ---------------------------- */

/* Make arrow buttons true circles and center the SVG perfectly */
.calendar-filters .btn.arrow{
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Ensure SVG chevrons are the right size and not visually "bold" */
.btn.arrow svg{
  width: 16px;
  height: 16px;
  display: block;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ----------------------------
   Payroll mobile cards
   ---------------------------- */
@media (max-width: 900px){
  .page-payroll .row{
    flex-direction: column;
    align-items: flex-start;
  }
  .page-payroll .row .btn{
    width: 100%;
    justify-content: center;
  }

  .page-payroll .filters{
    gap: 12px;
  }
  .page-payroll .filters label{
    width: 100%;
  }
  .page-payroll .filters input,
  .page-payroll .filters select{
    min-width: 0;
    width: 100%;
  }
  .page-payroll .filters .btn,
  .page-payroll .filters a.btn{
    width: 100%;
    justify-content: center;
  }

  /* turn table into stacked cards */
  .page-payroll .payroll-table{
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }
  .page-payroll .payroll-table thead{display:none;}
  .page-payroll .payroll-table tbody{display:block;}
  .page-payroll .payroll-table tr{
    display:block;
    margin: 0 0 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .page-payroll .payroll-table td{
    display:block;
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
  }
  .page-payroll .payroll-table td:last-child{border-bottom:none;}
  .page-payroll .payroll-table td::before{
    content: attr(data-label);
    display:block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .page-payroll .payroll-table td.actions{
    background: rgba(255,255,255,0.02);
  }
  .page-payroll .payroll-actions{
    width: 100%;
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .page-payroll .payroll-actions .btn{
    width: 100%;
    justify-content: center;
  }
  .page-payroll .action-more{
    width: 100%;
  }
  .page-payroll .action-more summary.btn{
    width: 100%;
  }
}




/* Actions column layout (host time-off, hosts, etc.) */
.table td.actions{white-space:nowrap}
.table td.actions form{margin:0}
.table td.actions form.inline{display:inline}
@media (min-width: 821px){
  .table td.actions{display:flex; justify-content:flex-end; align-items:center; gap: 10px}
  .table td.actions form.inline{display:inline-flex}
}
@media (max-width: 820px){
  .table td.actions{display:flex; justify-content:flex-start; align-items:center; gap: 10px}
  .table td.actions form.inline{display:inline-flex}
}

/* Payroll-specific action cell fixes (prevents the "..." menu from breaking the table) */
.page-payroll .payroll-table{
  /* allow the actions popover to render outside the table box */
  overflow: visible;
}

/* Payroll desktop column sizing: keep Actions visible and avoid horizontal overflow */
@media (min-width: 821px){
  .page-payroll .payroll-table{ table-layout: fixed; }
  .page-payroll .payroll-table th.col-event,
  .page-payroll .payroll-table td.col-event{ width: 300px; }

  .page-payroll .payroll-table th.col-host,
  .page-payroll .payroll-table td.col-host{ width: 210px; }

  .page-payroll .payroll-table th.col-when,
  .page-payroll .payroll-table td.col-when{ width: 150px; }

  .page-payroll .payroll-table th.col-amount,
  .page-payroll .payroll-table td.col-amount{ width: 110px; }

  .page-payroll .payroll-table th.col-status,
  .page-payroll .payroll-table td.col-status{ width: 115px; }

  .page-payroll .payroll-table th.col-paid,
  .page-payroll .payroll-table td.col-paid{ width: 105px; }

  .page-payroll .payroll-table th.col-invoice,
  .page-payroll .payroll-table td.col-invoice{ width: 155px; }

  .page-payroll .payroll-table th.actions,
  .page-payroll .payroll-table td.actions{ width: 190px; }

  .page-payroll .payroll-table td{ overflow-wrap: anywhere; }
}

@media (min-width: 821px){
  .page-payroll .payroll-table th.actions{
    text-align: center;
  }
  .page-payroll .payroll-table td.actions{
    /* keep table-cell behavior on desktop (avoids odd background blocks) */
    display: table-cell;
    text-align: center;
    vertical-align: middle;
  }
  .page-payroll .payroll-actions{
    justify-content: center;
  }
}


/* Host event checklist styling */
.host-event-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 860px) {
  .host-event-grid {
    grid-template-columns: 1fr;
  }
}

.host-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.host-checklist details.checklist-item {
  position: relative;
  border: 1px solid rgba(170, 148, 80, 0.28);
  border-radius: 14px;
  background: rgba(170, 148, 80, 0.05);
  overflow: hidden;
}

.host-checklist details.checklist-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(170, 148, 80, 0.9);
  opacity: 0.35;
}

.host-checklist details.checklist-item[open]::before {
  opacity: 0.8;
}

.host-checklist details.checklist-item > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.host-checklist details.checklist-item > summary:hover {
  background: rgba(170, 148, 80, 0.07);
}

.host-checklist details.checklist-item[open] > summary {
  background: rgba(170, 148, 80, 0.10);
  border-bottom: 1px solid rgba(170, 148, 80, 0.20);
}

.host-checklist details.checklist-item > summary::-webkit-details-marker {
  display: none;
}

.host-checklist details.checklist-item > summary::marker {
  content: "";
}

.host-checklist .checklist-chev {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 2px solid rgba(170, 148, 80, 0.9);
  border-bottom: 2px solid rgba(170, 148, 80, 0.9);
  transform: rotate(-45deg);
  margin-left: 8px;
}

.host-checklist details.checklist-item[open] .checklist-chev {
  transform: rotate(45deg);
}

.host-checklist .checklist-body {
  padding: 10px 14px 14px 14px;
}

.host-checklist .checklist-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.host-checklist .checklist-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.host-checklist .checklist-list .city-dot {
  margin-top: 7px;
}

/* --- Payroll polish: merge invoice pill+action + notes empty-state --- */

/* Pill variants used in templates */
.pill.secondary{
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill.danger{
  background: rgba(239,68,68,0.16);
  border: 1px solid rgba(239,68,68,0.35);
  color: #ffb3b3;
}

/* Allow pills to be used as buttons (Invoice toggle) */
button.pill{
  appearance: none;
  -webkit-appearance: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
}
button.pill:hover{ background: #343434; }
button.pill.secondary:hover{ border-color: #3a3a3a; }

/* Keep invoice content from stretching full-width inside flex column */
.page-payroll .payroll-table td.col-invoice .cell-stack{
  align-items: flex-start;
}

/* Slightly tighten spacing where the redlines were */
.page-payroll .payroll-table td.col-status .cell-stack,
.page-payroll .payroll-table td.col-invoice .cell-stack{
  gap: 4px;
}

/* Notes: keep the Add/Edit button from floating too far from any existing content */
.page-payroll .note-details{ margin-top: 6px; }

/* Payroll: fine-tune control positioning + unify action pill color (Paid/Invoice match Notes) */

/* 1) Nudge the control group so it sits visually under headers (less empty gutter before STATUS, more room before NOTES) */
@media (min-width: 821px){
  .page-payroll td.col-status,
  .page-payroll td.col-paid,
  .page-payroll td.col-invoice,
  .page-payroll td.col-notes{
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Pull STATUS a touch closer to AMOUNT (left red arrow) */
  .page-payroll th.col-status,
  .page-payroll td.col-status{
    padding-left: 6px;
  }

  /* Give NOTES a bit more breathing room (right red arrow) */
  .page-payroll th.col-notes,
  .page-payroll td.col-notes{
    padding-left: 16px;
  }
}

/* 2) Make Paid + Invoice action pills use the same neutral “Notes” look (not gold-outline) */
.page-payroll .pill-btn.action-primary,
.page-payroll .pill-btn.action-secondary{
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
}

/* Hover/focus: subtle lift, still neutral */
.page-payroll .pill-btn.action-primary:hover,
.page-payroll .pill-btn.action-secondary:hover,
.page-payroll .pill-btn.action-primary:focus-visible,
.page-payroll .pill-btn.action-secondary:focus-visible{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
}

/* Keep the caret visible on these */
.page-payroll .pill-btn.action-primary .caret,
.page-payroll .pill-btn.action-secondary .caret{
  opacity: 0.75;
}

/* Optional: keep static status chips quiet */
.page-payroll .pill-static{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

/* === Fix: Mobile responsive tables (Audit + Payroll) ===
   Previous rules used space-between which pushed values off-screen and stretched pills.
   This override stacks label + value and prevents full-width “pills”.
*/
@media (max-width: 820px){
  .table.responsive th, .table.responsive td, .table.responsive-table th, .table.responsive-table td{white-space: normal !important;}
  .table.responsive td, .table.responsive-table td{
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px !important;
  }
  .table.responsive td::before, .table.responsive-table td::before{
    padding-right: 0 !important;
    margin-bottom: 2px;
  }
}

/* === Payroll: restore visible carets + make chips compact on mobile === */
.page-payroll .pill-action-caret,
.page-payroll .note-details > summary{
  position: relative;
  padding-right: 26px;
}

/* Hide native summary marker; we draw our own caret */
.page-payroll .note-details > summary::-webkit-details-marker{display:none;}
.page-payroll .note-details > summary::marker{content:'';}

/* Draw caret on clickable controls */
.page-payroll .pill-action-caret::after,
.page-payroll .note-details > summary::after{
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.65;
  pointer-events: none;
}

@media (max-width: 820px){
  /* Keep chips small and non-stretchy */
  .page-payroll .cell-stack{align-items: flex-start !important;}
  .page-payroll .pill,
  .page-payroll .note-details > summary{
    align-self: flex-start !important;
    width: auto !important;
    max-width: 100% !important;
  }
  .page-payroll .pill{
    padding: 4px 10px;
    font-size: 11px;
  }
  .page-payroll .pill.pill-action{
    padding: 6px 12px;
    font-size: 12px;
  }
  .page-payroll .pill.secondary{
    padding: 4px 10px;
    font-size: 11px;
  }
}
