@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --header: #02679e;
  --primary: #36a9e1;
  --hover-primary-button: #1f97d1;
  --blue: #2563eb;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --red: #dc2626;
  --red-50: #fef2f2;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --bg: #f4f6f9;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", sans-serif;
  background: var(--bg);
  color: var(--gray-900);
}

.layout {
  padding: 40px 24px;
}

.card {
  max-width: 1040px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 1px 3px rgba(16, 24, 40, 0.06);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-head {
  padding: 22px 28px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}

.card-head h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.2px;
  color: var(--header);
}

.card-head .count {
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 500;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  color: var(--gray-500);
  font-weight: 500;
  font-size: 12px;
  background: #fafbfc;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: 16px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #fafbfc;
}

.col-date {
  font-weight: 500;
  color: var(--gray-900);
}

.col-name {
  font-weight: 600;
  color: var(--gray-900);
}
.col-phone {
  color: var(--gray-500);
  font-size: 14px;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
}

/* .platform-badge::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #03c75a; 
      } */

.status {
  font-weight: 600;
  font-size: 13px;
  display: block;
  text-align: center;
}

.status.wait {
  color: var(--primary);
}

.status.cancel {
  color: var(--red);
}

.status.change {
  color: var(--gray-500);
}

.status.confirmed {
  color: var(--gray-500);
  font-weight: 500;
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  & .btn-accept,
  .btn-reject {
    width: 50px;
  }

  & .btn-confirm {
    width: 108px;
  }
}

.col-actions {
  text-align: center;
  /* min-width: 190px; */
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: "Pretendard", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 7px;
  transition:
    background 0.15s ease,
    transform 0.05s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
  &:hover {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-400);
  }
  &:active {
    transform: none;
  }
}

.btn-primary {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--hover-primary-button);
  border: 1px solid var(--hover-primary-button);
}

.btn-reject {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-reject:hover {
  background: var(--gray-100);
}

.btn-confirm {
  background: #fff;
  color: var(--red);
  border: 1px solid #fca5a5;
  width: 100%;
}
.btn-confirm:hover {
  background: var(--red-50);
}

.confirm-wrap {
  display: flex;
  justify-content: flex-end;
}
.confirm-wrap .btn-confirm {
  width: auto;
  padding: 7px 28px;
}

.dash {
  color: var(--gray-300);
  font-size: 13px;
}

/* ── Header ── */
.site-header {
  /* position: fixed;
        top: 0;
        left: 0;
        right: 0; */
  height: 36px;
  background-color: var(--header);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 32px;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo .logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: white;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.header-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  padding: 6px 12px;
  border-radius: 7px;
  transition:
    background 0.12s,
    color 0.12s;
}

.header-nav a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.header-nav a.active {
  background: var(--blue-50);
  color: var(--blue);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--gray-200);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  width: 100%;
  max-width: 760px;
  max-height: 80vh;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-head .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 4px;
}
.modal-head .subtitle {
  font-size: 12.5px;
  color: var(--gray-500);
  margin: 0;
}
.modal-head .subtitle b {
  color: var(--blue);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover {
  color: var(--gray-900);
}

.modal-body {
  padding: 14px 24px 24px;
  height: 100%;
  overflow: hidden;
}

.scroll {
  &::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }
  &::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
  }
  &::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
  }
}

.spinner-item {
  position: relative;
}

