/* =============================================
   Revenue Team Ops — Shared Styles
   (PTO, Remote Work, Commissions, Travel pages)
   ============================================= */

/* ---- Hero — deprecated, replaced by .greeting in styles.css ---- */
/* WHY: Sub-pages now use .greeting instead of .ops-hero.
   Kept as fallback only. */
.ops-hero {
  background: var(--white, #fff);
  color: var(--text, #1a1a1a);
  padding: 32px 0 16px;
  border-bottom: 1px solid var(--border, #d1d1d6);
}
.ops-hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.ops-hero .hero-sub { color: var(--text-muted, #636366); font-size: 14px; margin-top: 4px; }

/* ---- Cards ---- */
.ops-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--uncs-red);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
}
.ops-card h2 {
  font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

/* ---- Forms ---- */
.ops-form .form-row { display: flex; gap: 16px; }
.ops-form .form-group { flex: 1; margin-bottom: 14px; }
.ops-form label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.ops-form input[type="date"],
.ops-form input[type="text"],
.ops-form select,
.ops-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
}
.ops-form input:focus, .ops-form select:focus, .ops-form textarea:focus {
  outline: none;
  border-color: var(--uncs-blue);
  box-shadow: 0 0 0 3px rgba(59,94,219,.1);
}
.ops-form .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.ops-form .checkbox-label input[type="checkbox"] { margin-top: 3px; }

/* ---- Conflict Panel ---- */
.conflict-panel {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
}
.conflict-ok {
  background: var(--green-bg);
  color: var(--green);
  border-left: 4px solid var(--green);
  padding: 10px 14px;
  border-radius: 6px;
}
.conflict-blocked {
  background: #fde8e8;
  color: #aa2327;
  border-left: 4px solid #aa2327;
  padding: 10px 14px;
  border-radius: 6px;
}

/* ---- Tables ---- */
.ops-table-wrap { overflow-x: auto; }
.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ops-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ops-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.ops-table tr:last-child td { border-bottom: none; }
.ops-table tr:hover { background: rgba(0,0,0,.02); }

/* ---- Status Badges ---- */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.status-approved { background: var(--green-bg); color: var(--green); }
.status-pending { background: #fff3cd; color: #856404; }
.status-denied { background: #fde8e8; color: #aa2327; }

/* ---- Override Cards ---- */
.override-card {
  background: #fff9e6;
  border: 1px solid #f0d060;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.override-header { font-size: 16px; margin-bottom: 6px; }
.override-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---- Calendar List ---- */
.calendar-list { display: flex; flex-direction: column; gap: 8px; }
.calendar-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
}
.cal-date { font-weight: 600; min-width: 180px; color: var(--text); }
.cal-name { flex: 1; }
.cal-dept { color: var(--text-muted); font-size: 13px; }
.cal-tag {
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.cal-tag-pto { background: #fde8e8; color: #aa2327; }
.cal-tag-travel { background: var(--blue-bg); color: var(--uncs-blue); }

/* ---- Summary Cards (commissions, stats) ---- */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.summary-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.summary-card .card-value { font-size: 28px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.summary-card .card-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ---- Remote Work Status ---- */
.remote-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}
.remote-available { background: var(--green-bg); border-left: 4px solid var(--green); }
.remote-full { background: #fde8e8; border-left: 4px solid #aa2327; }

/* ---- Toast Notifications ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  z-index: 1000;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  max-width: 90%;
  text-align: center;
}
.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--green); }
.toast-error { background: #aa2327; }
.toast-warning { background: #856404; }
.toast-info { background: var(--uncs-blue); }

/* ---- Shared text helpers ---- */
.text-muted { color: var(--text-muted); font-size: 14px; }

/* ---- Nav brand link (for sub-pages) ---- */
.nav-brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.nav-brand-link:hover { text-decoration: none; }

/* ---- Active nav link ---- */
.nav-link.active { font-weight: 700; border-bottom: 2px solid var(--white); }

/* ---- Tabs ---- */
.tab-bar { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text, #1a1a1a); border-bottom-color: var(--uncs-red, #aa2327); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Calendar Filters ---- */
.calendar-filters { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--uncs-dark); color: var(--text); }
.filter-btn.active { background: var(--text, #1a1a1a); color: var(--white); border-color: var(--text, #1a1a1a); }

/* ---- Today's Snapshot ---- */
.coverage-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.snapshot-group { flex: 1; min-width: 200px; }
.snapshot-label { margin-bottom: 8px; }
.snapshot-person { padding: 4px 0; font-size: 14px; }
.snapshot-empty { color: var(--green); font-weight: 500; font-size: 15px; padding: 8px 0; }

/* ---- Remote tag (new color) ---- */
.cal-tag-remote { background: #e0f0ff; color: #1a5fa0; }

/* ---- Holiday tag + entry ---- */
.cal-tag-holiday { background: #f3e8ff; color: #6b21a8; }
.cal-tag-in-office { background: #dcfce7; color: #16a34a; }
.calendar-entry-holiday { background: #f9f5ff; border-left: 3px solid #6b21a8; }
.snapshot-group-wide { flex-basis: 100%; }

/* ---- Commission Dashboard ---- */
.comm-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.comm-total { text-align: right; }
.progress-section { margin: 12px 0; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.progress-pct { font-weight: 700; }
.progress-bar { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.progress-bar-sm { height: 6px; margin: 6px 0 4px; }
.progress-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.quarter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.quarter-card { background: var(--bg); border-radius: 8px; padding: 12px; text-align: center; }
.quarter-name { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.quarter-agp { font-size: 18px; font-weight: 700; color: var(--text); margin: 4px 0; }
.quarter-meta { font-size: 11px; color: var(--text-muted); }
.quarter-comm { font-size: 12px; font-weight: 600; color: var(--green); margin-top: 4px; }
.kicker-section { font-size: 13px; margin-top: 12px; padding: 8px 12px; background: var(--bg); border-radius: 6px; }

/* ---- Pipeline ---- */
:root { --pipeline-color: #6366f1; }
.progress-fill-pipeline { position: relative; }
.progress-bar { display: flex; overflow: hidden; }
.pipeline-stages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pipeline-tag { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }

/* ---- Commission stats + status dots ---- */
.comm-stats { display: flex; gap: 20px; margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* ---- Bar legend ---- */
.bar-legend { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.legend-swatch { width: 12px; height: 6px; border-radius: 3px; display: inline-block; }

/* ---- Shipment tags ---- */
.ship-tag { font-size: 10px; font-weight: 500; padding: 2px 6px; border: 1px solid; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; }
.ship-type { font-weight: 700; font-size: 9px; opacity: 0.7; }

/* ---- Collapsible deal status sections ---- */
.deal-status-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 4px 0; user-select: none; }
.deal-status-header:hover { opacity: 0.8; }
.deal-status-title { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 600; color: var(--uncs-dark); }
.toggle-arrow { font-size: 12px; color: var(--text-muted); min-width: 14px; text-align: center; }

@media (max-width: 600px) {
  .quarter-grid { grid-template-columns: repeat(2, 1fr); }
  .comm-header { flex-direction: column; gap: 8px; }
  .comm-total { text-align: left; }
}

/* ---- Month Grid Calendar ---- */
.cal-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cal-month-label { font-size: 18px; font-weight: 600; min-width: 180px; text-align: center; }
.month-grid-wrap { overflow: visible; }
.month-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); }
.grid-day-name {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 0;
  letter-spacing: .5px;
}
.month-grid-body { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.grid-cell {
  background: var(--white);
  min-height: 90px;
  padding: 4px 6px;
  position: relative;
  cursor: pointer;
}
.grid-cell-empty { background: var(--bg); cursor: default; }
.grid-cell-weekend { background: #fafafa; }
.grid-cell-today { box-shadow: inset 0 0 0 2px var(--uncs-blue); }
.grid-cell-holiday { background: #f9f5ff; }
.grid-day-num { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.grid-cell-today .grid-day-num { color: var(--uncs-blue); }
.grid-events { display: flex; flex-direction: column; gap: 2px; }
.grid-event {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.grid-event-pto { background: #fde8e8; color: #aa2327; }
.grid-event-remote { background: #e0f0ff; color: #1a5fa0; }
.grid-event-travel { background: var(--blue-bg); color: var(--uncs-blue); }
.grid-event-holiday { background: #e9d5ff; color: #6b21a8; font-weight: 600; }
.grid-event-in-office { background: #dcfce7; color: #16a34a; }

/* WHY: Colored dots shown on mobile instead of text labels.
   Tapping a day with dots reveals the full detail panel below the grid. */
.grid-dots { display: none; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 2px; }
.grid-dot { width: 7px; height: 7px; border-radius: 50%; }
.grid-dot-pto { background: #aa2327; }
.grid-dot-remote { background: #1a5fa0; }
.grid-dot-travel { background: var(--uncs-blue); }
.grid-dot-holiday { background: #6b21a8; }
.grid-dot-in-office { background: #16a34a; }

/* Day detail panel — shown when tapping a day on mobile */
.day-detail-panel {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 8px;
  box-shadow: var(--shadow-md);
}
.day-detail-panel.active { display: block; }
.day-detail-date { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--uncs-dark); }
.day-detail-item { font-size: 13px; padding: 4px 0; display: flex; align-items: center; gap: 8px; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .ops-form .form-row { flex-direction: column; gap: 0; }
  .calendar-entry { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cal-date { min-width: auto; }
  .summary-cards { grid-template-columns: 1fr; }

  /* Calendar: compact mobile layout */
  .grid-cell { min-height: 48px; padding: 3px 2px; }
  .grid-day-num { font-size: 11px; text-align: center; margin-bottom: 1px; }
  .grid-day-name { font-size: 9px; padding: 4px 0; letter-spacing: 0; }
  .cal-month-label { font-size: 15px; min-width: 140px; }

  /* WHY: On mobile, hide text event labels and show colored dots instead.
     This prevents text overflow in narrow cells. Tap to see detail panel. */
  .grid-events { display: none !important; }
  .grid-dots { display: flex; }

  /* Commission responsive */
  .quarter-grid { grid-template-columns: repeat(2, 1fr); }
  .comm-header { flex-direction: column; gap: 8px; }
  .comm-total { text-align: left; }
  .comm-stats { flex-direction: column; gap: 4px; }
  .bar-legend { gap: 8px; }
  .deal-status-header { flex-direction: column; gap: 6px; }
  .ops-card { padding: 16px 12px; }

  /* Install banner mobile */
  .install-banner { flex-direction: column; text-align: center; }
}
