/* ==========================================================================
   WINDOWS 11 DARK THEME - SCHEDULE TABLE WITH CALL BUTTON & CONTACTS
   Clean, Direct Input Fields, Native Datalist & Excel-Style Selection Autocomplete
   ========================================================================== */

:root {
  --win-bg: #181818;
  --win-surface: #202020;
  --win-surface-hover: #2a2a2a;
  --win-surface-active: #323232;
  --win-border: #333333;
  --win-border-focus: #60cdff;
  
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #7f7f7f;

  --font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--win-bg);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.4;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Windows 11 Titlebar */
.win-header {
  position: sticky;
  top: 0;
  height: 52px;
  background: rgba(24, 24, 24, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--win-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
}

.app-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.date-navigator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn, .today-btn {
  background: var(--win-surface);
  border: 1px solid var(--win-border);
  color: var(--text-primary);
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-btn:hover, .today-btn:hover {
  background: var(--win-surface-hover);
  border-color: #4a4a4a;
}

#current-date-picker {
  background: var(--win-surface);
  border: 1px solid var(--win-border);
  color: var(--text-primary);
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

#current-date-picker:focus {
  border-color: var(--win-border-focus);
}

.save-indicator {
  font-size: 12px;
  color: var(--text-muted);
}

/* Schedule Pages */
.schedule-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.schedule-page {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: 40px;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--win-border);
}

.page-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.page-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0 40px;
  position: relative;
}

.page-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--win-border);
  z-index: 1;
}

.page-divider span {
  background: var(--win-bg);
  padding: 4px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  z-index: 2;
  border: 1px solid var(--win-border);
  border-radius: 12px;
}

/* Table Design */
.table-wrapper {
  border: 1px solid var(--win-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--win-surface);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-table th {
  background: #252525;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--win-border);
  border-right: 1px solid var(--win-border);
  user-select: none;
}

.schedule-table th:last-child {
  border-right: none;
}

.col-time {
  width: 85px;
  text-align: center !important;
}

.col-price {
  width: 110px;
}

.col-call {
  width: 75px;
  text-align: center !important;
}

.schedule-table td {
  padding: 0;
  border-bottom: 1px solid var(--win-border);
  border-right: 1px solid var(--win-border);
  height: 48px;
  vertical-align: middle;
}

.schedule-table td:last-child {
  border-right: none;
}

.schedule-table tr:last-child td {
  border-bottom: none;
}

.schedule-table tbody tr:hover {
  background-color: var(--win-surface-hover);
}

.cell-time {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #1c1c1c;
  user-select: none;
}

/* Directly Editable Input Cells */
.autocomplete-cell {
  position: relative;
  width: 100%;
  height: 48px;
}

.cell-input {
  width: 100%;
  height: 48px;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 16px;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-primary);
  caret-color: var(--text-primary);
}

.cell-input:focus {
  background: var(--win-surface-active);
  box-shadow: inset 0 0 0 2px var(--win-border-focus);
}

.cell-input::placeholder {
  color: #555555;
}

.price-input {
  text-align: left;
}

/* Call Button in Table */
.cell-call-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.btn-call {
  background: #282828;
  border: 1px solid var(--win-border);
  color: #60cdff;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-call:hover {
  background: #333333;
  border-color: #60cdff;
  color: #ffffff;
}

.btn-call:active {
  transform: scale(0.96);
}

/* ==================== WINDOWS 11 MODAL OVERLAY ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-box {
  background: #222222;
  border: 1px solid #444444;
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--win-border);
  background: #282828;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.phone-input-wrapper {
  display: flex;
  gap: 8px;
}

#modal-phone-input {
  flex: 1;
  background: #181818;
  border: 1px solid var(--win-border);
  color: var(--text-primary);
  height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
}

#modal-phone-input:focus {
  border-color: var(--win-border-focus);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #1c1c1c;
  border-top: 1px solid var(--win-border);
}

.win-btn-secondary {
  background: #2a2a2a;
  border: 1px solid var(--win-border);
  color: var(--text-primary);
  height: 34px;
  padding: 0 16px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.win-btn-secondary:hover {
  background: #353535;
}

.win-btn-primary {
  background: #0067c0;
  border: 1px solid #0078d4;
  color: #ffffff;
  height: 34px;
  padding: 0 18px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.win-btn-primary:hover {
  background: #0078d4;
}

@media (max-width: 600px) {
  .win-header { padding: 0 12px; }
  .app-title { display: none; }
  .schedule-container { padding: 16px 12px 40px; }
  .col-time { width: 65px; }
  .col-price { width: 85px; }
  .col-call { width: 65px; }
  .cell-input { padding: 0 10px; }
  .btn-call { padding: 0 8px; font-size: 11px; }
}
