/* Base container */
#shftsup-root {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 16px;
}

.shftsup-title {
  margin: 0 0 12px 0;
}

/* Calendar shell */
.shftsup-cal-shell {
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.shftsup-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.shftsup-cal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shftsup-btn {
  border: 1px solid #d8d8d8;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
}

.shftsup-btn:hover {
  background: #f6f6f6;
}

.shftsup-btn-primary {
  background: #111;
  color: #fff;
  border-color: #111;
}

.shftsup-btn-primary:hover {
  background: #000;
}

.shftsup-month-label {
  font-weight: 700;
  font-size: 22px;
  text-align: right;
  white-space: nowrap;
}

/* Day-of-week header row */
.shftsup-dow {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 0 !important;
  border: 1px solid #e6e6e6;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.shftsup-dow > div {
  padding: 10px 8px;
  font-weight: 700;
  font-size: 13px;
  border-right: 1px solid #e6e6e6;
  background: #fafafa;
}

.shftsup-dow > div:last-child {
  border-right: none;
}

/* Calendar grid */
#shftsup-grid.shftsup-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  grid-auto-rows: 88px;
  gap: 0 !important;
  border: 1px solid #e6e6e6;
  border-top: none;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}

/* Day cell */
.shftsup-day {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  border-right: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;
  background: #fff;
  text-align: left;
  padding: 10px;
  cursor: pointer;
}

.shftsup-day:nth-child(7n) {
  border-right: none;
}

.shftsup-day:hover {
  background: #f8f8f8;
}

.shftsup-day.is-outside {
  background: #fafafa;
  color: #888;
}

.shftsup-day.is-today {
  outline: 2px solid #111;
  outline-offset: -2px;
}

.shftsup-day.is-selected {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.shftsup-daynum {
  font-weight: 700;
  font-size: 13px;
}

/* Badge count */
.shftsup-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Selected bar */
.shftsup-selectedbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
}

.shftsup-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* Shifts area */
.shftsup-shifts {
  margin-top: 10px;
}

.shftsup-shifts-title {
  margin: 10px 0 10px 0;
  font-size: 16px;
}

.shftsup-loading {
  padding: 12px;
  color: #555;
}

.shftsup-emptycard,
.shftsup-errorcard {
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}

.shftsup-errorcard {
  border-color: #f3b4b4;
  color: #b00020;
  background: #fff6f6;
}

/* Shift cards */
.shftsup-shiftlist {
  display: grid;
  gap: 10px;
}

.shftsup-shiftcard {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.shftsup-shiftcard.is-mine {
  border-color: #cfe3ff;
  background: #f4f8ff;
}

.shftsup-shiftrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shftsup-shifttime {
  font-weight: 800;
}

.shftsup-shiftunit {
  color: #333;
}

.shftsup-mine-tag {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
}

/* Divider */
.shftsup-divider {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid #eee;
}

/* Form */
.shftsup-form {
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.shftsup-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.shftsup-field input {
  width: 100%;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.shftsup-submit {
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.shftsup-submit:hover {
  background: #000;
}

.shftsup-msg {
  margin-top: 6px;
  font-size: 13px;
}

.shftsup-msg.ok {
  color: #0a7a0a;
}

.shftsup-msg.err {
  color: #b00020;
}

/* My shifts */
.shftsup-myshifts {
  margin-top: 18px;
}

.shftsup-mydate {
  font-weight: 800;
  margin-bottom: 4px;
}

.shftsup-del {
  border: 1px solid #d8d8d8;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.shftsup-del:hover {
  background: #f6f6f6;
}

/* Login box */
#shftsup-login-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
}

/* Responsive */
@media (max-width: 640px) {
  .shftsup-cal-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .shftsup-month-label {
    text-align: left;
    font-size: 18px;
  }
  #shftsup-grid.shftsup-grid {
    grid-auto-rows: 70px;
  }
}
