/* Huh&You 사건관리 시스템 - Schedule Page Styles */
/* Based on w05-schedules.html from Stitch design */

turbo-frame.schedule-results {
  display: block;
}

/* Schedule index */
.schedule-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
}

.schedule-index > * {
  min-width: 0;
}

.schedule-index .schedule-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  align-items: end;
  gap: 24px;
}

.schedule-index .schedule-eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.schedule-index .schedule-header h1 {
  margin: 0;
  color: var(--gray-900);
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.schedule-index .schedule-page-description {
  max-width: 44rem;
  margin: 8px 0 0;
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.6;
}

.schedule-index .schedule-search-form {
  min-width: 0;
}

.schedule-index .schedule-search-field {
  display: flex;
  gap: 8px;
}

.schedule-index .schedule-search-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-900);
  font-size: 14px;
}

.schedule-index .schedule-search-input::placeholder {
  color: var(--gray-500);
}

.schedule-index .schedule-search-submit {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #FFFFFF;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.schedule-index .schedule-search-submit:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.schedule-index .schedule-search-help {
  margin: 6px 0 0;
  color: var(--gray-500);
  font-size: 12px;
  line-height: 1.45;
}

.schedule-index .schedule-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.schedule-index .schedule-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.schedule-index .schedule-filter-tab:hover {
  background: var(--gray-100);
}

.schedule-index .schedule-filter-tab.is-active {
  background: var(--primary);
  color: #FFFFFF;
}

.schedule-index .schedule-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(20, 36, 58, 0.08);
  color: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.schedule-index .schedule-filter-tab.is-active .schedule-filter-count {
  background: rgba(255, 255, 255, 0.2);
}

.schedule-index .schedule-results-panel {
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--panel-shadow);
}

.schedule-index .schedule-results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.schedule-index .schedule-results-heading h2,
.schedule-index .schedule-empty-state h2 {
  margin: 0;
  color: var(--gray-900);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.35;
}

.schedule-index .schedule-results-heading p {
  margin: 5px 0 0;
  color: var(--gray-500);
  font-size: 13px;
  line-height: 1.5;
}

.schedule-index .schedule-results-heading strong {
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}

.schedule-index .schedule-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--gray-300) transparent;
}

.schedule-index .schedule-table-wrapper:focus-visible,
.schedule-index .schedule-filter-tab:focus-visible,
.schedule-index .schedule-search-input:focus-visible,
.schedule-index .schedule-search-submit:focus-visible,
.schedule-index .schedule-action-btn:focus-visible,
.schedule-index .schedule-empty-reset:focus-visible,
.schedule-index .pagination a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.schedule-index .schedule-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate !important;
  border-spacing: 0;
  color: var(--gray-700);
  font-size: 14px;
}

.schedule-index .schedule-table th {
  padding: 12px;
  border-bottom: 1px solid var(--gray-300) !important;
  background: var(--gray-50) !important;
  color: var(--gray-600) !important;
  font-size: 12px;
  font-weight: 750 !important;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
}

.schedule-index .schedule-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--gray-200) !important;
  line-height: 1.5;
  vertical-align: middle;
  word-break: normal;
}

.schedule-index .schedule-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.schedule-index .schedule-table tbody tr:hover,
.schedule-index .schedule-table tbody tr:focus-within {
  background: #F5F8FB;
}

.schedule-index .schedule-title-cell {
  min-width: 17rem;
  max-width: 28rem;
  color: var(--gray-900);
  font-weight: 750 !important;
  word-break: normal !important;
  overflow-wrap: anywhere;
}

.schedule-index .schedule-date {
  min-width: 8.75rem;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.schedule-index .schedule-origin {
  min-width: 11.5rem;
  color: var(--gray-600);
  font-size: 13px;
}

.schedule-index .schedule-origin time,
.schedule-index .schedule-case-name {
  display: block;
}

.schedule-index .schedule-case-name {
  margin-top: 3px;
  color: var(--gray-500);
  overflow-wrap: anywhere;
}

.schedule-index .schedule-status-cell {
  min-width: 6.5rem;
}

.schedule-index .schedule-status-cell .badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.55rem;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.schedule-index .schedule-actions-header {
  min-width: 10.75rem;
  text-align: right;
}

.schedule-index .schedule-actions-cell {
  min-width: 10.75rem;
}

.schedule-index .schedule-actions-cell-pending {
  min-width: 19.25rem;
}

.schedule-index .schedule-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.schedule-index .schedule-row-actions form {
  display: inline-flex;
  margin: 0;
}

.schedule-index .schedule-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--gray-700);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.schedule-index .schedule-action-btn .ui-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.schedule-index .schedule-action-label {
  display: none;
}

.schedule-index .schedule-action-btn:hover {
  border-color: #BFC9C3;
  background: #F7FAFC;
  transform: translateY(-1px);
}

.schedule-index .schedule-action-btn-view,
.schedule-index .schedule-action-btn-edit {
  color: #1D4ED8;
}

.schedule-index .schedule-action-btn-delete,
.schedule-index .schedule-action-btn-reject {
  color: #9F1239;
}

.schedule-index .schedule-action-btn-delete:hover,
.schedule-index .schedule-action-btn-reject:hover {
  border-color: #FDA4AF;
  background: #FFF1F2;
}

.schedule-index .schedule-action-btn-approve,
.schedule-index .schedule-action-btn-reject {
  gap: 5px;
  width: auto;
  min-width: 4.75rem;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 750;
}

.schedule-index .schedule-action-btn-approve {
  border-color: #6EE7B7;
  background: #ECFDF5;
  color: #047857;
}

