:root {
  --app-sidebar-width: 17rem;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
}

.app-sidebar {
  --bs-offcanvas-width: var(--app-sidebar-width);
}

.app-sidebar .offcanvas-body {
  min-height: 100%;
}

.app-brand,
.app-mobile-brand {
  letter-spacing: -0.01em;
}

.app-mobile-brand,
.app-drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-logo-mark {
  width: 41px;
  height: 60px;
  flex: 0 0 auto;
  background-image: url("fmr-logo.png");
  background-position: -7px -10px;
  background-repeat: no-repeat;
  background-size: 281px 80px;
}

.app-logo-mark-sm {
  width: 28px;
  height: 40px;
  background-position: -5px -7px;
  background-size: 187px 53px;
}

.app-nav-section {
  margin-bottom: 1.25rem;
}

.app-nav-heading {
  margin: 0 0 0.35rem 0.75rem;
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.app-nav .nav-link,
.app-support .nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--bs-border-radius);
  color: var(--bs-body-color);
  font-weight: 500;
}

.app-nav .nav-link i,
.app-support .nav-link i {
  width: 1.15rem;
  flex: 0 0 1.15rem;
  text-align: center;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus-visible,
.app-support .nav-link:hover,
.app-support .nav-link:focus-visible {
  background: var(--bs-tertiary-bg);
  color: var(--bs-primary);
}

.app-nav .nav-link.active {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}

.form-label {
  font-weight: 600;
}

.traffic-item {
  background: #e2d9f3;
  color: #402070;
}

.legacy-editor {
  display: none;
}

.daily-timeline {
  gap: 0.45rem;
  padding: 0.45rem;
  background: #f8f9fa;
}

.daily-timeline .list-group-item {
  border-radius: 0.25rem !important;
}

.asset-bucket {
  min-height: 13rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border: 2px dashed #adb5bd;
  border-radius: 0.5rem;
}

.asset-bucket.drag-over {
  background: #e9f2ff;
  border-color: #0d6efd;
}

.asset-card {
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.45rem;
  cursor: grab;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.35rem;
}

.asset-card:last-child {
  margin-bottom: 0;
}

.asset-card small {
  display: block;
  color: #6c757d;
}

.asset-card button {
  float: right;
}

/* These colours mirror the printed FMR spot-log conventions. */
.running-order-table {
  width: 100%;
}

/* A grid keeps the four table columns aligned while allowing only linked rows to touch. */
.running-order-table thead,
.running-order-table tbody {
  display: block;
  width: 100%;
}

.running-order-table thead tr,
.running-order-table tbody tr {
  display: grid;
  grid-template-columns: 6.5rem minmax(18rem, 1fr) 11rem 11rem;
}

.running-order-table tbody {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.running-order-table tbody tr.linked-following {
  margin-top: -0.45rem;
}

.running-order-table td,
.running-order-table th {
  vertical-align: middle;
  border: 0;
}

.running-order-table .time {
  width: 6.5rem;
  font-weight: 700;
}

/* Template rows stay readable while their coloured borders match the draft workspace. */
.item-programme,
.item-studio {
  --item-colour: #8a8a8a;
}

.item-ad_break {
  --item-colour: #d9a000;
}

.item-news {
  --item-colour: #76a800;
}

.item-traffic {
  --item-colour: #6f42c1;
}

.item-feature {
  --item-colour: #d60a0a;
}

.running-order-table tr[class^="item-"] td {
  background: #fff;
  border-top: 2px solid var(--item-colour);
  border-bottom: 2px solid var(--item-colour);
}

.running-order-table tr[class^="item-"] td:first-child {
  border-left: 6px solid var(--item-colour);
}

.running-order-table tr[class^="item-"] td:last-child {
  border-right: 2px solid var(--item-colour);
}

.legend-swatch.item-programme,
.legend-swatch.item-studio {
  background: #8a8a8a;
}

.legend-swatch.item-ad_break {
  background: #d9a000;
}

.legend-swatch.item-news {
  background: #76a800;
}

.legend-swatch.item-traffic {
  background: #6f42c1;
}

.legend-swatch.item-feature {
  background: #d60a0a;
}

.draggable-row {
  cursor: grab;
}

.draggable-row.drag-over {
  outline: 3px dashed #212529;
  outline-offset: 2px;
}

.legend-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.25rem;
  vertical-align: -0.1rem;
  border-radius: 0.15rem;
}

.schedule-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.schedule-section-heading {
  border-left: 0.35rem solid var(--schedule-kind-colour);
  padding-left: 0.5rem;
}

.schedule-placement td:first-child {
  border-left: 0.35rem solid var(--schedule-kind-colour);
}

.schedule-kind-promo,
.schedule-placement--promo {
  --schedule-kind-colour: #0d6efd;
}

.schedule-kind-generic,
.schedule-placement--generic {
  --schedule-kind-colour: #198754;
}

.schedule-kind-live_read,
.schedule-placement--live_read {
  --schedule-kind-colour: #fd7e14;
}

.schedule-kind-opening_billboard,
.schedule-placement--opening_billboard {
  --schedule-kind-colour: #6f42c1;
}

.schedule-kind-closing_billboard,
.schedule-placement--closing_billboard {
  --schedule-kind-colour: #8c564b;
}

.schedule-kind-sponsorship,
.schedule-placement--sponsorship {
  --schedule-kind-colour: #d63384;
}

@media (min-width: 992px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    width: var(--app-sidebar-width);
    height: 100vh;
    flex: 0 0 var(--app-sidebar-width);
    border-right: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
  }

  .app-sidebar .offcanvas-body {
    overflow-y: auto;
  }
}

@media print {
  .app-sidebar,
  .app-mobile-header {
    display: none !important;
  }

  .app-main {
    width: 100%;
  }
}

.login-panel {
  max-width: 28rem;
  margin: 4rem auto;
  padding: 1.5rem;
  font-family: system-ui, sans-serif;
}
