.asgt-calendar {
  --asgt-primary: #1769aa;
  --asgt-border: #aebdce;
  --asgt-border-soft: #c8d3df;
  --asgt-text: #05070d;
  --asgt-muted: #111827;
  --asgt-bg: #f2f5f8;
  color: var(--asgt-text);
  font-weight: 500;
}
.asgt-calendar * { box-sizing: border-box; }
.asgt-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.asgt-calendar-header-no-title { justify-content: flex-end; }
.asgt-calendar h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.asgt-calendar button,
.asgt-calendar .asgt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .55rem .8rem;
  border: 1px solid var(--asgt-border);
  border-radius: 6px;
  background: #fff;
  color: var(--asgt-text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}
.asgt-calendar button:hover,
.asgt-calendar .asgt-button:hover,
.asgt-calendar button:focus,
.asgt-calendar .asgt-button:focus {
  border-color: var(--asgt-primary);
  outline: 2px solid color-mix(in srgb, var(--asgt-primary) 35%, transparent);
  outline-offset: 2px;
}
.asgt-view-toggle,
.asgt-export-actions,
.asgt-row-actions,
.asgt-filter-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}
.asgt-view-toggle .is-active {
  border-color: var(--asgt-primary);
  background: var(--asgt-primary);
  color: #fff;
}
.asgt-view-month .asgt-filter-page-size { display: none; }
.asgt-filters-accordion {
  margin: 0 0 1rem;
  color: var(--asgt-text);
}
.asgt-filters-accordion > summary {
  padding: .85rem 1rem;
  border: 1px solid var(--asgt-border);
  border-radius: 8px;
  background: #e9eff5;
  color: #05070d;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.35;
}
.asgt-filters-accordion > summary::marker {
  color: var(--asgt-primary);
}
.asgt-filters-accordion > summary:hover,
.asgt-filters-accordion > summary:focus {
  border-color: var(--asgt-primary);
  background: #dde8f2;
  outline: 2px solid color-mix(in srgb, var(--asgt-primary) 35%, transparent);
  outline-offset: 2px;
}
.asgt-filters-accordion[open] > summary {
  border-radius: 8px 8px 0 0;
}
.asgt-filters-accordion[open] > .asgt-filters {
  border-top: 0;
  border-radius: 0 0 8px 8px;
}
.asgt-filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
  background: var(--asgt-bg);
  border: 1px solid var(--asgt-border);
  border-radius: 8px;
  margin-bottom: 0;
}
.asgt-filters label,
.asgt-filters fieldset {
  display: grid;
  gap: .35rem;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
  color: var(--asgt-text);
  font-weight: 800;
}
.asgt-filter-search { grid-column: span 3; }
.asgt-filter-period,
.asgt-filter-date,
.asgt-filter-month { grid-column: span 2; }
.asgt-filter-disciplines { grid-column: span 6; }
.asgt-filter-categories { grid-column: span 6; }
.asgt-filter-location { grid-column: span 4; }
.asgt-filter-status,
.asgt-filter-sort,
.asgt-filter-page-size { grid-column: span 2; }
.asgt-filters .asgt-filter-actions { grid-column: span 4; }
.asgt-filters fieldset {
  align-content: start;
  padding: .75rem;
  border: 1px solid var(--asgt-border-soft);
  border-radius: 8px;
  background: #fff;
}
.asgt-filter-disciplines,
.asgt-filter-categories {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: .65rem;
}
.asgt-filter-disciplines legend,
.asgt-filter-categories legend {
  grid-column: 1 / -1;
}
.asgt-filters fieldset legend {
  padding: 0 .25rem;
  margin-bottom: .55rem;
  color: var(--asgt-text);
  font-weight: 700;
}
.asgt-filters fieldset label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: fit-content;
  min-height: 28px;
  margin: 0 .5rem .35rem 0;
  padding: .22rem .5rem;
  border: 1px solid #98a9bb;
  border-radius: 999px;
  background: #f9fbfd;
  color: var(--asgt-text);
  font-weight: 700;
  line-height: 1.2;
}
.asgt-filters fieldset input[type="checkbox"],
.asgt-filters fieldset input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--asgt-primary);
}
.asgt-filters input:not([type="checkbox"]):not([type="radio"]),
.asgt-filters select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--asgt-border);
  border-radius: 6px;
  padding: .45rem .55rem;
  background: #fff;
  color: var(--asgt-text);
  font-weight: 700;
}
.asgt-filter-location {
  position: relative;
  padding: .75rem;
  border: 1px solid var(--asgt-border-soft);
  border-radius: 8px;
  background: #fff;
}
.asgt-filter-location input {
  padding-left: 2.15rem !important;
}
.asgt-filter-location::after {
  content: "";
  position: absolute;
  left: 1.35rem;
  bottom: 1.55rem;
  width: .75rem;
  height: .75rem;
  border: 2px solid #111827;
  border-radius: 50%;
  pointer-events: none;
}
.asgt-filter-location::before {
  content: "";
  position: absolute;
  left: 2.03rem;
  bottom: 1.38rem;
  width: .45rem;
  height: 2px;
  background: #111827;
  transform: rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}
