﻿@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap");

:root {
  --bg: #f4f8ff;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --text: #141b2f;
  --muted: #60708f;
  --line: #d6ddee;
  --brand: #0d6efd;
  --brand-soft: #dcedff;
  --brand-strong: #0b4bb2;
  --danger: #c53030;
  --danger-soft: #fff0f0;
  --time-col: 78px;
  --day-width: 238px;
  --radius: 18px;
  --slot-size: 15px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Avenir Next", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at 12% 14%, #dcecff 0%, rgba(220, 236, 255, 0) 40%),
    radial-gradient(circle at 87% 10%, #e9e4ff 0%, rgba(233, 228, 255, 0) 35%),
    var(--bg);
  color: var(--text);
  position: relative;
  padding: 28px;
}

.app-notice {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 42;
  max-width: min(760px, calc(100vw - 28px));
  width: fit-content;
  border-radius: 12px;
  border: 1px solid #c8d6ef;
  background: rgba(255, 255, 255, 0.96);
  color: #274574;
  box-shadow: 0 14px 30px -20px rgba(10, 37, 84, 0.52);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -10px);
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 0ms linear 220ms;
}

.app-notice.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0ms;
}

.bg-orb {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(65px);
  opacity: 0.35;
  pointer-events: none;
}

.bg-orb-left {
  background: #72b7ff;
  left: -90px;
  top: 45%;
}

.bg-orb-right {
  background: #7de2cc;
  right: -70px;
  top: 6%;
}

.app-shell {
  max-width: calc(var(--time-col) + 7 * var(--day-width));
  margin: 0 auto;
  display: grid;
  gap: 26px;
  animation: app-enter 320ms ease-out;
}

.login-shell {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: app-enter 320ms ease-out;
}

.login-card {
  width: min(460px, 100%);
  border: 1px solid rgba(184, 197, 224, 0.75);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow:
    0 24px 44px -34px rgba(8, 35, 91, 0.48),
    0 12px 24px -20px rgba(14, 38, 78, 0.22);
  padding: 22px;
}

.login-copy {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 8px 0 0;
}

.login-form {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.login-form label {
  font-size: 0.85rem;
  color: #304461;
  display: grid;
  gap: 6px;
}

.login-form input {
  width: 100%;
  border-radius: 11px;
  border: 1px solid #d3dcee;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  color: #1f2f4d;
  background: #fff;
}

.login-form input:focus {
  outline: 2px solid rgba(17, 113, 255, 0.24);
  border-color: #8cb8ff;
}

.login-btn {
  justify-self: start;
}

.login-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--brand-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.72rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
}

h1 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.93rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.ghost {
  background: #fff;
  border-color: #cfd9ec;
  color: #2c3a54;
}