.spinner {
  background-color: var(--white);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  & img {
    width: 40px;
    animation-name: spin;
    animation-duration: 1s;
    animation-iteration-count: infinite;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.hide {
  display: none !important;
}

#bookingList {
  & .layout {
    height: calc(100vh - 36px);
    overflow: hidden;
  }

  & .booking-table-card {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  & #bookingTable {
    flex: 1;
    overflow-y: auto;
    & thead {
      position: sticky;
      top: 0;
    }
  }

  & .customer-table {
    overflow-y: auto;
    height: 100%;
  }
}

.customer-modal {
  & .modal {
    max-width: 500px;
    max-height: 60vh;
  }

  & .modal-search {
    padding: 14px 24px 0;
  }

  & .modal-search input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: "Pretendard", sans-serif;
    font-size: 13px;
    outline: none;
  }

  & .modal-search input:focus {
    border-color: var(--blue);
  }

  & .modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
  }

  &.modal-table thead th {
    text-align: left;
    padding: 10px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #fff;
  }

  &.modal-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    white-space: nowrap;
  }

  &.modal-table tbody tr:last-child td {
    border-bottom: none;
  }

  /* .modal-table tbody tr:hover td {
        background: var(--blue-50);
    } */

  &.cust-name {
    font-weight: 600;
    color: var(--gray-900);
  }

  &.cust-id {
    color: var(--gray-500);
    font-size: 14px;
  }

  & .btn-select {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;

    &:hover {
      background: var(--hover-primary-button);
      border: 1px solid var(--hover-primary-button);
    }

    &:active {
      transform: scale(0.97);
    }
  }
}

.booking-modal {
  & .modal {
    max-width: 1220px;
    max-height: 92vh;
  }

  & .modal-body {
    overflow-y: auto;
  }

  .field-grid {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 14px;
    margin-bottom: 12px;
  }

  .field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
  }

  & input[type="text"],
  input[type="date"],
  select,
  .before-date {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: "Pretendard", sans-serif;
    font-size: 13px;
    color: var(--gray-900);
    outline: none;
    background: #fff;
  }
  & input::placeholder {
    color: var(--gray-400);
  }
  & input:focus,
  select:focus {
    border-color: var(--blue);
  }

  & input:read-only {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-400);
  }

  &.info-box {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    height: 38px;
  }

  &.addr-row {
    display: flex;
    gap: 8px;
  }

  &.addr-row input {
    flex: 1;
  }

  & .time-row {
    display: flex;
    gap: 14px;
    align-items: center;
  }

  /* ----- 태그 섹션 ----- */
  & .tag-section {
    margin-bottom: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
  }

  & .tag-section:first-of-type {
    border-top: none;
    padding-top: 4px;
  }

  & .tag-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
  }

  & .tag-label .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
  }

  & .tag-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  & .chip {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    background: #fff;
    user-select: none;
    white-space: nowrap;
    position: relative;
    height: 28px;

    &:hover {
      /* border-color: var(--blue); */
      /* border-color: var(--primary); */
      background: var(--blue-50);
      border-color: var(--blue-100);
    }

    &:has(input:checked) {
      background: var(--blue-50);
      border-color: var(--blue-100);
      color: var(--primary);

      & .icon {
        & .check {
          display: none;
        }
        & .x {
          display: inline-block;
        }
        & .disabled {
          display: none;
        }
      }
    }

    &:has(input:disabled) {
      background: var(--gray-100);
      border-color: var(--gray-200);
      color: var(--gray-400);
      cursor: not-allowed;

      & .icon {
        & .check {
          display: none;
        }
        & .x {
          display: none;
        }
        & .disabled {
          display: inline-block;
        }
      }
    }

    & input {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      opacity: 0;
      margin: 0;
      cursor: pointer;
    }

    & > div {
      display: flex;
      align-items: center;
      gap: 4px;
      & > span {
        line-height: 16px;
      }
    }

    & .icon {
      & .check {
        display: inline-block;
      }
      & .x {
        display: none;
      }
      & .disabled {
        display: none;
      }
    }
  }

  & .chip.muted {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-400);
  }

  & .chip-icon {
    font-size: 11px;
    line-height: 1;
  }

  & .content-field {
    margin-top: 14px;
  }

  & textarea {
    width: 100%;
    min-height: 110px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: "Pretendard", sans-serif;
    font-size: 13px;
    color: var(--gray-900);
    outline: none;
    resize: vertical;
    resize: none;
  }

  & textarea:focus {
    border-color: var(--blue);
  }

  /* ===== 하단 액션 바 ===== */

  & .footer-bar {
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 12px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
  }

  & .btn {
    font-family: "Pretendard", sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 22px;
    border-radius: 8px;
    cursor: pointer;
    /* border: none; */
  }

  & .btn-cancel {
    background: var(--gray-100);
    color: var(--gray-700);
  }

  & .btn-cancel:hover {
    background: var(--gray-200);
  }
}
