/* Shared appointment/surgery calendar (KysCalendar.js). */
.kc-root {
  --kc-line: #e3e9eb; --kc-line-strong: #cfd9dd; --kc-text: #1f2d33; --kc-muted: #6b7c84; --kc-bg: #fff; --kc-soft: #f3f6f7;
  --kc-accent: #1a73e8; --kc-accent-soft: rgba(26, 115, 232, .12); --kc-now: #ea4335; --kc-gutter: 56px;
  position: relative; display: flex; flex-direction: column; flex: 1 1 auto; gap: 12px; min-width: 0; min-height: 0;
  color: var(--kc-text); font-family: Manrope, system-ui, sans-serif;
}
.kc-root.kc-surgery { --kc-accent: #c62828; --kc-accent-soft: rgba(198, 40, 40, .1); }
.dark .kc-root {
  --kc-line: #334045; --kc-line-strong: #46565c; --kc-text: #e6eef1; --kc-muted: #9cb0b7; --kc-bg: #1c1c1e; --kc-soft: #262f33;
  --kc-accent: #8ab4f8; --kc-accent-soft: rgba(138, 180, 248, .16);
}
.dark .kc-root.kc-surgery { --kc-accent: #f28b82; --kc-accent-soft: rgba(242, 139, 130, .16); }
.kc-root button { font: inherit; color: inherit; }
.kc-root :is(button, [role="button"]):focus-visible { outline: 2px solid var(--kc-accent); outline-offset: 2px; }
html.kc-dragging, html.kc-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }

/* Toolbar */
.kc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; flex-shrink: 0; min-width: 0; }
.kc-toolbar-nav { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.kc-btn { height: 36px; padding: 0 16px; border: 1px solid var(--kc-line-strong); border-radius: 999px; background: var(--kc-bg); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s; }
.kc-btn:hover { background: var(--kc-soft); }
.kc-nav-arrows { display: inline-flex; gap: 2px; flex-shrink: 0; }
.kc-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--kc-muted) !important; cursor: pointer; flex-shrink: 0; }
.kc-icon-btn:hover { background: var(--kc-soft); color: var(--kc-text) !important; }
.kc-title-wrap { position: relative; min-width: 0; }
.kc-title { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; font-size: 20px !important; font-weight: 600; letter-spacing: -.01em; cursor: pointer; }
.kc-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-title svg { flex-shrink: 0; color: var(--kc-muted); }
.kc-title:hover { background: var(--kc-soft); }
.kc-views { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--kc-soft); flex-shrink: 0; }
.kc-view-btn { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--kc-muted) !important; font-size: 13px !important; font-weight: 600; white-space: nowrap; cursor: pointer; }
.kc-view-btn:hover { color: var(--kc-text) !important; }
.kc-view-btn.is-active { background: var(--kc-bg); color: var(--kc-text) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Mini month picker */
.kc-mini { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 292px; padding: 12px; border: 1px solid var(--kc-line); border-radius: 16px; background: var(--kc-bg); box-shadow: 0 12px 32px rgba(15, 30, 36, .18); }
.kc-mini-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px 6px; font-size: 14px; }
.kc-mini-head > div { display: flex; }
.kc-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.kc-mini-weekday { text-align: center; font-size: 11px; font-weight: 600; color: var(--kc-muted); padding: 4px 0; }
.kc-mini-day { position: relative; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 13px !important; font-variant-numeric: tabular-nums; cursor: pointer; }
.kc-mini-day:hover { background: var(--kc-soft); }
.kc-mini-day.is-outside { color: var(--kc-muted) !important; opacity: .7; }
.kc-mini-day.is-today { color: var(--kc-accent) !important; font-weight: 800; }
.kc-mini-day.is-selected { background: var(--kc-accent); color: #fff !important; font-weight: 700; }
.dark .kc-mini-day.is-selected { color: #202124 !important; }
.kc-mini-day.has-events::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .55; }
.kc-mini-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 8px 4px 0; border-top: 1px solid var(--kc-line); font-size: 11px; color: var(--kc-muted); }
.kc-link-btn { border: 0; background: none; color: var(--kc-accent) !important; font-weight: 700; font-size: 13px !important; cursor: pointer; padding: 4px; }

/* Body */
.kc-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; }

