/* Google-Sheets-style department roster */
.gsheet-page { padding-bottom: 24px; }
.gsheet-chrome {
  background: #fff;
  color: #202124;
  border: 1px solid #dadce0;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  margin: 0 0 16px;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}
.gsheet-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #dadce0;
}
.gsheet-doc-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: #0f9d58;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 4px;
  flex: none;
}
.gsheet-title {
  font-size: 18px;
  font-weight: 500;
  border: 0;
  background: transparent;
  color: #202124;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 160px;
  flex: 1;
}
.gsheet-title[readonly] { outline: none; }
.gsheet-title:not([readonly]):hover,
.gsheet-title:not([readonly]):focus { background: #fff; box-shadow: 0 0 0 1px #dadce0; }
.gsheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #dadce0;
  background: #fff;
}
.gsheet-toolbar input[type="search"],
.gsheet-toolbar select {
  font: 13px Arial, Helvetica, sans-serif;
  padding: 6px 8px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #202124;
  min-width: 120px;
}
.gsheet-toolbar input[type="search"] { flex: 1; min-width: 180px; max-width: 320px; }
.gsheet-toolbar .btn { font-size: 12px; }
.gsheet-toast { margin: 0; border-radius: 0; }
.gsheet-wrap {
  overflow: auto;
  max-height: min(74vh, 980px);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.gsheet {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  line-height: 1.3;
  color: #202124;
  min-width: 960px;
  background: #fff;
}
.gsheet th, .gsheet td {
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  padding: 0;
  vertical-align: middle;
  background: #fff;
}
.gsheet thead th {
  position: sticky;
  z-index: 4;
  font-weight: 700;
  text-align: center;
  user-select: none;
  white-space: nowrap;
}
.gsheet thead tr.gsheet-letters th {
  top: 0;
  background: #f8f9fa;
  color: #5f6368;
  font-size: 11px;
  font-weight: 500;
  height: 22px;
  z-index: 5;
}
.gsheet thead tr.gsheet-labels th {
  top: 22px;
  background: #e8eaed;
  color: #202124;
  font-size: 12px;
  text-align: left;
  padding: 6px 8px;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 1px 0 #c6c6c6;
}
.gsheet thead tr.gsheet-labels th:hover { background: #dadce0; }
.gsheet thead th.gsheet-corner,
.gsheet td.gsheet-rownum {
  position: sticky;
  left: 0;
  z-index: 6;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  background: #f8f9fa;
  color: #5f6368;
  font-size: 11px;
  font-weight: 500;
  border-right: 1px solid #c6c6c6;
}
.gsheet thead th.gsheet-corner { z-index: 7; top: 0; }
.gsheet thead tr.gsheet-labels th.gsheet-corner { top: 22px; }
.gsheet tbody td.gsheet-rownum { z-index: 3; }
.gsheet tbody tr:nth-child(even) td { background: #f8f9fa; }
.gsheet tbody tr:nth-child(even) td.gsheet-rownum { background: #f1f3f4; }
.gsheet tbody tr:hover td { background: #e8f0fe; }
.gsheet tbody tr:hover td.gsheet-rownum { background: #d2e3fc; }
.gsheet tbody tr.is-saving td { background: #e6f4ea; }
.gsheet tbody tr.is-error td { background: #fce8e6; }
.gsheet tbody tr.gsheet-band td {
  position: sticky;
  left: 0;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(0,0,0,.12);
  border-right: 0;
}
.gsheet td > input,
.gsheet td > select,
.gsheet td > .cell-display {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}
.gsheet td > input:focus,
.gsheet td > select:focus {
  outline: 2px solid #1a73e8;
  outline-offset: -2px;
  background: #fff;
  position: relative;
  z-index: 2;
}
.gsheet .cell-display { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsheet .cell-name { font-weight: 650; }
.gsheet .cell-name a { color: #174ea6; text-decoration: none; }
.gsheet .cell-name a:hover { text-decoration: underline; }
.gsheet-person { display: flex; align-items: center; gap: 6px; min-width: 120px; }
.gsheet-meta { color: #5f6368; font-size: 12px; }
.gsheet-actions { white-space: nowrap; padding: 2px 6px !important; background: inherit; }
.gsheet-empty { text-align: center; color: #5f6368; padding: 28px 10px !important; }
.gsheet .status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.gsheet .status-pill.active { background: #ceead6; color: #137333; }
.gsheet .status-pill.on_duty, .gsheet .status-pill.on-duty { background: #0f9d58; color: #fff; }
.gsheet .status-pill.loa { background: #fce8b2; color: #8a5a00; }
.gsheet .status-pill.inactive { background: #e8eaed; color: #3c4043; }
.gsheet .status-pill.removed { background: #fad2cf; color: #c5221f; }
.gsheet-drag { cursor: grab; color: #80868b; padding: 0 4px; }
.gsheet-add {
  margin: 0;
  padding: 14px 16px 18px;
  background: #fff;
  border-top: 1px solid #dadce0;
  color: #202124;
}
.gsheet-add h3 { margin: 0 0 10px; font-size: 14px; color: #202124; }
.gsheet-add .add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}
.gsheet-add .field { color: #202124; }
.gsheet-add input, .gsheet-add select {
  background: #fff;
  color: #202124;
  border: 1px solid #dadce0;
}
.gsheet-panel {
  display: none;
  padding: 14px 16px 18px;
  background: #f8f9fa;
  border-top: 1px solid #dadce0;
  color: #202124;
}
.gsheet-panel.is-open { display: block; }
.gsheet-panel h3 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #5f6368; }
.gsheet-panel h3:first-child { margin-top: 0; }
.gsheet-panel table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gsheet-panel th, .gsheet-panel td { padding: 4px 6px; text-align: left; border-bottom: 1px solid #e0e0e0; }
.gsheet-panel input[type="text"],
.gsheet-panel input[type="url"],
.gsheet-panel input[type="color"],
.gsheet-panel textarea,
.gsheet-panel select {
  font: 13px Arial, Helvetica, sans-serif;
  padding: 4px 6px;
  border: 1px solid #dadce0;
  border-radius: 3px;
  background: #fff;
  color: #202124;
  width: 100%;
  box-sizing: border-box;
}
.gsheet-panel textarea { min-height: 80px; resize: vertical; }
.gsheet-panel .row-actions { white-space: nowrap; }
.gsheet-panel .btn { font-size: 12px; }
.gsheet-help { color: #5f6368; font-size: 12px; margin: 0 0 8px; }
.accept-invite {
  margin: 12px 16px;
  padding: 14px 16px;
  background: #e6f4ea;
  border: 1px solid #0f9d58;
  border-radius: 8px;
  color: #137333;
}
.accept-invite a { color: #0b8043; font-weight: 700; word-break: break-all; }
.accept-invite h2 { margin: 0 0 6px; font-size: 16px; color: #0b8043; }
.dm-note { margin: 8px 16px; padding: 10px 12px; border-radius: 6px; }
.dm-note.ok { background: #e6f4ea; color: #137333; }
.dm-note.warn { background: #fce8b2; color: #8a5a00; }
.admin-invite-box { padding: 16px; }
@media (max-width: 700px) {
  .gsheet { min-width: 860px; }
  .gsheet-wrap { max-height: 70vh; }
}
