/* ============================================================
   SIMAS — Roster Harian — Module-specific styles
   Extends: shared/header.css + shared/sidebar.css
   ============================================================ */

/* ============================================================
   Date pill (date picker display)
   ============================================================ */
.date-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.date-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.date-pill i {
  color: var(--navy);
  font-size: 0.8125rem;
}
.date-picker-hidden {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* ---- Dipo select ---- */
.dipo-select {
  font-weight: 600;
  color: var(--navy);
}

/* ============================================================
   Constraint Alert Banner
   ============================================================ */
.constraint-alert-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 9px;
  font-size: 0.8125rem;
}
.constraint-alert-box > i {
  color: var(--amber);
  font-size: 1rem;
  flex-shrink: 0;
}
.constraint-alert-text {
  flex: 1;
  line-height: 1.5;
  color: var(--text);
}

/* ============================================================
   Roster Panels (two-column)
   ============================================================ */
.roster-panels {
  align-items: start;
  min-height: 0;
}

/* ============================================================
   Duty List Card
   ============================================================ */
.duty-list-card {
  overflow: hidden;
}

.duty-list-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 360px);
  min-height: 200px;
}

/* ---- Duty card ---- */
.duty-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  position: relative;
}
.duty-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0;
  transition: width 0.15s;
}
.duty-card:hover {
  background: rgba(37, 99, 235, 0.03);
}
.duty-card.selected {
  background: rgba(37, 99, 235, 0.05);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}
.duty-card.selected::before {
  width: 4px;
  background: var(--accent);
}

/* Status-specific left border & row background */
.duty-card.duty-lengkap::before { background: var(--green); }
.duty-card.duty-partial::before { background: var(--amber); }
.duty-card.duty-kosong::before  { background: var(--red); }

.duty-card.duty-partial { background: rgba(245, 158, 11, 0.025); }
.duty-card.duty-kosong  { background: rgba(239, 68, 68, 0.025); }

.duty-card.duty-partial:hover { background: rgba(245, 158, 11, 0.06); }
.duty-card.duty-kosong:hover  { background: rgba(239, 68, 68, 0.06); }

.duty-card.duty-kosong.selected { background: rgba(239, 68, 68, 0.07); }
.duty-card.duty-partial.selected { background: rgba(245, 158, 11, 0.07); }

/* ---- Time column ---- */
.duty-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  margin-right: 0.75rem;
  gap: 2px;
  flex-shrink: 0;
}
.duty-time {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  line-height: 1;
}
.duty-time-arrow {
  color: var(--muted);
  line-height: 1;
}