/* Day and week time grid */
.kc-time { position: relative; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; border: 1px solid var(--kc-line); border-radius: 14px; background: var(--kc-bg); overscroll-behavior: contain; scrollbar-width: thin; }
.kc-time-head { position: sticky; top: 0; z-index: 30; display: grid; border-bottom: 1px solid var(--kc-line); background: var(--kc-bg); }
.kc-gutter-head { display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 8px 8px 0; font-size: 10px; color: var(--kc-muted); }
.kc-col-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 8px; border: 0; border-left: 1px solid transparent; background: transparent; cursor: pointer; min-width: 0; }
.kc-col-head span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--kc-muted); }
.kc-col-head strong { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kc-col-head:hover strong { background: var(--kc-soft); }
.kc-col-head.is-today span { color: var(--kc-accent); }
.kc-col-head.is-today strong { background: var(--kc-accent); color: #fff; }
.dark .kc-col-head.is-today strong { color: #202124; }
.kc-col-head.is-past strong { color: var(--kc-muted); }
.kc-col-head small { position: absolute; top: 8px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--kc-accent-soft); color: var(--kc-accent); font-size: 10px; font-weight: 800; line-height: 18px; }
.kc-time-body { position: relative; display: grid; }
.kc-gutter { position: relative; }
.kc-gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--kc-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-col { position: relative; min-width: 0; border-left: 1px solid var(--kc-line); cursor: default;
  background-image: linear-gradient(to bottom, var(--kc-line) 1px, transparent 1px), linear-gradient(to bottom, transparent calc(var(--kc-hour) / 2), color-mix(in srgb, var(--kc-line) 45%, transparent) calc(var(--kc-hour) / 2), color-mix(in srgb, var(--kc-line) 45%, transparent) calc(var(--kc-hour) / 2 + 1px), transparent calc(var(--kc-hour) / 2 + 1px));
  background-size: 100% var(--kc-hour); }
.kc-col.is-past { background-color: color-mix(in srgb, var(--kc-soft) 45%, transparent); }
.kc-event { position: absolute; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 3px 7px; overflow: hidden; border-radius: 6px; box-shadow: 0 0 0 1px var(--kc-bg); font-size: 12px; line-height: 15px; text-align: left; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: box-shadow .12s, opacity .12s; }
.kc-event.is-editable { cursor: grab; }
.kc-event:hover { box-shadow: 0 0 0 1px var(--kc-bg), 0 4px 12px rgba(0, 0, 0, .2); z-index: 28 !important; }
.kc-event:focus-visible { z-index: 29 !important; outline: 2px solid var(--kc-text) !important; }
.kc-event.is-compact { flex-direction: row; align-items: center; padding: 0 7px; }
.kc-event-line { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-event-line strong { font-weight: 700; }
.kc-event-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.kc-event-time { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; opacity: .92; font-variant-numeric: tabular-nums; }
.kc-event-name, .kc-event-time { flex-shrink: 0; }
.kc-event-note { display: block; flex: 0 1 auto; min-height: 0; overflow: hidden; font-size: 11px; opacity: .85; overflow-wrap: anywhere; }
.kc-event.is-past, .kc-chip.is-past, .kc-agenda-item.is-past { opacity: .72; }
.kc-event.is-not-attended { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .22) 0 5px, transparent 5px 10px); }
.kc-event.is-not-attended .kc-event-name, .kc-event.is-not-attended .kc-event-line strong, .kc-chip.is-not-attended .kc-chip-name { text-decoration: line-through; }
.kc-event.is-dragging { opacity: .35; }
.kc-event.kc-ghost { left: 2px; right: 8px; z-index: 40; pointer-events: none; box-shadow: 0 10px 24px rgba(0, 0, 0, .28); opacity: .95; }
.kc-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.kc-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .12s; }
.kc-event:hover .kc-resize::after, .kc-event:focus-visible .kc-resize::after { opacity: .55; }
.kc-selection { position: absolute; left: 2px; right: 8px; z-index: 35; padding: 3px 7px; border: 1px solid var(--kc-accent); border-radius: 6px; background: var(--kc-accent-soft); color: var(--kc-accent); font-size: 12px; font-weight: 700; pointer-events: none; overflow: hidden; }
.kc-now { position: absolute; left: -1px; right: 0; z-index: 27; height: 2px; background: var(--kc-now); pointer-events: none; }
.kc-now::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--kc-now); }

