@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --blush-pale: #FBEDEE;
  --blush-light: #F3D4D8;
  --rose-deep: #A44A5C;
  --rose-mid: #C97B8A;
  --ink: #2B2226;
  --ink-soft: #6B5A5E;
  --cream: #FFFBF9;
  --line: #E9D6D9;
  --success: #6B8F71;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(164, 74, 92, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

header.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

header.top .display {
  font-size: 28px;
  color: var(--rose-deep);
}

.admin-link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-soft);
}

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.date-nav button {
  background: var(--blush-pale);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  color: var(--rose-deep);
  transition: background 0.15s;
}
.date-nav button:hover { background: var(--blush-light); }

.date-nav .current-date {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  text-align: center;
}
.date-nav .current-date small {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legend {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.free { background: var(--blush-light); }
.dot.busy { background: var(--rose-deep); }

.day-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.slot-cell {
  height: 34px;
  border-radius: 8px;
  background: var(--blush-light);
  position: relative;
}
.slot-cell.busy {
  background: var(--rose-deep);
}
.slot-cell.selectable {
  background: var(--blush-light);
  cursor: pointer;
  border: 1.5px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--rose-deep);
  transition: transform 0.1s, border-color 0.15s;
}
.slot-cell.selectable:hover { border-color: var(--rose-deep); }
.slot-cell.selected {
  background: var(--rose-deep);
  color: white;
  border-color: var(--rose-deep);
}

.empty-note {
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
  padding: 20px 0;
}

button.primary {
  width: 100%;
  background: var(--rose-deep);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  transition: opacity 0.15s;
}
button.primary:disabled {
  background: var(--blush-light);
  color: var(--ink-soft);
  cursor: not-allowed;
}
button.primary:not(:disabled):hover { opacity: 0.92; }

button.secondary {
  background: var(--blush-pale);
  color: var(--rose-deep);
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 15px;
  font-family: 'Manrope', sans-serif;
  background: white;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--rose-mid);
}

.procedure-search {
  position: relative;
}
.procedure-list {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.procedure-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.procedure-item:last-child { border-bottom: none; }
.procedure-item:hover { background: var(--blush-pale); }
.procedure-item input { width: auto; }
.procedure-item .dur {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip {
  background: var(--blush-pale);
  color: var(--rose-deep);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip button {
  background: none;
  border: none;
  color: var(--rose-deep);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.total-duration {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 34, 38, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}
.modal {
  background: white;
  border-radius: 18px 18px 0 0;
  padding: 26px 22px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
}
@media (min-width: 640px) {
  .modal { border-radius: 18px; }
}
.modal h2 { font-size: 22px; color: var(--rose-deep); margin-bottom: 18px; }

.error-box {
  background: #FBE7E7;
  color: #A33;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
}

.success-box {
  text-align: center;
  padding: 10px 0 6px;
}
.success-box .checkmark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}
.calendar-add-buttons {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.calendar-add-buttons a {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: var(--blush-pale);
  color: var(--rose-deep);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.close-x {
  float: right;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-soft);
}
