/* Calendar toolbar */
.ap-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--ap-border);
}

.ap-cal-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.ap-cal-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--ap-radius-sm);
  border: 1px solid var(--ap-border);
  background: var(--ap-bg);
  color: var(--ap-text-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ap-cal-nav-btn:hover {
  background: var(--ap-border);
}

.ap-cal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ap-text-strong);
  min-width: 170px;
  text-align: center;
}

/* Month grid */
.ap-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-width: 0;
}

.ap-cal-weekday {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--ap-secondary);
  padding: .7rem 0;
  border-bottom: 1px solid var(--ap-border);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.ap-cal-day {
  min-height: 118px;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--ap-border);
  border-bottom: 1px solid var(--ap-border);
  padding: .5rem;
  position: relative;
  cursor: pointer;
  transition: background .12s ease;
}

.ap-cal-day:nth-child(7n) {
  border-right: 0;
}

.ap-cal-day:hover {
  background: var(--ap-bg);
}

.ap-cal-day.other-month {
  background: var(--ap-bg);
  opacity: .5;
}

.ap-cal-day.today {
  background: var(--ap-primary-100);
}

.ap-cal-day.drag-over {
  outline: 2px dashed var(--ap-primary);
  outline-offset: -3px;
}

.ap-cal-daynum {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ap-text-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ap-cal-day.today .ap-cal-daynum {
  background: var(--ap-primary);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.ap-cal-events {
  margin-top: .35rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.ap-cal-event {
  font-size: .68rem;
  font-weight: 600;
  padding: .15rem .4rem;
  border-radius: 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
}

.ap-cal-event.dragging {
  opacity: .4;
}

.ap-cal-more {
  font-size: .68rem;
  color: var(--ap-secondary);
  font-weight: 600;
  padding-left: .2rem;
}

/* Week view */
.ap-week-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
}

.ap-week-head-cell {
  text-align: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--ap-border);
  border-left: 1px solid var(--ap-border);
}

.ap-week-head-cell .dow {
  font-size: .68rem;
  color: var(--ap-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.ap-week-head-cell .num {
  font-size: .95rem;
  font-weight: 800;
  color: var(--ap-text-strong);
}

.ap-week-head-cell.today .num {
  color: var(--ap-primary);
}

.ap-week-time {
  font-size: .68rem;
  color: var(--ap-secondary);
  text-align: right;
  padding-right: .4rem;
  height: 52px;
  border-bottom: 1px solid var(--ap-border);
  position: relative;
  top: -7px;
}

.ap-week-slot {
  height: 52px;
  border-bottom: 1px solid var(--ap-border);
  border-left: 1px solid var(--ap-border);
  position: relative;
}

.ap-week-event {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  padding: .15rem .3rem;
  overflow: hidden;
}

/* Day view (agenda) */
.ap-agenda-item {
  display: flex;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--ap-border);
}

.ap-agenda-item:last-child {
  border-bottom: none;
}

.ap-agenda-time {
  width: 78px;
  flex-shrink: 0;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ap-secondary);
}

.ap-agenda-bar {
  width: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.ap-agenda-body {
  flex: 1;
}

.ap-agenda-title {
  font-weight: 700;
  color: var(--ap-text-strong);
  font-size: .9rem;
}

.ap-agenda-meta {
  font-size: .76rem;
  color: var(--ap-secondary);
  margin-top: .15rem;
}

/* Sidebar */
.ap-cat-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 0;
  font-size: .83rem;
}

.ap-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.ap-upcoming-item {
  display: flex;
  gap: .7rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--ap-border);
}

.ap-upcoming-item:last-child {
  border-bottom: none;
}

.ap-upcoming-date {
  width: 44px;
  height: 44px;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-upcoming-date .mon {
  font-size: .62rem;
  font-weight: 700;
  color: var(--ap-secondary);
  text-transform: uppercase;
}

.ap-upcoming-date .day {
  font-size: .95rem;
  font-weight: 800;
  color: var(--ap-text-strong);
  line-height: 1;
}

.ap-upcoming-title {
  font-size: .83rem;
  font-weight: 600;
  color: var(--ap-text-strong);
}

.ap-upcoming-meta {
  font-size: .72rem;
  color: var(--ap-secondary);
}

.modal-content {
  border-radius: var(--ap-radius);
  border: 1px solid var(--ap-border);
  background: var(--ap-surface);
}

.modal-header,
.modal-footer {
  border-color: var(--ap-border);
}

.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ap-text-strong);
}

.form-control,
.form-select {
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  font-size: .85rem;
  color: var(--ap-text-strong);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ap-primary);
  box-shadow: 0 0 0 3px var(--ap-primary-100);
}

.ap-view-toggle .btn {
  padding: .4rem .8rem;
  font-size: .8rem;
}

/* ============ Utility classes (extracted from inline styles) ============ */

/* Font sizes */
.ap-fs-13 {
  font-size: 1.3rem;
}

.ap-fs-06 {
  font-size: .6rem;
}

.ap-fs-18 {
  font-size: 1.8rem;
}

.ap-fs-085 {
  font-size: .85rem;
}

/* Text colors */
.ap-color-strong {
  color: var(--ap-text-strong);
}

.ap-color-secondary {
  color: var(--ap-secondary);
}

/* Transparent button (topbar user) */
.ap-btn-transparent {
  background: transparent;
}

/* Hidden panel */
.ap-hidden {
  display: none !important;
}

/* Week view wrapper */
.ap-week-view-wrap {
  overflow-x: auto;
}

.ap-week-head-grid {
  min-width: 760px;
}

.ap-week-body-wrap {
  position: relative;
  min-width: 760px;
}

/* Category dot color variants */
.ap-cat-dot-primary {
  background: var(--ap-primary);
}

.ap-cat-dot-danger {
  background: var(--ap-danger);
}

.ap-cat-dot-info {
  background: var(--ap-info);
}

.ap-cat-dot-success {
  background: var(--ap-success);
}

.ap-cat-dot-warning {
  background: var(--ap-warning);
}

/* Empty-state icon (day view) */
.ap-day-empty-icon {
  font-size: 1.8rem;
}

/* Sidebar upcoming empty state */
.ap-upcoming-empty {
  text-align: center;
  padding: 1rem 0;
  color: var(--ap-secondary);
  font-size: .83rem;
}

/* Footer */
.ap-footer {
  color: var(--ap-secondary);
}
