/*
 * OrgTrack – theme.css
 * Visual design inspired by betweenfriends.ab.ca
 * Colours driven by CSS variables set in base.html from BrandingProfile.
 * Fallback values match the Between Friends AB colour palette.
 */

:root {
  --ot-primary:        #1e3a6e;   /* BF dark navy       */
  --ot-secondary:      #6b7280;   /* medium grey        */
  --ot-accent:         #6b7280;   /* grey               */
  --ot-nav-text:       #ffffff;
  --ot-font:           'DM Sans', 'Segoe UI', sans-serif;

  /* Extended palette */
  --ot-navy-light:     #2e4f8e;
  --ot-grey-light:     #edf2f7;
  --ot-pink:           #d9027d;
  --ot-green:          #009739;
  --ot-yellow:         #f1b434;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  font-family: var(--ot-font);
  background-color: #edf2f7;   /* light cool grey-blue */
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

h1, h2 {
  color: #6b7280;
  font-weight: 800;
}

/* ── Navbar ─────────────────────────────────────────────────── BF block nav ── */
.ot-navbar {
  background-color: #ffffff !important;
  border-bottom: 3px solid var(--ot-primary);
  padding-top: 0;
  padding-bottom: 0;
}

.ot-navbar .navbar-brand {
  color: var(--ot-primary) !important;
  font-weight: 800;
  letter-spacing: .02em;
  padding: .9rem 1rem;
}

.ot-navbar .nav-link {
  color: var(--ot-primary) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .06em;
  padding: .95rem 1.1rem !important;
  border-bottom: none !important;
  transition: background-color .15s ease;
}

.ot-navbar .nav-link:hover {
  color: #ffffff !important;
  background-color: var(--ot-primary);
  border-bottom: none !important;
}

.ot-navbar .nav-link.active {
  color: #ffffff !important;
  background-color: var(--ot-primary);
  border-bottom: none !important;
}

/* Testimonials — purple, inverted hover vs other nav links */
.ot-navbar .nav-link.ot-nav-testimonials {
  color: #ffffff !important;
  background-color: #7c3aed !important;
}

.ot-navbar .nav-link.ot-nav-testimonials:hover {
  color: #7c3aed !important;
  background-color: #ffffff !important;
}

.ot-navbar .nav-link.ot-nav-testimonials.active {
  color: #ffffff !important;
  background-color: #5b21b6 !important;
}

.ot-navbar .nav-link.ot-nav-testimonials.active:hover {
  color: #5b21b6 !important;
  background-color: #ffffff !important;
}

.ot-navbar .dropdown-menu {
  border-top: 4px solid var(--ot-primary);
  border-radius: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.ot-navbar .dropdown-item {
  color: var(--ot-primary);
  font-weight: 600;
}

.ot-navbar .dropdown-item:hover {
  background-color: var(--ot-primary);
  color: #ffffff;
  font-weight: 700;
}

.ot-navbar .navbar-toggler {
  border-color: var(--ot-primary);
}

.ot-navbar .navbar-toggler-icon {
  filter: none;
}

/* Expanded nav: one flex row that wraps cleanly on narrow desktop widths */
@media (min-width: 992px) {
  .ot-navbar > .container-fluid {
    align-items: flex-start;
  }

  .ot-navbar .navbar-collapse {
    flex: 1 1 0;
    min-width: 0;
    align-items: flex-start;
  }

  .ot-navbar .ot-navbar-nav {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .ot-navbar .ot-navbar-nav > .nav-item {
    display: flex;
    align-items: stretch;
  }

  .ot-navbar .ot-navbar-nav > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    white-space: nowrap;
  }
}

/* Pin Help / notifications / account to the right only when there is room */
@media (min-width: 1600px) {
  .ot-navbar .ot-navbar-utility {
    margin-left: auto;
  }
}

/* Slightly tighter nav on medium desktop to reduce wrapping */
@media (min-width: 992px) and (max-width: 1399.98px) {
  .ot-navbar .nav-link {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
    font-size: .75rem;
  }
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.ot-footer {
  background-color: #ffffff;
  color: #1a1a1a;
  border-top: 1px solid #dee2e6;
}

/* ── Buttons ── BF style: uppercase, bold, reversed hover, square corners ─── */
.btn {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .05em;
  border-radius: 0;
  font-size: .85rem;
}

.btn-primary {
  background-color: #6b7280 !important;
  border-color: #6b7280 !important;
  color: #fff !important;
  border-width: 2px;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
  background-color: #4b5563 !important;
  border-color: #4b5563 !important;
  color: #fff !important;
}

.btn-secondary {
  background-color: var(--ot-secondary);
  border: 2px solid var(--ot-secondary);
  color: #fff;
}

.btn-secondary:hover {
  background-color: #fff;
  border-color: var(--ot-secondary);
  color: var(--ot-secondary);
}

.btn-accent {
  background-color: var(--ot-accent);
  border: 2px solid var(--ot-accent);
  color: #fff;
}

.btn-accent:hover {
  background-color: #fff;
  border-color: var(--ot-accent);
  color: var(--ot-accent);
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.card-header {
  background-color: #6b7280;
  color: #fff;
  border-radius: 0 !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .82rem;
}

/* ── Stat cards (dashboard) ─────────────────────────────────────────────── */
.stat-card {
  border-left: 5px solid var(--ot-primary);
  background: #fff;
  border-radius: 0;
  padding: 1.4rem 1.6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  transition: transform .15s ease, box-shadow .15s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #6b7280;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #666;
  font-weight: 700;
  margin-top: .4rem;
}

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header {
  border-bottom: 3px solid var(--ot-primary);
  padding-bottom: .5rem;
  margin-bottom: 1.5rem;
  color: #6b7280;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Badge overrides ────────────────────────────────────────────────────── */
.badge-active   { background-color: #009739; }
.badge-inactive { background-color: #6c757d; }
.badge-pending  { background-color: #f1b434; color: #000; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table thead th {
  background-color: #6b7280;
  color: #fff;
  border: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .8rem;
}

/* ── Form focus states ─────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 .2rem rgba(107, 114, 128, .25);
}

/* ── Colour swatches (branding page) ───────────────────────────────────── */
.colour-swatch {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.2);
  vertical-align: middle;
}

/* ── Bootstrap utility overrides → grey ────────────────────────────────── */
.bg-primary       { background-color: #6b7280 !important; }
.text-primary     { color: #6b7280 !important; }
.btn-outline-primary {
  --bs-btn-color:              #6b7280;
  --bs-btn-border-color:       #6b7280;
  --bs-btn-hover-color:        #fff;
  --bs-btn-hover-bg:           #6b7280;
  --bs-btn-hover-border-color: #6b7280;
  --bs-btn-active-color:       #fff;
  --bs-btn-active-bg:          #4b5563;
  --bs-btn-active-border-color:#4b5563;
  --bs-btn-focus-shadow-rgb:   107, 114, 128;
}

/* ── Staff schedule calendar ─────────────────────────────────────────── */
.schedule-toolbar .btn-group .btn.active {
  background-color: var(--ot-primary, #1e3a6e);
  border-color: var(--ot-primary, #1e3a6e);
  color: #fff;
}

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

.schedule-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.schedule-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.schedule-event {
  font-size: 0.75rem;
  line-height: 1.3;
  padding: 0.2rem 0.35rem;
  margin-bottom: 0.2rem;
  border-radius: 2px;
  border-left: 3px solid transparent;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.schedule-event-shift {
  border-left-color: #1565c0;
  background: #e8f0fe;
}

.schedule-event-timeoff-approved {
  border-left-color: #2e7d32;
  background: #e8f5e9;
}

.schedule-event-timeoff-pending {
  border-left-color: #f1b434;
  background: #fff8e1;
}

.schedule-event-timeoff-denied {
  border-left-color: #b71c2c;
  background: #ffebee;
  opacity: 0.85;
}

.schedule-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #dee2e6;
  background: #fff;
}

.schedule-week-head,
.schedule-week-cell {
  border-right: 1px solid #dee2e6;
  border-bottom: 1px solid #dee2e6;
  min-height: 120px;
  padding: 0.5rem;
}

.schedule-week-head:last-child,
.schedule-week-cell:last-child {
  border-right: none;
}

.schedule-week-head {
  background: #f8f9fa;
  font-weight: 700;
  text-align: center;
  min-height: auto;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.schedule-day-num {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.schedule-day-num.is-today {
  color: var(--ot-primary, #1e3a6e);
}

.schedule-day-num.is-today span {
  background: var(--ot-primary, #1e3a6e);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
}

.schedule-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid #dee2e6;
  background: #fff;
}

.schedule-month-head {
  background: #f8f9fa;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 1px solid #dee2e6;
  border-right: 1px solid #dee2e6;
}

.schedule-month-head:nth-child(7n) {
  border-right: none;
}

.schedule-month-cell {
  min-height: 110px;
  padding: 0.35rem;
  border-right: 1px solid #dee2e6;
  border-bottom: 1px solid #dee2e6;
  vertical-align: top;
}

.schedule-month-cell:nth-child(7n) {
  border-right: none;
}

.schedule-month-cell.is-outside {
  background: #f8f9fa;
  color: #adb5bd;
}

.schedule-month-cell.is-today {
  background: #f0f4ff;
}

.schedule-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.schedule-year-card {
  border: 1px solid #dee2e6;
  background: #fff;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.schedule-year-card:hover {
  border-color: var(--ot-primary, #1e3a6e);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: inherit;
}

.schedule-year-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.schedule-pending-panel .list-group-item {
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .schedule-week-grid,
  .schedule-month-grid {
    font-size: 0.85rem;
  }

  .schedule-week-cell,
  .schedule-month-cell {
    min-height: 80px;
    padding: 0.25rem;
  }

  .schedule-event {
    font-size: 0.65rem;
  }
}