.btn.primary {
  background: linear-gradient(130deg, var(--brand), #2688ff);
  color: #fff;
  box-shadow: 0 10px 24px -14px #226ce7;
}

.btn.danger {
  background: var(--danger-soft);
  border-color: #ffd7d7;
  color: var(--danger);
}

.calendar-select {
  min-width: 168px;
  border-radius: 12px;
  border: 1px solid #cfd9ec;
  background: #fff;
  padding: 10px 36px 10px 12px;
  color: #2c3a54;
  font: inherit;
  font-size: 0.93rem;
}

.user-pill {
  background: #fff;
  border-color: #cfd9ec;
  color: #2c3a54;
  font-weight: 400;
}

.user-pill.is-disabled {
  opacity: 1;
  cursor: default;
}

.user-pill:disabled {
  opacity: 1;
  pointer-events: none;
}

.calendar-card {
  border: 1px solid rgba(184, 197, 224, 0.75);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow:
    0 24px 44px -34px rgba(8, 35, 91, 0.48),
    0 12px 24px -20px rgba(14, 38, 78, 0.22);
  overflow: hidden;
  max-width: calc(var(--time-col) + 7 * var(--day-width));
  width: 100%;
  justify-self: center;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.week-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.week-jump-date {
  min-width: 152px;
  border-radius: 12px;
  border: 1px solid #cfd9ec;
  background: #fff;
  padding: 9px 12px;
  color: #2c3a54;
  font: inherit;
  font-size: 0.93rem;
}

.week-jump-date:focus {
  outline: none;
  border-color: #89b8ff;
  box-shadow: 0 0 0 3px rgba(72, 128, 217, 0.2);
}

.calendar-wrap {
  display: grid;
  grid-template-rows: auto 1fr;
}

.header-scroll {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.header-scroll::-webkit-scrollbar {
  display: none;
}

.day-header-row {
  display: grid;
  grid-template-columns: var(--time-col) repeat(7, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
}

.day-header {
  padding: 12px 10px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.day-header strong {
  display: block;
  font-size: 0.9rem;
}

.day-header span {
  color: var(--muted);
  font-size: 0.8rem;
}

.day-header.weekend {
  background: rgba(242, 245, 250, 0.92);
}

.day-header.holiday {
  background: rgba(242, 245, 250, 0.92);
}

.day-header.today {
  background: linear-gradient(180deg, var(--brand-soft), rgba(255, 255, 255, 0.9));
}

.day-header.holiday.today {
  background: rgba(242, 245, 250, 0.92);
}

.corner {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: var(--panel-solid);
  border-right: 0;
}

.corner-week {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.body-scroll {
  overflow-y: auto;
  overflow-x: hidden;
}

.body-grid {
  display: grid;
  grid-template-columns: var(--time-col) 1fr;
  min-width: 0;
  width: 100%;
}

.time-column {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--panel-solid);
  border-right: 0;
  min-height: 100%;
}

.time-column-inner {
  position: relative;
}

.time-label {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.76rem;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.day-column {
  position: relative;
  border-left: 1px solid var(--line);
  background-clip: padding-box;
  --day-shade-start: rgba(255, 255, 255, 0.75);
  --day-shade-end: rgba(252, 254, 255, 0.95);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(117, 139, 186, 0.16) 0,
      rgba(117, 139, 186, 0.16) 1px,
      transparent 1px,
      transparent var(--half-hour-size, 30px)
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(117, 139, 186, 0.28) 0,
      rgba(117, 139, 186, 0.28) 1px,
      transparent 1px,
      transparent var(--hour-size, 60px)
    ),
    linear-gradient(180deg, var(--day-shade-start), var(--day-shade-end));
  background-position:
    0 0,
    0 var(--hour-line-offset, 0px),
    0 0;
}

.day-column.day-column--weekend {
  --day-shade-start: rgba(244, 246, 250, 0.88);
  --day-shade-end: rgba(237, 242, 248, 0.94);
}

.day-column.day-column--holiday {
  --day-shade-start: rgba(244, 246, 250, 0.88);
  --day-shade-end: rgba(237, 242, 248, 0.94);
}

.day-column::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: var(--lunch-top, 330px);
  height: var(--lunch-height, 60px);
  background: rgba(130, 139, 156, 0.12);
  border-top: 1px solid rgba(130, 139, 156, 0.22);
  border-bottom: 1px solid rgba(130, 139, 156, 0.22);
  pointer-events: none;
}

.day-holiday-chip {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 4px;
  border-radius: 10px;
  border: 1px solid #c9d4e5;
  background: linear-gradient(150deg, #edf2f9, #f7fafe);
  color: #3d4f6e;
  box-shadow: 0 8px 14px -14px rgba(15, 50, 102, 0.65);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  padding: 4px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 3;
}

.selection-draft {
  position: absolute;
  left: 5px;
  right: 5px;
  border-radius: 10px;
  border: 1px dashed #4b8ef7;
  background: rgba(75, 142, 247, 0.2);
  pointer-events: none;
}

.event-card {
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 11px;
  padding: 7px 8px;
  border: 1px solid #d3dcee;
  background: #f5f8ff;
  color: #233754;
  box-shadow: 0 10px 20px -16px rgba(20, 55, 108, 0.35);
  cursor: pointer;
  overflow: hidden;
}

.event-card.event-card-resizable {
  touch-action: none;
}

.event-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 2;
}

.event-resize-handle::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 50%;
  transform: translateY(-50%);
  border-top: 1px solid rgba(43, 66, 105, 0.34);
}

.event-resize-handle-top {
  top: 0;
  cursor: n-resize;
}

.event-resize-handle-bottom {
  bottom: 0;
  cursor: s-resize;
}

.event-card.event-card-resizable:hover .event-resize-handle,
.event-card.event-card-resizable:focus-visible .event-resize-handle,
.event-card.dragging .event-resize-handle,
.event-card.resizing .event-resize-handle {
  opacity: 1;
}

.event-card-public {
  cursor: default;
}

.event-card--blue {
  border-color: #b8d7ff;
  background: linear-gradient(150deg, #dff0ff, #f5faff);
}

.event-card--green {
  border-color: #b6e2ca;
  background: linear-gradient(150deg, #dcf8e8, #f4fff8);
}

.event-card--yellow {
  border-color: #efdca2;
  background: linear-gradient(150deg, #fff7d6, #fffdf1);
}

.event-card--orange {
  border-color: #f0c9a7;
  background: linear-gradient(150deg, #ffe9d9, #fff8f2);
}

.event-card--red {
  border-color: #f0bcc1;
  background: linear-gradient(150deg, #ffe3e5, #fff6f6);
}

.event-card--gray {
  border-color: #d4d9e3;
  background: linear-gradient(150deg, #edf1f7, #f8faff);
}

.event-card.dragging {
  opacity: 0.85;
  border-color: #9fb3d4;
  box-shadow: 0 14px 26px -16px #0d5bd1;
  z-index: 5;
}

.event-card.resizing {
  cursor: ns-resize;
}

.event-title {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.event-series-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 6px;
  background: rgba(47, 69, 103, 0.14);
  color: #2b4269;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-meta {
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: #314b71;
  line-height: 1.25;
  white-space: pre-line;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 21, 41, 0.44);
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(540px, 100%);
  background: #fff;
  border: 1px solid #d5dced;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 24px 54px -34px rgba(8, 35, 91, 0.75);
  animation: modal-in 180ms ease-out;
}

.account-panel {
  width: min(460px, 100%);
}

.disclaimer-panel {
  border-color: #efb6ba;
  background: linear-gradient(180deg, #fff1f2, #ffe8ea);
  box-shadow: 0 24px 54px -34px rgba(137, 32, 45, 0.65);
}

.disclaimer-panel h3 {
  color: #8d2430;
}

.disclaimer-copy {
  margin: 10px 0 0;
  color: #6d1f28;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.disclaimer-panel .modal-actions {
  margin-top: 14px;
}

.admin-panel {
  width: min(1280px, 96vw);
  min-height: min(78vh, 760px);
  display: flex;
  flex-direction: column;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-head-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-head-left h3 {
  margin: 0;
}

.admin-section-view {
  margin-top: 12px;
}

.admin-menu-view {
  flex: 1;
  display: grid;
  place-content: center;
  gap: 18px;
  padding: 20px 6px;
}

.admin-menu-copy {
  margin: 0;
  text-align: center;
  color: #4d6289;
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-menu-grid {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.admin-menu-btn {
  min-height: 160px;
  border-radius: 16px;
  border: 1px solid #cad8ef;
  background: linear-gradient(180deg, #f8fbff, #eef4ff);
  box-shadow: 0 18px 32px -26px rgba(13, 58, 127, 0.6);
  color: #223b63;
  font: inherit;
  font-weight: 700;
  font-size: 0.97rem;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 16px;
  text-align: center;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.admin-menu-btn:hover {
  transform: translateY(-2px);
  border-color: #abc9f7;
  box-shadow: 0 26px 38px -26px rgba(13, 58, 127, 0.65);
}

.admin-menu-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: #e3eeff;
  display: grid;
  place-items: center;
  color: #1f4f95;
}

.admin-menu-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.admin-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.admin-placeholder {
  flex: 1;
  display: grid;
  place-items: center;
}

.admin-placeholder-card {
  width: min(620px, 100%);
  border: 1px solid #d6ddee;
  border-radius: 14px;
  background: #fbfdff;
  padding: 24px;
  text-align: center;
}

.admin-placeholder-card h4 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
  color: #21365d;
}

.admin-placeholder-card p {
  margin: 10px 0 0;
  color: #4f6285;
  font-size: 0.92rem;
}

.admin-users {
  border: 1px solid #d6ddee;
  border-radius: 12px;
  background: #fbfdff;
  overflow: hidden;
}

.admin-users-scroll {
  height: clamp(240px, 52vh, 520px);
  overflow-y: auto;
}

.admin-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #e3e9f6;
}

.admin-table th {
  background: #f3f8ff;
  color: #39547f;
  font-weight: 700;
}

.admin-table-head-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-table-head-filter span {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-user-search {
  flex: 0 1 120px;
  width: min(120px, 100%);
}

.admin-table th:first-child,
.admin-table td:first-child {
  width: 34%;
  overflow-wrap: anywhere;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 24%;
  overflow-wrap: anywhere;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 16%;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
  width: 26%;
  white-space: nowrap;
}

.admin-table-holidays th:first-child,
.admin-table-holidays td:first-child {
  width: 28%;
}

.admin-table-holidays th:nth-child(2),
.admin-table-holidays td:nth-child(2) {
  width: 48%;
}

.admin-table-holidays th:nth-child(3),
.admin-table-holidays td:nth-child(3) {
  width: 24%;
  white-space: nowrap;
}

.admin-table-rooms th:first-child,
.admin-table-rooms td:first-child {
  width: 30%;
}

.admin-table-rooms th:nth-child(2),
.admin-table-rooms td:nth-child(2) {
  width: 16%;
}

.admin-table-rooms th:nth-child(3),
.admin-table-rooms td:nth-child(3) {
  width: calc(34% - 10px);
}

.admin-table-rooms th:nth-child(4),
.admin-table-rooms td:nth-child(4) {
  width: calc(20% + 10px);
  white-space: nowrap;
}

.admin-table-rooms tr.is-inactive td {
  color: #5f6f8a;
}

.room-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.room-status-badge.is-active {
  border: 1px solid #b6e8c6;
  background: #eafbf0;
  color: #1d6a33;
}

.room-status-badge.is-inactive {
  border: 1px solid #d8dfec;
  background: #f5f7fb;
  color: #506078;
}

.room-shortcut-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.room-shortcut-cell code {
  border-radius: 8px;
  border: 1px solid #cbd9ef;
  background: #f5f8ff;
  padding: 3px 7px;
  color: #264676;
  font-size: 0.78rem;
  font-weight: 700;
}

.room-shortcut-empty {
  color: #6b7d9f;
  font-size: 0.82rem;
}

.room-shortcut-preview {
  border: 1px solid #d5dff0;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  gap: 8px;
  justify-items: start;
}

.room-shortcut-preview-label {
  margin: 0;
  color: #36527e;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.room-shortcut-preview img {
  width: 180px;
  height: 180px;
  border-radius: 10px;
  border: 1px solid #cfdbf0;
  background: #fff;
  object-fit: cover;
}

.admin-table-display-colors th:first-child,
.admin-table-display-colors td:first-child {
  width: 42%;
}

.admin-table-display-colors th:nth-child(2),
.admin-table-display-colors td:nth-child(2) {
  width: 28%;
}

.admin-table-display-colors th:nth-child(3),
.admin-table-display-colors td:nth-child(3) {
  width: 30%;
  white-space: nowrap;
}

.display-color-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.display-color-swatch {
  width: 26px;
  height: 18px;
  border-radius: 8px;
  border: 1px solid #c8d4e8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-form-wrap {
  border: 1px solid #d6ddee;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.admin-form-wrap h4 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
}

.admin-permissions {
  margin-top: 14px;
  border: 1px solid #d6ddee;
  border-radius: 12px;
  background: #fbfdff;
  padding: 12px;
}

.admin-permissions-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.admin-permissions-head h4 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
}

.admin-permissions-head label {
  min-width: min(100%, 260px);
  display: grid;
  gap: 6px;
  color: #314a70;
  font-size: 0.84rem;
}

.admin-permissions-head select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #cfdaee;
  background: #fff;
  padding: 9px 11px;
  font: inherit;
}

.admin-permissions-info {
  margin: 10px 0 0;
  color: #4b628b;
  font-size: 0.82rem;
  min-height: 1.05em;
}

.permission-board {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.permission-column {
  border: 1px solid #d9e3f4;
  border-radius: 11px;
  background: #f9fbff;
  height: clamp(230px, 45vh, 380px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.permission-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid #dee6f4;
}

.permission-column h5 {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.84rem;
  color: #304e7a;
}

.permission-search {
  flex: 0 1 140px;
  width: min(140px, 100%);
  border: 1px solid #cfdaee;
  border-radius: 8px;
  background: #fff;
  color: #314a70;
  font: inherit;
  font-size: 0.76rem;
  padding: 5px 7px;
}

.permission-search::placeholder {
  color: #6a7fa4;
}

.permission-count {
  min-width: 1.9rem;
  border-radius: 999px;
  border: 1px solid #cbdaef;
  background: #f2f7ff;
  color: #2f4f7d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
}

.permission-list {
  padding: 8px;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
}

.permission-column.is-drop-target {
  border-color: #93b6ee;
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px #c5d9f8;
}

.permission-user-card {
  border: 1px solid #d8e2f2;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.permission-user-card:active {
  cursor: grabbing;
}

.permission-user-card.is-admin {
  border-color: #d8e2f2;
  background: #fff;
}

.permission-user-meta strong {
  display: block;
  color: #213b66;
  font-size: 0.84rem;
}

.permission-user-meta span {
  display: block;
  margin-top: 2px;
  color: #516892;
  font-size: 0.77rem;
  overflow-wrap: anywhere;
}

.admin-inline-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.btn.small {
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.event-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.event-form label {
  font-size: 0.85rem;
  color: #304461;
  display: grid;
  gap: 6px;
}

.event-form label.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

.event-form label.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #2457c9;
}

.event-form input,
.event-form textarea,
.event-form select {
  width: 100%;
  border-radius: 11px;
  border: 1px solid #d3dcee;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  color: #1f2f4d;
  background: #fff;
}

.event-form input:focus,
.event-form textarea:focus,
.event-form select:focus {
  outline: 2px solid rgba(17, 113, 255, 0.24);
  border-color: #8cb8ff;
}

.event-form input[readonly] {
  background: #f5f8ff;
  color: #445b83;
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.series-note {
  margin: -2px 0 2px;
  border-radius: 11px;
  border: 1px solid #cdd8ef;
  background: #f6f9ff;
  color: #304a75;
  font-size: 0.79rem;
  padding: 8px 10px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
  min-height: 1.1em;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

.page-footer {
  margin-top: 16px;
  text-align: center;
  color: #4f6285;
  font-size: 0.74rem;
  font-weight: 600;
}

@keyframes app-enter {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes col-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .admin-menu-grid {
    width: min(1080px, 100%);
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --day-width: 180px;
  }

  body {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-menu-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .admin-menu-btn {
    min-height: 140px;
  }

  .permission-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  :root {
    --time-col: 78px;
    --day-width: 160px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .week-nav-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .week-jump-date {
    flex: 1 1 100%;
    min-width: 0;
  }

  .modal-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-permissions-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-panel {
    min-height: min(86vh, 820px);
  }
}


