/* =========================
   Event List (Metro)
   ========================= */

.events-container {
  max-width: 800px;
  margin: var(--space-4) auto;
}

/* Event tile */
.event-card {
  composes: surface;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: var(--space-2) 0px;
}

/* Title & metadata */
.event-title {
  font-size: 18px;
  font-weight: 600;
}

.event-date {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Metro-style tag */
.event-tag {
  display: inline-block;
  background-color: var(--metro-blue-light);
  color: var(--metro-blue);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* Actions */
.event-actions {
  display: flex;
  gap: var(--space-1);
}

/* advanced availability */
.availability-panel {
    display: flex;
    width: 100%;
    gap: var(--space-1);
    flex-direction: column;
}

.availability-range {
    display: flex;
    flex-direction: row;
    height: 36px;
    align-items: baseline;
}

input.time-input {
    height: 32px;
    border: black 1px solid;
    margin: 0px !important;
    padding: 0px !important;
    text-align: center;
}

.availability-range.availability-range-actions {
    gap: var(--space-1);
}/* =========================
   Metro Theme (Shared)
   ========================= */

:root {
  /* Metro colors */
  --metro-blue: #0078d7;
  --metro-blue-light: #c7dceb;
  --metro-green: #107c10;
  --metro-orange: #e0ab17;
  --metro-red: #d13438;
  --metro-dark-red: #a12023;

  /* Neutral */
  --bg-page: #f2f2f2;
  --bg-surface: #ffffff;
  --bg-surface-old: #d3d3d3;
  --border-color: #e0e0e0;
  --text-primary: #1f1f1f;
  --text-secondary: #5f5f5f;

  /* Spacing (8px grid) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;

  /* Typography */
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Base reset */
body {
  margin: 0;
  font-family: var(--font-ui);
  background-color: var(--bg-page);
  color: var(--text-primary);
}

/* Headings */
h1, h2, h3 {
  font-weight: 600;
  margin: 0 0 var(--space-2);
}

/* Surfaces (Metro tiles/cards) */
.surface {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: var(--space-2);
}

.surface-old {
  background-color: var(--bg-surface-old);
}

/* Buttons (flat, rectangular) */
.btn {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-165 {
    width: 165px;
}

.btn-icon {
    width: 36px;
    font-size: 1.5rem;
}

.btn-icon-dummy {
    width: 36px;
}

.btn-short {
    width: 50px;
}

.btn-primary {
  background-color: var(--metro-blue);
  color: white;
}

.btn-primary:hover {
  background-color: #106ebe;
}

.btn-secondary {
  background-color: white;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--metro-red);
  color: white;
}

.btn-warning {
  background-color: var(--metro-orange);
  color: white;
}

.btn-success {
  background-color: var(--metro-green);
  color: white;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Utilities */
.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mr-1 { margin-right: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }

.icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: text-bottom;
  color: inherit;
  filter: invert(100%);
}

.icon-header {
  display: inline-block;
  vertical-align: text-bottom;
  color: inherit;
}

.flex-align-right {
  margin-left: auto;
}/* =========================
   Team Management (Metro)
   ========================= */

.tm-container {
  max-width: 600px;
  margin: var(--space-3) auto var(--space-4);
}

/* Header */
.tm-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.tm-title {
  font-size: 20px;
  font-weight: 600;
}

/* Badge (Metro pill but squared) */
.tm-badge {
  background-color: var(--bg-page);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
}

.tm-list-checkbox-overlay {
    margin-top: -24px;
    position: absolute;
    width: 25px;
    z-index: 1;
    margin-left: 14px;
    border-width: 1px;
    font-size: 10pt;
    text-align: center;
    color: var(--text-secondary);
}

.tm-overlay-col2 {
  margin-left: 49px;
  width: 30px;
  letter-spacing: -22px;
  text-align: center;
}

/* Team list */
.tm-list {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Team tile */
.tm-card {
  composes: surface;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.tm-card.active {
  border-color: var(--metro-blue);
  background-color: var(--metro-blue-light);
}

/* Info */
.tm-name {
  font-size: 15px;
  font-weight: 600;
}

.tm-email,
.tm-username {
  font-size: 13px;
  color: var(--text-secondary);
}

.tm-availability {
    font-style: italic;
    font-size: 12px;
    margin-top: 5px;
}

.tm-availability-entry {
    font-size: 13px;
}

.tm-checkbox {
  z-index: 10;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  text-align: center;
}

.tm-radio-dummy {
  width: 20px;
}

.tm-radio-off {
  color: darkgray
}

.tm-radio-on {
  color: var(--metro-blue);
}

.tm-radio {
  z-index: 10;
  width: 20px;
  height: 20px;
  text-align: center;
  border-radius: 100%;
  font-size: 20pt;
  line-height: 1.3;
  border-color: var(--metro-blue);
  font-weight: 700;
  margin-top: 10px;
  align-self: start;
}

.tm-card.active .tm-checkbox {
  line-height: 1.2;
  background-color: var(--metro-blue);
  border-color: var(--metro-blue);
  color: white;
  font-weight: bold;}

/* Footer bar */
.tm-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: var(--space-2);
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  z-index: 10;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 20px;
  right: 40%;
  left: 40%;
  text-align: center;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-weight: 600;
  z-index: 1000;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-success {
  background: var(--metro-green);
}

.toast-error {
  background: var(--metro-red);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.spinner {
    text-align: center;
    margin: 0;
    font-family: 'Consolas', monospace;
    font-size: 2rem;
    display: inline-block;
    animation: spin 750ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.event-edit {
  margin: 5px 3px 5px 3px;
  display: flex;
  height: 24px
}

.event-edit-text {
  align-self: end;
  margin-left: auto;
  width: max-content;
  flex-grow: 1;
  border-width: thin;
  border-radius: 0%;
  border-color: black;
  height: 100%;
}

.event-edit-datepicker {
  align-self: end;
  margin: 0 0 6px 0;
  width: max-content;
  flex-grow: 1;
  border-width: thin;
  border-radius: 0%;
  border-color: black;
  height: 34px;
}

.event-edit-label {
  width: 80px
}.topbar-header{
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #ddd;
    gap: var(--space-1);
    text-align: center;
    position: sticky;
    top: 0;
    background: var(--bg-page);
    z-index: 20;
}

.header-logo {
    height:100%
}.metro-viewport {
  overflow-x: auto;
  margin: 0px 20px;
  height: calc(100vh - 105px);
  width: calc(100% - 40px);
}


.metro-header {
  align-items: center;
  display: flex;
  padding: 5px 20px;
}

.metro-header > h2 {
  margin: 0px;
}

/* Timeline layout */
.metro-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(200px + 52px * var(--timeline-slot-count, 0));
  min-width: 100%;
}

.metro-timeline-header {
  display: flex;
  align-items: flex-end;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.metro-row-label-spacer {
  width: 200px;
  flex-shrink: 0;
}

.metro-timeline-days {
  display: flex;
  /* gap: 2px; */
}

.metro-timeline-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
}

.metro-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.metro-row-label {
  width: 200px;
  flex-shrink: 0;
  background: #0078d7;
  color: white;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  left: 0;
  z-index: 2;
}

.tile-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.tile-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.metro-row-label-spacer-inner {
  width: 200px;
  flex-shrink: 0;
}

.metro-day-cell {
  width: 52px;
  height: 40px;
  background: rgba(255,255,255,0.06);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.metro-day-cell:hover {
  opacity: 70%;
}

.metro-day-header {
  height: 32px;
  background: transparent;
  border-radius: 0;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

/* Availability state colours on the event row label */
.metro-row-none .metro-row-label {
  background: var(--metro-blue); /* default blue */
}

.metro-row-full .metro-row-label {
  background: var(--metro-green); /* Success Green for full availability */
}

.metro-row-partial .metro-row-label {
  background: var(--metro-orange); /* Orange for partial availability */
}

/* Bars on active days */
.metro-day-active {
  background: rgba(0,0,0,0.3);
}

.metro-day-active-full {
  background: var(--metro-green);
  border: solid 2px var(--metro-green);
}

.metro-day-active-partial {
  background: var(--metro-orange);
}

.metro-day-active-none {
  background: var(--metro-blue);
  border: 2px solid var(--metro-blue);
}

/* In partial availability, unselected slots are red (not available for that slot) */
.metro-row-partial .metro-day-active-none {
  background: rgba(220, 53, 69, 0.35);
  border-color: var(--metro-red);
}

/* Inline availability editor below each row */
.metro-availability-panel {
  margin-top: 4px;
  margin-left: 0;
  padding: 6px 8px 8px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metro-availability-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.metro-time-input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 2px;
  font-size: 0.75rem;
  padding: 2px 4px;
}

.metro-time-separator {
  font-size: 0.75rem;
  opacity: 0.9;
}

.metro-availability-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}