/* ============================================================
   The ABC Team Training NW Portal
   Outlook-inspired calendar + modern admin UI
   ============================================================ */
:root {
  --primary: #b01c34;
  --primary-dark: #7a1428;
  --accent: #e8364f;
  --bg: #f3f2f1;
  --bg-dark: #201f1e;
  --sidebar: #1b1a19;
  --card: #ffffff;
  --border: #c8c6c4;
  --text: #323130;
  --text-muted: #605e5c;
  --text-light: #a19f9d;
  --success: #107C10;
  --danger: #E81123;
  --warning: #FFB900;
  --radius: 6px;
  --shadow: 0 1.6px 3.6px rgba(0,0,0,.13), 0 0.3px 0.9px rgba(0,0,0,.1);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --cal-hour-h: 48px;
  --cal-header-h: 52px;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.sidebar-brand img { height: 36px; width: auto; border-radius: 4px; }
.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}
.sidebar-nav a i { width: 20px; text-align: center; opacity: .85; }
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 1.25rem; font-weight: 600; }
.content { padding: 1.25rem 1.5rem; flex: 1; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-header {
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 1.15rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .85rem; }
.form-control {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  background: #fff;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,85,165,.2);
}
select.form-control { appearance: auto; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-muted); background: #faf9f8; }
.table tr:hover td { background: #faf9f8; }
.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-success { background: #dff6dd; color: #0b6a0b; }
.badge-warning { background: #fff4ce; color: #835c00; }
.badge-danger { background: #fde7e9; color: #a80000; }
.badge-info { background: #deecf9; color: #004578; }
.badge-secondary { background: #f3f2f1; color: #605e5c; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: .8rem; color: var(--text-muted); margin-bottom: .25rem; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; color: var(--text); }

/* ========== OUTLOOK-STYLE CALENDAR ========== */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  background: var(--card);
  padding: .65rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.cal-toolbar .nav-btns { display: flex; gap: .35rem; }
.cal-toolbar .nav-btns button {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .35rem .65rem;
  cursor: pointer;
  font-family: inherit;
}
.cal-toolbar .nav-btns button:hover { background: var(--bg); }
.cal-toolbar .title {
  font-weight: 600;
  font-size: 1.05rem;
  min-width: 200px;
}
.cal-toolbar .view-switch {
  margin-left: auto;
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-toolbar .view-switch button {
  background: #fff;
  border: none;
  border-right: 1px solid var(--border);
  padding: .4rem .85rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .85rem;
}
.cal-toolbar .view-switch button:last-child { border-right: none; }
.cal-toolbar .view-switch button.active {
  background: var(--primary);
  color: #fff;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
  font-size: .8rem;
}
.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.cal-legend i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

/* Work Week grid - Outlook style */
.cal-workweek {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 56px repeat(5, minmax(0, 1fr));
  grid-template-rows: var(--cal-header-h) auto;
}
.cal-corner {
  grid-column: 1;
  grid-row: 1;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: #faf9f8;
}
.cal-day-header {
  grid-row: 1;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: #faf9f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
  padding: .35rem;
}
.cal-day-header.today {
  background: #deecf9;
  color: var(--primary);
}
.cal-day-header .dow { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.cal-day-header .dom { font-size: 1.15rem; }

.cal-times {
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid var(--border);
  background: #faf9f8;
}
.cal-time-slot {
  height: var(--cal-hour-h);
  border-bottom: 1px solid #c8c6c4;
  font-size: .7rem;
  color: var(--text-muted);
  text-align: right;
  padding: 2px 6px 0 0;
  position: relative;
}
.cal-time-slot::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px dashed #d2d0ce;
}

.cal-day-col {
  grid-row: 2;
  border-right: 1px solid #c8c6c4;
  position: relative;
  overflow: hidden;
  background: repeating-linear-gradient(
    to bottom,
    #fff 0,
    #fff calc(var(--cal-hour-h) / 2 - 1px),
    #e8e6e4 calc(var(--cal-hour-h) / 2 - 1px),
    #e8e6e4 calc(var(--cal-hour-h) / 2),
    #fff calc(var(--cal-hour-h) / 2),
    #fff calc(var(--cal-hour-h) - 1px),
    #c8c6c4 calc(var(--cal-hour-h) - 1px),
    #c8c6c4 var(--cal-hour-h)
  );
}
.cal-day-col:last-child { border-right: 1px solid #c8c6c4; }

.cal-event {
  position: absolute;
  left: 2px;
  /* width set by JS */
  right: auto;
  border-radius: 3px;
  padding: 2px 5px 3px;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  border: none;
  border-left: 3px solid rgba(0,0,0,.22);
  box-shadow: none;
  z-index: 2;
  line-height: 1.25;
  box-sizing: border-box;
  min-height: 22px;
  max-width: calc(100% - 4px);
}
.cal-event.cal-event-overlap {
  border-right: 1px solid rgba(255,255,255,.35);
}
/* never stretch with right: when width is set by JS */
.cal-day-col .cal-event {
  right: auto !important;
  opacity: 1 !important;
  background-clip: padding-box;
  /* width/left come from inline styles — do not force 100% */
  max-width: none !important;
}
.cal-day-col {
  min-width: 0;
  overflow: hidden;
}
.cal-event:hover {
  filter: brightness(1.08);
  z-index: 8;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.cal-event .ev-time {
  font-weight: 600;
  opacity: .95;
  font-size: .68rem;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event .ev-instructor {
  font-size: .68rem;
  font-weight: 700;
  opacity: .95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event .ev-title {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  font-weight: 600;
  font-size: .72rem;
  margin-top: 0;
  word-break: break-word;
}
.cal-event-detail-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cal-event-detail-backdrop.open { display: flex; }
.cal-event-detail {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
  overflow: hidden;
}
.cal-event-detail .hd {
  padding: 1rem 1.25rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}
.cal-event-detail .hd button {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}
.cal-event-detail .bd { padding: 1.15rem 1.25rem 1.35rem; }
.cal-event-detail .row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: .35rem .75rem;
  padding: .45rem 0;
  border-bottom: 1px solid #EEF2F6;
  font-size: .92rem;
}
.cal-event-detail .row .k { color: #667; }
.cal-event-detail .row .v { font-weight: 600; color: #111; word-break: break-word; }

/* Category colours (Outlook match) */
.cal-event.cat-training   { background: #0078D4; opacity: 1; }
.cal-event.cat-pad_hire   { background: #038387; opacity: 1; }
.cal-event.cat-3a         { background: #D83B01; }
.cal-event.cat-mod4       { background: #107C10; }
.cal-event.cat-assessment { background: #8764B8; }
.cal-event.cat-retest     { background: #E81123; }
.cal-event.cat-holiday    { background: #FFB900; color: #323130; }
.cal-event.cat-notes      { background: #69797E; }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0B1C2C 0%, #0055A5 100%);
  padding: 1.5rem;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-card h1 {
  font-size: 1.4rem;
  margin-bottom: .35rem;
  text-align: center;
}
.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  font-size: .9rem;
}
.login-card .logo {
  display: block;
  margin: 0 auto 1.25rem;
  height: 72px;
  width: auto;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .cal-workweek { font-size: .75rem; }
  :root { --cal-hour-h: 40px; }
}
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--text);
}
@media (max-width: 900px) {
  .mobile-toggle { display: block; }
}

/* Alert */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert-success { background: #dff6dd; color: #0b6a0b; border: 1px solid #9fd89f; }
.alert-error { background: #fde7e9; color: #a80000; border: 1px solid #f1aeb5; }
.alert-info { background: #deecf9; color: #004578; border: 1px solid #9dc3e6; }

.cal-day-col { cursor: crosshair; }

/* Interactive calendar */

.cal-hint {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: #deecf9;
  border: 1px solid #9dc3e6;
  border-radius: 6px;
  color: #004578;
  font-size: 0.875rem;
}

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal-panel {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal-panel .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.modal-panel .modal-body { padding: 1.25rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.cal-event .ev-instructor {
  font-weight: 700;
  font-size: .78rem;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event .ev-warn {
  display: inline-block;
  color: #FFB900;
  background: rgba(0,0,0,.25);
  border-radius: 3px;
  padding: 0 3px;
  margin-right: 3px;
  font-size: .85rem;
  line-height: 1.1;
}
.cal-event.unallocated {
  /* only 3A / training without examiner — not pad hire / holidays */
  box-shadow: 0 0 0 2px #FFB900, 0 1px 3px rgba(0,0,0,.18);
}

.cal-event .ev-pending-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #E81123;
  border-radius: 3px;
  width: 1.1rem;
  height: 1.1rem;
  font-size: .75rem;
  font-weight: 800;
  margin-right: 4px;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.cal-event.pending-booking {
  box-shadow: 0 0 0 2px #E81123, 0 1px 3px rgba(0,0,0,.18);
}
.cal-event.pending-booking.unallocated {
  box-shadow: 0 0 0 2px #E81123, 0 0 0 4px #FFB900, 0 1px 3px rgba(0,0,0,.18);
}
.pending-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  background: #E81123;
  color: #fff;
  border-radius: 4px;
  font-weight: 800;
  font-size: .85rem;
  margin-right: .35rem;
  vertical-align: middle;
}
.stat-card.stat-pending {
  border-left: 4px solid #E81123;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.stat-card.stat-pending:hover { background: #FFF5F5; }
.stat-card.stat-pending .value { color: #E81123; }

/* Ghost: full-width on empty slots; gutter-only beside existing events */
.cal-ghost {
  display: none;
  position: absolute;
  top: 0;
  left: 3px;
  right: 3px;
  pointer-events: none;
  z-index: 3;
  box-sizing: border-box;
  font-size: 0;
  padding: 0;
}
.cal-ghost.cal-ghost-full {
  background: rgba(0, 120, 212, 0.18);
  border: 1px dashed #0078D4;
  border-radius: 4px;
}
.cal-ghost.cal-ghost-gutter {
  left: auto;
  right: 0;
  width: 14px;
  background: rgba(0, 85, 165, 0.35);
  border: none;
  border-left: 2px solid #0055A5;
  border-radius: 0;
}
.cal-ghost::after {
  content: attr(data-time);
  position: absolute;
  top: 1px;
  font-size: .7rem;
  font-weight: 700;
  color: #0055A5;
  background: rgba(255,255,255,.95);
  border: 1px solid #0055A5;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 6;
}
.cal-ghost.cal-ghost-full::after {
  left: 6px;
  right: auto;
}
.cal-ghost.cal-ghost-gutter::after {
  right: 16px;
  left: auto;
}
.cal-event {
  z-index: 5;
}

/* Clear separation between consecutive events (same colour no longer looks like one block) */
.cal-day-col .cal-event {
  border: 1px solid rgba(255,255,255,.55) !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  padding: 2px 5px 3px !important;
  background-image: none;
}
.cal-day-col .cal-event .ev-time {
  font-size: .65rem;
  font-weight: 700;
  opacity: 1;
  white-space: nowrap;
}
.cal-day-col .cal-event .ev-instructor {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
}
.cal-day-col .cal-event .ev-title {
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.cal-day-col .cal-event.cal-event-short .ev-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .65rem;
  line-height: 1.2;
}
.cal-day-col .cal-event.cal-event-short .ev-title {
  -webkit-line-clamp: 2;
  font-size: .68rem;
}
.cal-day-col .cal-event.cat-holiday {
  border-color: rgba(0,0,0,.2) !important;
  color: #323130;
}

.cal-day-col .cal-event .ev-line {
  display: block;
  line-height: 1.25;
  font-size: .7rem;
  overflow: hidden;
  word-break: break-word;
}
.cal-day-col .cal-event .ev-line .ev-time {
  font-weight: 800;
  margin-right: 3px;
  white-space: nowrap;
}
.cal-day-col .cal-event .ev-line .ev-title {
  font-weight: 600;
  display: inline;
  -webkit-line-clamp: unset;
  white-space: normal;
}

/* Stronger modal / form lines */
.modal-panel {
  border: 1px solid #a19f9d;
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
}
.modal-panel .modal-header {
  border-bottom: 1px solid #a19f9d;
  background: #f3f2f1;
}
.modal-panel .form-control,
.modal-backdrop .form-control {
  border: 1px solid #8a8886 !important;
  background: #fff;
}
.modal-panel .form-control:focus,
.modal-backdrop .form-control:focus {
  border-color: #0055A5 !important;
  box-shadow: 0 0 0 2px rgba(0,85,165,.2);
}
.modal-panel label { color: #323130; font-weight: 600; }
.form-control {
  border-color: #a19f9d;
}
.card {
  border-color: #c8c6c4;
}

/* Month view */
.cal-workweek.cal-month-mode {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.cal-month-dow {
  padding: .5rem .4rem;
  font-size: .75rem;
  font-weight: 600;
  text-align: center;
  background: #f3f2f1;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.cal-month-cell {
  min-height: 96px;
  padding: .35rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  background: #fff;
}
.cal-month-cell.other-month { background: #faf9f8; color: #a19f9d; }
.cal-month-cell.is-today { background: #e8f4fc; }
.cal-month-daynum { font-size: .8rem; font-weight: 600; margin-bottom: .25rem; }
.cal-month-events { display: flex; flex-direction: column; gap: 2px; }
.cal-month-ev {
  font-size: .68rem;
  line-height: 1.2;
  padding: 2px 4px;
  border-radius: 3px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-month-ev.cat-training { background: #0078D4; }
.cal-month-ev.cat-pad_hire { background: #038387; }
.cal-month-ev.cat-3a { background: #D83B01; }
.cal-month-ev.cat-mod4 { background: #107C10; }
.cal-month-ev.cat-assessment { background: #8764B8; }
.cal-month-ev.cat-retest { background: #E81123; }
.cal-month-ev.cat-holiday { background: #FFB900; color: #323130; }
.cal-month-ev.cat-notes { background: #69797E; }

/* Outlook-style drag selection */
.cal-drag-sel {
  display: none;
  position: absolute;
  left: 2px;
  right: 2px;
  background: rgba(0, 120, 212, 0.28);
  border: 1px solid #0078D4;
  border-radius: 3px;
  pointer-events: none;
  z-index: 4;
  box-sizing: border-box;
}
.cal-drag-sel::after {
  content: attr(data-range);
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: .7rem;
  font-weight: 700;
  color: #0055A5;
  background: rgba(255,255,255,.92);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.cal-ctx-menu {
  position: fixed;
  z-index: 10000;
  min-width: 210px;
  background: #fff;
  border: 1px solid #c8c6c4;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: .35rem 0;
  font-size: .9rem;
}
.cal-ctx-menu button {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: .55rem .9rem;
  cursor: pointer;
  color: #323130;
  font: inherit;
}
.cal-ctx-menu button:hover {
  background: #f3f2f1;
}
.cal-ctx-menu button i {
  width: 1.1rem;
  color: #0055A5;
  text-align: center;
}

/* Users table — keep Actions column compact */
td.users-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}
td.users-actions .btn {
  margin-left: .25rem;
}
td.users-actions form {
  display: inline;
  margin: 0;
}
table.table {
  table-layout: auto;
  width: 100%;
}

/* A-Team logo for auth pages */
.a-team-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1;
}
.a-team-logo-mark {
  display: flex;
  align-items: center;
  position: relative;
  padding: 6px 0;
}
.a-team-logo-mark::before,
.a-team-logo-mark::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: #111;
}
.a-team-logo-mark::before { top: 0; }
.a-team-logo-mark::after { bottom: 0; }
.a-team-the {
  font-family: 'Oswald', Impact, sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #111;
  margin-right: 3px;
}
.a-team-a {
  font-family: 'Oswald', Impact, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #b01c34;
  line-height: 0.85;
}
.a-team-team {
  font-family: 'Oswald', Impact, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #b01c34;
  line-height: 0.9;
}
.a-team-sub {
  font-family: 'Oswald', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: #b01c34;
  text-transform: uppercase;
}

/* Sidebar A-Team logo on dark background */
.sidebar-brand .a-team-logo {
  align-items: flex-start;
}
.sidebar-brand .a-team-the {
  color: #fff !important;
  background: transparent !important;
}
.sidebar-brand .a-team-logo-mark::before,
.sidebar-brand .a-team-logo-mark::after {
  background: #fff !important;
}
.sidebar-brand .a-team-a,
.sidebar-brand .a-team-team,
.sidebar-brand .a-team-sub {
  color: #b01c34 !important;
}
.sidebar-brand {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