.schedule-index .schedule-action-btn-approve:hover {
  border-color: #34D399;
  background: #D1FAE5;
}

.schedule-index .schedule-action-text {
  line-height: 1;
}

.schedule-index .pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.schedule-index .pagination a,
.schedule-index .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 7px;
  background: #FFFFFF;
  color: var(--gray-700);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.schedule-index .pagination a:hover {
  border-color: var(--gray-300);
  background: var(--gray-100);
}

.schedule-index .pagination .current {
  border-color: var(--primary);
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 750;
}

.schedule-index .pagination .disabled {
  color: var(--gray-500);
  cursor: not-allowed;
  opacity: 0.6;
}

.schedule-index .pagination .gap {
  min-width: auto;
  padding: 8px 2px;
  border-color: transparent;
  background: transparent;
}

.schedule-index .schedule-empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 34rem;
  padding: 32px;
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  background: var(--gray-50);
}

.schedule-index .schedule-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
}

.schedule-index .schedule-empty-icon .ui-icon {
  width: 24px;
  height: 24px;
}

.schedule-index .schedule-empty-state p {
  margin: 0;
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.6;
}

.schedule-index .schedule-empty-reset {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 4px;
  padding: 8px 12px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: #FFFFFF;
  color: var(--primary);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.schedule-index .schedule-empty-reset:hover {
  background: var(--primary);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.schedule-index .schedule-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Schedule Card (for dashboard) */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  transition: all 0.2s;
}

.schedule-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.schedule-icon {
  width: 48px;
  height: 48px;
  background: #EFF6FF;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.schedule-content {
  flex: 1;
}

.schedule-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.schedule-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--gray-500);
}

.schedule-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Responsive */
@media (max-width: 900px) {
  .schedule-index .schedule-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .schedule-index .schedule-search-form {
    width: min(100%, 32rem);
  }
}

@media (max-width: 768px) {
  .schedule-index {
    gap: 16px;
  }

  .schedule-index .schedule-filter-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .schedule-index .schedule-filter-tab {
    justify-content: space-between;
    min-width: 0;
  }

  .schedule-index .schedule-results-panel {
    padding: 16px;
  }

  .schedule-index .schedule-results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  /* One schedule becomes one readable card: every field stays in the same
     reading flow instead of forcing a horizontal table scroll. */
  .schedule-index .schedule-table-wrapper {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .schedule-index .schedule-table {
    display: block;
    min-width: 0;
  }

  .schedule-index .schedule-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .schedule-index .schedule-table tbody {
    display: grid;
    gap: 12px;
  }

  .schedule-index .schedule-table tbody tr {
    display: grid;
    padding: 4px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
  }

  .schedule-index .schedule-table tbody tr:hover,
  .schedule-index .schedule-table tbody tr:focus-within {
    background: #F5F8FB;
  }

  .schedule-index .schedule-table td {
    display: grid;
    grid-template-columns: minmax(5rem, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    min-width: 0;
    padding: 10px 0;
  }

  .schedule-index .schedule-table td::before {
    color: var(--gray-600);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.5;
  }

  .schedule-index .schedule-table tbody tr:last-child td {
    border-bottom: 1px solid var(--gray-200) !important;
  }

  .schedule-index .schedule-table tbody tr td:last-child {
    border-bottom: 0 !important;
  }

  .schedule-index .schedule-title-cell {
    display: block !important;
    min-width: 0;
    max-width: none;
    padding: 12px 0 10px;
    border-bottom-color: var(--gray-300) !important;
    font-size: 15px;
    line-height: 1.55;
  }

  .schedule-index .schedule-table td.schedule-title-cell::before {
    content: none;
  }

  .schedule-index .schedule-date,
  .schedule-index .schedule-origin,
  .schedule-index .schedule-status-cell,
  .schedule-index .schedule-actions-cell,
  .schedule-index .schedule-actions-cell-pending {
    min-width: 0;
  }

  .schedule-index .schedule-date {
    white-space: normal;
  }

  .schedule-index .schedule-origin {
    font-size: 14px;
  }

  .schedule-index .schedule-case-name {
    margin-top: 4px;
  }

  .schedule-index .schedule-table td.schedule-actions-cell {
    display: block;
    padding-top: 12px;
  }

  .schedule-index .schedule-table td.schedule-actions-cell::before {
    display: block;
    margin-bottom: 8px;
  }

  .schedule-index .schedule-row-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(4.25rem, 1fr));
    justify-content: stretch;
  }

  .schedule-index .schedule-row-actions form {
    display: block;
    min-width: 0;
  }

  .schedule-index .schedule-action-btn,
  .schedule-index .schedule-action-btn-approve,
  .schedule-index .schedule-action-btn-reject {
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
  }

  .schedule-index .schedule-action-btn-approve,
  .schedule-index .schedule-action-btn-reject {
    padding: 0 8px;
  }

  .schedule-index .schedule-action-label {
    display: inline;
    font-size: 13px;
    font-weight: 750;
    line-height: 1;
  }

  .schedule-card {
    flex-direction: column;
  }

  .schedule-actions {
    flex-direction: column;
    width: 100%;
  }

  .schedule-actions .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .schedule-index .schedule-search-form {
    width: 100%;
  }

  .schedule-index .schedule-search-field {
    flex-direction: column;
  }

  .schedule-index .schedule-search-submit {
    width: 100%;
  }

  .schedule-index .schedule-empty-state {
    padding: 24px;
  }

  .schedule-index .schedule-table tbody tr {
    padding-right: 14px;
    padding-left: 14px;
  }

  .schedule-index .schedule-table td {
    grid-template-columns: minmax(4.5rem, 36%) minmax(0, 1fr);
    gap: 10px;
  }
}