/* Month */
.kc-month { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; border: 1px solid var(--kc-line); border-radius: 14px; background: var(--kc-bg); }
.kc-month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); flex-shrink: 0; }
.kc-month-head span { padding: 8px 4px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--kc-muted); }
.kc-month-body { display: grid; flex: 1 1 0; min-height: 0; grid-template-rows: repeat(var(--kc-weeks), minmax(0, 1fr)); }
.kc-month-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 0; border-top: 1px solid var(--kc-line); }
.kc-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 0; padding: 4px 4px 3px; overflow: hidden; border-left: 1px solid var(--kc-line); cursor: pointer; }
.kc-cell:first-child { border-left: 0; }
.kc-cell:hover { background: color-mix(in srgb, var(--kc-soft) 60%, transparent); }
.kc-cell.is-outside { background: color-mix(in srgb, var(--kc-soft) 55%, transparent); }
.kc-cell.is-outside .kc-cell-date { color: var(--kc-muted); }
.kc-cell-date { align-self: center; flex-shrink: 0; min-width: 26px; height: 24px; padding: 0 6px; border: 0; border-radius: 12px; background: transparent; font-size: 12px !important; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.kc-cell-date:hover { background: var(--kc-soft); }
.kc-cell.is-today .kc-cell-date { background: var(--kc-accent); color: #fff !important; }
.dark .kc-cell.is-today .kc-cell-date { color: #202124 !important; }
.kc-cell-events { display: flex; flex-direction: column; gap: 2px; flex: 1 1 0; min-height: 0; overflow: hidden; }
.kc-chip { display: flex; flex-shrink: 0; align-items: center; gap: 5px; width: 100%; height: 20px; padding: 0 6px; overflow: hidden; border-radius: 4px; background: var(--kc-color); color: var(--kc-chip-text, #fff); font-size: 12px; line-height: 20px; white-space: nowrap; cursor: pointer; user-select: none; -webkit-user-select: none; }
.kc-chip.is-editable { cursor: grab; }
.kc-chip:hover { filter: brightness(.92); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.kc-chip i { display: none; }
.kc-chip-time { flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.kc-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.kc-chip.kc-ghost { opacity: .9; pointer-events: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .28); }
.kc-chip.is-not-attended { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .22) 0 5px, transparent 5px 10px); }
.kc-chip.kc-ghost .kc-chip-time { color: inherit; }
.kc-more { flex-shrink: 0; height: 20px; padding: 0 6px; border: 0; border-radius: 5px; background: transparent; font-size: 12px !important; font-weight: 700; text-align: left; cursor: pointer; }
.kc-more:hover { background: var(--kc-soft); }

/* "+N daha" day popover */
.kc-popover { position: fixed; z-index: 70; max-height: 360px; display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--kc-line); border-radius: 14px; background: var(--kc-bg); box-shadow: 0 14px 36px rgba(15, 30, 36, .22); }
.kc-popover-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.kc-popover-date { display: flex; flex-direction: column; align-items: center; margin: 0 auto; padding: 2px 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.kc-popover-date span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--kc-muted); }
.kc-popover-date strong { font-size: 24px; font-weight: 500; }
.kc-popover-date:hover { background: var(--kc-soft); }
.kc-popover-list { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; }

/* Agenda */
.kc-agenda { flex: 1 1 auto; min-height: 0; overflow-y: auto; border: 1px solid var(--kc-line); border-radius: 14px; background: var(--kc-bg); }
.kc-agenda-day { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; padding: 10px 12px; border-top: 1px solid var(--kc-line); }
.kc-agenda-day:first-child { border-top: 0; }
.kc-agenda-date { display: flex; align-items: baseline; gap: 8px; align-self: start; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.kc-agenda-date strong { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kc-agenda-date span { font-size: 12px; font-weight: 600; color: var(--kc-muted); text-transform: uppercase; }
.kc-agenda-date:hover { background: var(--kc-soft); }
.kc-agenda-day.is-today .kc-agenda-date strong, .kc-agenda-day.is-today .kc-agenda-date span { color: var(--kc-accent); }
.kc-agenda-day ul { margin: 0; padding: 0; list-style: none; min-width: 0; }
.kc-agenda-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 8px; width: 100%; padding: 2px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.kc-agenda-item:hover { background: var(--kc-soft); }
.kc-agenda-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--kc-muted); }
.kc-agenda-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kc-agenda-main > * { flex: 1 1 auto; min-width: 0; }
.kc-dot { flex: 0 0 10px !important; width: 10px; height: 10px; border-radius: 50%; }
.kc-agenda-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; flex: 1; padding: 48px 16px; border: 1px dashed var(--kc-line-strong); border-radius: 14px; color: var(--kc-muted); }
.kc-agenda-empty p { margin: 0; }

/* Save / undo feedback */
.kc-snackbar { position: fixed; z-index: 90; left: 50%; bottom: 24px; display: flex; align-items: center; gap: 4px; max-width: min(560px, calc(100vw - 32px)); padding: 6px 6px 6px 16px; border-radius: 10px; background: #202124; color: #f1f3f4; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transform: translateX(-50%); animation: kc-snack-in .18s ease-out; }
.kc-snackbar > span { flex: 1 1 auto; min-width: 0; padding: 6px 4px 6px 0; overflow-wrap: anywhere; }
.kc-snackbar.is-error { background: #8c1d18; }
.kc-snackbar-action { flex-shrink: 0; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: #8ab4f8 !important; font-weight: 800; cursor: pointer; }
.kc-snackbar-action:hover { background: rgba(255, 255, 255, .08); }
.kc-snackbar-close { flex-shrink: 0; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #c4c7c5 !important; cursor: pointer; }
.kc-snackbar-close:hover { background: rgba(255, 255, 255, .08); }
@keyframes kc-snack-in { from { opacity: 0; transform: translate(-50%, 12px); } }
/* Desktop: bottom-left like Google Calendar, over the side navigation instead of the grid. */
.kc-desktop .kc-snackbar { left: 24px; transform: none; animation-name: kc-snack-in-left; }
@keyframes kc-snack-in-left { from { opacity: 0; transform: translateY(12px); } }

/* Desktop pages fill the available height, so month weeks and the time grid fit without page scroll. */
@media (min-width: 1024px) {
  main > .max-w-screen-2xl:has(.kc-root.kc-desktop) { height: 100%; min-height: 0; }
  .kc-root.kc-desktop.calendar-view-month { min-height: 0 !important; }
}
@media (min-width: 1024px) and (max-height: 800px) {
  .kc-desktop .kc-cell-date { height: 22px; }
  .kc-desktop .kc-month-head span { padding: 6px 4px; }
  .kc-desktop .kc-col-head strong { width: 34px; height: 34px; font-size: 19px; }
}
@media (min-width: 1024px) and (max-height: 650px) {
  .page-container-mobile:has(.kc-root.kc-desktop) { min-height: 620px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .kc-title { font-size: 17px !important; }
  .kc-view-btn { padding: 0 10px; }
}

/* Phones and small tablets */
.kc-root.kc-mobile { --kc-gutter: 46px; gap: 10px; }
.kc-mobile .kc-body { overflow-y: auto; overflow-x: hidden; }
.kc-mobile .kc-toolbar { gap: 8px; }
.kc-mobile .kc-toolbar-nav { flex: 1 1 100%; gap: 4px; }
.kc-mobile .kc-btn { height: 40px; padding: 0 12px; font-size: 13px; }
.kc-mobile .kc-icon-btn { width: 40px; height: 40px; }
.kc-mobile .kc-title { height: 40px; padding: 0 6px; font-size: 16px !important; }
.kc-mobile .kc-title-wrap { flex: 1 1 auto; }
.kc-mobile .kc-views { flex: 1 1 100%; justify-content: space-between; }
.kc-mobile .kc-view-btn { flex: 1 1 0; min-width: 0; height: 34px; padding: 0 4px; }
.kc-mobile .kc-mini { width: min(292px, calc(100vw - 32px)); }
.kc-mobile-day { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kc-mobile-hint { margin: 0; padding: 0 2px; font-size: 12px; color: var(--kc-muted); }
.kc-mobile .kc-time { flex: 0 0 auto; height: max(380px, calc(100dvh - 330px)); }
.kc-mobile .kc-col-head { flex-direction: row; justify-content: center; gap: 8px; padding: 6px 2px; }
.kc-mobile .kc-col-head strong { width: 34px; height: 34px; font-size: 18px; }
.kc-mobile .kc-event { font-size: 13px; line-height: 16px; }
.kc-mobile .kc-snackbar { bottom: calc(92px + env(safe-area-inset-bottom)); }
@media (max-width: 360px) {
  .kc-mobile .kc-btn { padding: 0 10px; }
  .kc-mobile .kc-icon-btn { width: 36px; }
  .kc-mobile .kc-title { font-size: 15px !important; }
  .kc-mobile .kc-view-btn { font-size: 12px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .kc-snackbar { animation: none; }
  .kc-event { transition: none; }
}
