/* ── Ladies Management ── */
.cti-ladies-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 16px;
}
.cti-ladies-search {
  flex: 1; max-width: 280px;
  padding: 8px 12px; border: 1px solid #CBD5E1;
  border-radius: 8px; font-size: 14px; outline: none;
}
.cti-ladies-search:focus { border-color: #3B82F6; }
.cti-ladies-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: #475569; cursor: pointer;
}
.cti-ladies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.cti-lady-card {
  background: #fff; border: 1px solid #E2E8F0;
  border-radius: 12px; padding: 16px;
  cursor: pointer; transition: box-shadow .15s;
}
.cti-lady-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.cti-lady-card.inactive { opacity: .5; }
.cti-lady-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.cti-lady-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #DBEAFE; display: flex; align-items: center;
  justify-content: center; font-size: 18px; flex-shrink: 0;
}
.cti-lady-name { font-weight: 700; font-size: 15px; color: #1E293B; }
.cti-lady-store { font-size: 12px; color: #64748B; margin-top: 2px; }
.cti-lady-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.cti-lady-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: #EFF6FF; color: #1D4ED8;
}
.cti-lady-tag.ng  { background: #FEF2F2; color: #DC2626; }
.cti-lady-tag.ok  { background: #F0FDF4; color: #16A34A; }
.cti-lady-tag.off { background: #F8FAFC; color: #94A3B8; }
.cti-lady-memo-preview {
  font-size: 12px; color: #64748B; margin-top: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Ladies profile edit modal ── */
.cti-lady-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 1100; display: flex; align-items: center; justify-content: center;
}
.cti-lady-modal {
  background: #fff; border-radius: 16px;
  width: 520px; max-width: 95vw; max-height: 90vh;
  overflow-y: auto; padding: 28px;
}
.cti-lady-modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.cti-lady-field { margin-bottom: 14px; }
.cti-lady-field label {
  display: block; font-size: 13px; font-weight: 600;
  color: #374151; margin-bottom: 4px;
}
.cti-lady-field input[type=text],
.cti-lady-field textarea,
.cti-lady-field select {
  width: 100%; padding: 8px 10px; border: 1px solid #CBD5E1;
  border-radius: 8px; font-size: 14px; outline: none; box-sizing: border-box;
}
.cti-lady-field input:focus,
.cti-lady-field textarea:focus { border-color: #3B82F6; }
.cti-lady-field textarea { resize: vertical; min-height: 72px; }
.cti-lady-checkbox-row {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.cti-lady-checkbox-row label {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 400; color: #374151; cursor: pointer;
}
.cti-lady-modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
}

/* ── Call Popup（ドラッグ可能フローティング） ── */
.cti-call-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;  /* 背面クリックを通す */
  z-index: 9999;
}
.cti-call-popup {
  position: fixed;
  top: 80px;
  right: 24px;
  pointer-events: auto;
  background: #fff;
  border-radius: 14px;
  padding: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  overflow: hidden;
  animation: slideIn 0.2s;
  user-select: none;
}
@keyframes slideIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cti-call-popup-header {
  background: #1E3A5F;
  color: #fff;
  padding: 14px 16px;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  touch-action: none;
}
.cti-call-popup-header.dragging { cursor: grabbing; }
.cti-call-popup-header > div:first-child { flex: 1; min-width: 0; }
.cti-call-popup-close {
  background: transparent;
  border: none;
  color: #93C5FD;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}
.cti-call-popup-close:hover { color: #fff; }
.cti-call-popup-header .call-icon { font-size: 20px; margin-right: 8px; }
.cti-call-popup-header .call-label { font-size: 14px; color: #93C5FD; }
.cti-call-popup-header .call-number { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: 1px; }
.cti-call-popup-body { padding: 20px; }
.cti-call-customer-info {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.cti-call-customer-info.is-blocked { background: #FEF2F2; border-color: #FECACA; }
.cti-call-customer-info .cust-name-row { display: flex; align-items: center; gap: 8px; }
.cti-call-customer-info .cust-name { font-size: 18px; font-weight: 700; color: #166534; flex: 1; }
.cti-call-customer-info.is-blocked .cust-name { color: #991B1B; }
.cti-call-customer-info .cust-stats { font-size: 13px; color: #6B7280; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cti-call-customer-info .cust-first-visit { font-size: 11px; color: #94A3B8; }
.cti-call-customer-info .cust-memo { font-size: 13px; color: #374151; margin-top: 8px; padding-top: 8px; border-top: 1px solid #D1FAE5; }

/* Rank バッジ */
.cust-rank {
  display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700; text-align: center;
  background: #E5E7EB; color: #374151;
}
.cust-rank.rank-VIP { background: #FEF3C7; color: #B45309; }
.cust-rank.rank-A   { background: #DBEAFE; color: #1D4ED8; }
.cust-rank.rank-B   { background: #E0E7FF; color: #4338CA; }
.cust-rank.rank-C   { background: #F1F5F9; color: #475569; }
.cust-rank.rank-NG  { background: #FEE2E2; color: #B91C1C; }

/* Tags チップ */
.cti-call-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.cti-call-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: #EFF6FF; color: #1D4ED8;
}

/* Blocked バナー */
.cti-call-blocked {
  background: #DC2626; color: #fff; font-weight: 700;
  padding: 10px 14px; border-radius: 10px;
  margin-bottom: 10px; font-size: 14px; text-align: center;
}
.cti-call-new-customer {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.cti-call-new-customer .new-label { font-size: 14px; font-weight: 700; color: #92400E; margin-bottom: 8px; }
.cti-call-new-customer input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 8px;
}
.cti-call-new-customer input:focus { outline: none; border-color: #F59E0B; }
.cti-call-actions {
  display: flex;
  gap: 8px;
}
.cti-call-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.cti-call-btn-register { background: #F59E0B; color: #fff; }
.cti-call-btn-register:hover { background: #D97706; }
.cti-call-btn-close { background: #F3F4F6; color: #374151; }
.cti-call-btn-close:hover { background: #E5E7EB; }

/* ── Calendar ── */
.cti-calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cti-calendar-header .month-label {
  font-size: 18px;
  font-weight: 700;
  color: #1E3A5F;
  min-width: 140px;
  text-align: center;
}
.cti-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cti-cal-dow {
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #6B7280;
  background: #F9FAFB;
}
.cti-cal-dow.sun { color: #DC2626; }
.cti-cal-dow.sat { color: #2563EB; }
.cti-cal-cell {
  min-height: 80px;
  padding: 4px;
  border: 1px solid #F3F4F6;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.cti-cal-cell:hover { background: #EFF6FF; }
.cti-cal-cell.other-month { background: #F9FAFB; }
.cti-cal-cell.today { background: #DBEAFE; }
.cti-cal-cell .day-num {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
}
.cti-cal-cell.other-month .day-num { color: #D1D5DB; }
.cti-cal-cell.sun .day-num { color: #DC2626; }
.cti-cal-cell.sat .day-num { color: #2563EB; }
.cti-cal-shift {
  font-size: 10px;
  line-height: 1.3;
  color: #1E3A5F;
  background: #EFF6FF;
  border-radius: 3px;
  padding: 1px 3px;
  margin-bottom: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cti-cal-more {
  font-size: 10px;
  color: #6B7280;
  text-align: center;
}

/* ── 着信履歴テーブル ── */
.cti-call-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.cti-call-table th {
  background: #1E293B; color: #94A3B8;
  padding: 8px 12px; text-align: left; font-weight: 500;
  border-bottom: 1px solid #334155; white-space: nowrap;
}
.cti-call-table td {
  padding: 10px 12px; border-bottom: 1px solid #1E293B;
  color: #E2E8F0; vertical-align: middle;
}
.cti-call-table tr:hover td { background: #1E293B44; }
.cti-call-source-badge {
  display: inline-block; padding: 2px 8px; border-radius: 9999px;
  font-size: 11px; font-weight: 600;
}
.cti-call-source-badge.twilio  { background: #EF444422; color: #EF4444; }
.cti-call-source-badge.manual  { background: #6B728022; color: #9CA3AF; }
.cti-cb-btn {
  padding: 3px 10px; border-radius: 6px; border: 1px solid;
  font-size: 11px; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.cti-cb-none    { background: transparent; border-color: #F59E0B; color: #F59E0B; }
.cti-cb-pending { background: #F59E0B22; border-color: #F59E0B; color: #F59E0B; }
.cti-cb-done    { background: #10B98122; border-color: #10B981; color: #10B981; }

/* ── 手動着信モーダル（ダーク） ── */
.cti-manual-modal-overlay {
  position: fixed; inset: 0; background: #00000088;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.cti-manual-modal-overlay .cti-modal {
  background: #1E293B; border: 1px solid #334155;
  border-radius: 12px; padding: 24px; width: 380px; max-width: 90vw;
  color: #F1F5F9;
}
.cti-manual-modal-overlay .cti-modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: #F1F5F9; }
.cti-manual-modal-overlay .cti-modal label { display: block; font-size: 12px; color: #94A3B8; margin-bottom: 4px; }
.cti-manual-modal-overlay .cti-modal input,
.cti-manual-modal-overlay .cti-modal textarea {
  width: 100%; box-sizing: border-box;
  background: #0F172A; border: 1px solid #334155; border-radius: 6px;
  color: #F1F5F9; padding: 8px 10px; font-size: 13px; margin-bottom: 12px;
}
.cti-manual-modal-overlay .cti-modal textarea { resize: vertical; min-height: 70px; }
.cti-modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.cti-modal-btns button {
  padding: 8px 18px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; border: none;
}
.btn-cancel { background: #334155; color: #94A3B8; }
.btn-submit { background: #3B82F6; color: #fff; }