.asgt-filters input::placeholder {
  color: #374151;
  opacity: 1;
}
.asgt-filters .asgt-filter-actions {
  align-self: end;
}
.asgt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}
.asgt-count {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: .35rem .65rem;
  border: 1px solid var(--asgt-border);
  border-radius: 6px;
  background: #fff;
  color: var(--asgt-text);
  font-weight: 700;
}
.asgt-table-wrap {
  overflow-x: auto;
  border: 1px solid #c9d4e2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.asgt-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  color: var(--asgt-text);
  font-size: .96rem;
}
.asgt-table th,
.asgt-table td {
  text-align: left;
  padding: .85rem .75rem;
  border-bottom: 1px solid var(--asgt-border);
  vertical-align: top;
}
.asgt-table th {
  background: #dfe8f1;
  color: #05070d;
  font-weight: 800;
  white-space: nowrap;
}
.asgt-table th[data-sort] { cursor: pointer; }
.asgt-table tbody tr:nth-child(even) { background: #fbfdff; }
.asgt-table tbody tr:hover { background: #f2f7fc; }
.asgt-title-cell strong {
  display: block;
  color: #05070d;
  font-weight: 800;
  line-height: 1.35;
}
.asgt-date-cell,
.asgt-time-cell,
.asgt-location-cell {
  color: #0b1220;
  font-weight: 650;
  line-height: 1.3;
}
.asgt-date-cell { min-width: 130px; }
.asgt-time-cell { min-width: 90px; }
.asgt-badge-cell { min-width: 160px; }
.asgt-status-cell {
  min-width: 120px;
  white-space: normal;
}
.asgt-table .asgt-row-actions {
  display: table-cell;
  min-width: 220px;
  white-space: nowrap;
}
.asgt-table .asgt-row-actions button,
.asgt-table .asgt-row-actions .asgt-button {
  min-height: 36px;
  padding: .45rem .65rem;
  margin-right: .35rem;
  white-space: nowrap;
}
.asgt-table .asgt-row-actions button:last-child,
.asgt-table .asgt-row-actions .asgt-button:last-child {
  margin-right: 0;
}
.asgt-cards { display: none; }
.asgt-card {
  background: #fff;
  border: 1px solid var(--asgt-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: .75rem;
  color: var(--asgt-text);
  font-weight: 600;
}
.asgt-card h3 {
  margin: 0 0 .6rem;
  color: #05070d;
  font-size: 1.05rem;
  font-weight: 800;
}
.asgt-card strong {
  color: #05070d;
  font-weight: 800;
}
.asgt-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: .12rem .42rem;
  margin: .1rem .15rem .1rem 0;
  border-radius: 999px;
  border: 1px solid #8fa1b5;
  background: #eef3f8;
  color: #05070d;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.1;
}
.asgt-badge-f300, .asgt-badge-p50, .asgt-badge-p25, .asgt-badge-p10 { background: #dff2e7; border-color: #5fa77b; }
.asgt-badge-c50, .asgt-badge-c10 { background: #e3eaff; border-color: #6d86d8; }
.asgt-badge-jt { background: #ffefb8; border-color: #c28a00; }
.asgt-badge-category { background: #efe5fb; border-color: #9b73bf; }
.asgt-badge-soon { background: #ffe8cc; border-color: #c7771f; }
.asgt-status-running { background: #d9f2e6; border-color: #3f9364; }
.asgt-status-past { background: #eef1f5; border-color: #7c8795; }
.asgt-status-upcoming { background: #ddeeff; border-color: #4f8cc9; }
.asgt-is-past { background: #f8fafc; }
.asgt-is-past .asgt-title-cell strong,
.asgt-is-past .asgt-date-cell,
.asgt-is-past .asgt-time-cell,
.asgt-is-past .asgt-location-cell {
  color: #111827;
}
.asgt-empty {
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--asgt-border);
  border-radius: 8px;
  background: #fff;
}
.asgt-pagination { display: flex; gap: .35rem; margin-top: 1rem; flex-wrap: wrap; }
.asgt-pagination .is-active { background: var(--asgt-primary); color: #fff; }
.asgt-months { display: grid; gap: 2rem; }
.asgt-month {
  min-width: 0;
  scroll-margin-top: 1rem;
}
.asgt-month h3 {
  margin: 0 0 .75rem;
  color: #05070d;
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: capitalize;
}
.asgt-month-weekdays,
.asgt-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.asgt-month-weekdays span {
  padding: .4rem;
  font-weight: 700;
  text-align: center;
}
.asgt-month-cell {
  min-height: 110px;
  border: 1px solid var(--asgt-border);
  padding: .35rem;
  background: #fff;
}
.asgt-month-empty { background: #f5f7fa; }
.asgt-month-cell button {
  display: block;
  width: 100%;
  min-height: 0;
  margin-top: .25rem;
  padding: .25rem;
  text-align: left;
  font-size: .82rem;
}
.asgt-modal[hidden] { display: none; }
.asgt-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(17, 24, 39, .55);
}
.asgt-modal-panel {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  color: var(--asgt-text);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.asgt-modal-close { float: right; min-width: 40px; font-size: 1.4rem; }
.asgt-modal dl {
  display: grid;
  grid-template-columns: minmax(100px, 160px) 1fr;
  gap: .5rem 1rem;
}
.asgt-modal dt {
  color: #05070d;
  font-weight: 800;
}
.asgt-modal dd {
  margin: 0;
  color: #05070d;
  font-weight: 600;
}
.asgt-print-frame {
  position: fixed;
  right: 100%;
  bottom: 100%;
  width: 1200px;
  height: 800px;
  border: 0;
}

@media (max-width: 760px) {
  .asgt-calendar-header,
  .asgt-toolbar { align-items: stretch; flex-direction: column; }
  .asgt-filters { grid-template-columns: 1fr; }
  .asgt-filters > label,
  .asgt-filters fieldset,
  .asgt-filters .asgt-filter-actions { grid-column: 1; }
  .asgt-filters fieldset label { width: 100%; }
  .asgt-filter-disciplines,
  .asgt-filter-categories { grid-template-columns: 1fr; }
  .asgt-table-wrap { display: none; }
  .asgt-cards { display: block; }
  .asgt-row-actions a,
  .asgt-row-actions button { width: 100%; }
  .asgt-month-weekdays { display: none; }
  .asgt-month-grid { grid-template-columns: 1fr; }
  .asgt-month-cell { min-height: auto; }
  .asgt-modal dl { grid-template-columns: 1fr; }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .asgt-filters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .asgt-filter-search,
  .asgt-filter-location { grid-column: span 3; }
  .asgt-filter-period,
  .asgt-filter-date,
  .asgt-filter-month,
  .asgt-filter-status,
  .asgt-filter-sort,
  .asgt-filter-page-size { grid-column: span 2; }
  .asgt-filter-disciplines,
  .asgt-filter-categories { grid-column: span 3; grid-template-columns: 1fr; }
  .asgt-filters .asgt-filter-actions { grid-column: span 4; }
}