/* ---- Duty info ---- */
.duty-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.duty-header {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.duty-ka {
  font-size: 0.6875rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--navy);
  background: rgba(27, 58, 107, 0.08);
  padding: 0.1rem 0.375rem;
  border-radius: 4px;
  white-space: nowrap;
}
.duty-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}
.duty-dur {
  font-size: 0.6rem;
  color: var(--muted);
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.duty-route {
  font-size: 0.6875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ---- Crew tags in duty card ---- */
.duty-crew {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.125rem;
}
.crew-tag {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-weight: 600;
  white-space: nowrap;
}
.crew-ok {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.crew-empty {
  background: rgba(239, 68, 68, 0.1);
  color: #991B1B;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-style: italic;
}
.crew-warn {
  background: rgba(245, 158, 11, 0.1);
  color: #92400E;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ---- Duty status column ---- */
.duty-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.375rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.duty-status-badge {
  font-size: 0.5625rem;
}
.duty-sarana-badge {
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ---- More indicator ---- */
.duty-more-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(27, 58, 107, 0.02);
  border-top: 1px dashed var(--border);
}
.duty-more-indicator i {
  opacity: 0.5;
}

/* ============================================================
   Assignment Panel (right column)
   ============================================================ */
.assign-panel-card {
  overflow: visible;
}

.assign-selected-info {
  padding: 0.875rem 1rem;
  background: rgba(27, 58, 107, 0.03);
  border-bottom: 1px solid var(--border);
}
.assign-duty-title {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}
.assign-duty-title strong {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
}
.assign-duty-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.assign-duty-meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.assign-duty-details {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.assign-detail-pill {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  min-width: 52px;
}
.assign-detail-lbl {
  font-size: 0.5625rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.assign-detail-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

/* ---- Slot section ---- */
.assign-slot-section {
  padding: 0.875rem 1rem 0.5rem;
}
.assign-slot-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.assign-slot-label i {
  color: var(--navy);
  font-size: 0.8125rem;
}
.assign-required-badge {
  font-size: 0.5625rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.1);
  color: #991B1B;
  padding: 0.1rem 0.375rem;
  border-radius: 100px;
  margin-left: auto;
}

/* ---- Slot overrides for roster ---- */
.slot {
  margin-bottom: 0.625rem;
  font-size: 0.75rem;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---- Eligible list ---- */
.eligible-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.eligible-header {
  padding: 0.375rem 0.75rem;
  background: rgba(27, 58, 107, 0.04);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.eligible-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.15s;
}
.eligible-item:last-child {
  border-bottom: none;
}
.eligible-item:hover:not(.eligible-blocked) {
  background: rgba(37, 99, 235, 0.04);
}
.eligible-item.eligible-warn {
  background: rgba(245, 158, 11, 0.04);
}
.eligible-item.eligible-blocked {
  background: rgba(239, 68, 68, 0.03);
  cursor: not-allowed;
}

/* ---- Eligible avatar ---- */
.eligible-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* ---- Eligible info ---- */
.eligible-info {
  flex: 1;
  min-width: 0;
}
.eligible-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}
.eligible-nip {
  font-size: 0.5625rem;
  color: var(--muted);
}
.eligible-detail {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ---- Eligible right actions ---- */
.eligible-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* ---- Assign panel footer ---- */
.assign-panel-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(27, 58, 107, 0.02);
}

/* ---- Filled slot ---- */
.slot.filled {
  flex-direction: row;
  justify-content: flex-start;
  gap: 0.625rem;
  text-align: left;
  cursor: default;
  min-height: 52px;
}
.slot-filled-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.slot-filled-info {
  flex: 1;
}
.slot-filled-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}
.slot-filled-meta {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 1px;
}
.slot-unassign-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.slot-unassign-btn:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}

/* ---- Assign placeholder ---- */
.assign-placeholder {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.assign-placeholder-inner {
  text-align: center;
  color: var(--muted);
  font-size: 0.8125rem;
}
.assign-placeholder-inner i {
  font-size: 2rem;
  opacity: 0.3;
  display: block;
  margin-bottom: 0.75rem;
}

/* ============================================================
   Roster Bottom Bar
   ============================================================ */
.roster-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}
.roster-bottom-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.roster-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.roster-status-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.roster-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-ok     { background: var(--green); }
.dot-partial { background: var(--amber); animation: pulse 2s infinite; }
.dot-empty  { background: var(--red); }
.roster-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
}

/* ============================================================
   Modal — Override / Generate
   ============================================================ */
.override-warning-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}
.override-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.override-check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  cursor: pointer;
}
.override-check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--amber);
  cursor: pointer;
}

.generate-rules {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.generate-rule {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
}
.generate-note {
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 7px;
  padding: 0.625rem 0.875rem;
  font-size: 0.75rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}

/* ============================================================
   Assign animation
   ============================================================ */
@keyframes slotFill {
  0% { opacity: 0; transform: scale(0.95); }
  60% { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
.slot.filled {
  animation: slotFill 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 320px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.toast-success { background: var(--green); }
.toast.toast-error   { background: var(--red); }
.toast.toast-warn    { background: var(--amber); color: var(--text); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .roster-panels {
    grid-template-columns: 1fr;
  }
  .duty-list-scroll {
    max-height: 400px;
  }
}
