.shell.is-calendar-view {
  font-family:var(--crm-font);
  color:var(--crm-ink);
  background:var(--crm-bg);
}
.shell.is-calendar-view > .main > .content {
  width:100%; max-width:none; padding:20px 22px 24px; overflow:auto;
  background:radial-gradient(ellipse at 0 3%,rgba(127,116,248,.24),transparent 60%),
    radial-gradient(ellipse at 99% 8%,rgba(60,207,231,.25),transparent 64%),
    radial-gradient(ellipse at 100% 100%,rgba(87,220,241,.26),transparent 54%),#eaf1fc;
}
.shell.is-calendar-view .topbar {
  min-height:44px; height:44px; flex-basis:44px; background:linear-gradient(105deg,#f1f1ff,#ecfaff);
  border-bottom-color:rgba(172,186,219,.48);
}
.shell.is-calendar-view .sidebar { background:linear-gradient(170deg,#fff,#f8f9ff); border-color:#dce2f1; }
.shell.is-calendar-view .nav-item.is-active { background:#ebe2ff; color:var(--crm-indigo); }
.shell.is-calendar-view :is(.co-shell-avatar,.co-rail-user) { background:var(--crm-gradient); color:#fff; }

.rental-calendar { min-width:0; }
.rental-calendar .icon { width:18px; height:18px; flex:none; }
.rental-calendar :is(button,a):focus-visible { outline:2px solid var(--crm-indigo); outline-offset:-2px; box-shadow:var(--crm-focus); }
.cal-heading,.cal-toolbar,.cal-filters { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.cal-heading { margin:0 0 18px; }
.cal-heading h1 { margin:0; font-size:clamp(28px,2.65vw,44px); font-weight:760; line-height:1.16; letter-spacing:-.03em; color:#101735; }
.cal-control {
  min-height:35px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:6px 12px;
  border:1px solid #c8d0e7; border-radius:8px; background:rgba(255,255,255,.67); color:var(--crm-ink);
  font:inherit; font-weight:600; white-space:nowrap; text-decoration:none; cursor:pointer;
  transition:background-color var(--crm-motion),box-shadow var(--crm-motion);
}
.cal-control:hover { background:#f3eeff; }
.cal-primary,.cal-control[aria-pressed="true"] {
  background:var(--crm-gradient); color:white; border-color:transparent; box-shadow:0 2px 6px rgba(84,58,194,.22);
}
.cal-primary:hover,.cal-control[aria-pressed="true"]:hover { background:var(--crm-gradient); filter:brightness(1.07); }
.cal-primary { min-height:43px; padding-inline:17px; }
.cal-panel {
  min-width:0; border:1px solid #c7d5ef; border-radius:var(--crm-radius);
  background:linear-gradient(115deg,rgba(255,255,255,.87),rgba(245,253,255,.8)); box-shadow:var(--crm-shadow);
}
.cal-toolbar { flex-wrap:wrap; padding:10px 13px; margin-bottom:16px; }
.cal-navigation,.cal-modes,.cal-filter-buttons { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cal-navigation > strong { margin-inline-start:9px; color:#121b3d; font-size:clamp(15px,1.5vw,22px); letter-spacing:-.015em; }
.cal-navigation [data-cal="shift"] { width:36px; padding:4px; }
.cal-modes { gap:2px; padding:2px; border:1px solid #cdd5ea; border-radius:9px; background:#ffffff55; }
.cal-modes .cal-control { min-height:32px; padding-block:4px; border-color:transparent; background:transparent; }
.cal-modes .cal-control:hover { background:#ebe5fd; }
.cal-modes .cal-control[aria-pressed="true"] { background:var(--crm-gradient); }
.cal-layout { display:grid; grid-template-columns:minmax(0,2.65fr) minmax(285px,1fr); gap:14px; align-items:start; }
.cal-side { display:grid; min-width:0; align-items:start; gap:12px; }
.cal-board { padding:0 2px 2px; }
.cal-filters { min-height:59px; padding:10px 11px; flex-wrap:wrap; }
.cal-filter-buttons { gap:7px; }
.cal-filter-buttons .cal-control { font-size:13px; }
.cal-switch {
  display:inline-flex; align-items:center; gap:9px; min-height:34px; padding:3px 0; border:0; border-radius:7px;
  background:none; color:var(--crm-ink); font:inherit; font-size:13px; cursor:pointer;
}
.cal-switch > span { position:relative; width:43px; height:24px; border-radius:20px; background:#d6dfee; }
.cal-switch > span::after {
  content:""; position:absolute; inset:3px auto 3px 3px; width:18px; height:18px;
  border-radius:50%; background:white; box-shadow:0 1px 3px #24314d28; transition:transform var(--crm-motion);
}
.cal-switch[aria-checked="true"] > span { background:var(--crm-gradient); }
.cal-switch[aria-checked="true"] > span::after { transform:translateX(19px); }
.cal-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.cal-week-scroll { overflow-x:auto; border:1px solid #cbd5ec; border-radius:11px; }
.cal-week-scroll:focus-visible { outline:2px solid var(--crm-indigo); outline-offset:-2px; }
.cal-week-content { min-width:730px; }
.cal-week-head,.cal-month-head { background:linear-gradient(100deg,#f0f2fd,#edf8fd); }
.cal-date,.cal-month-day {
  min-width:0; border:0; border-right:1px solid #d4deee; border-bottom:1px solid #d4deee;
  color:var(--crm-ink); background:transparent; font:inherit; cursor:pointer;
}
.cal-date {
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:4px;
  min-height:63px; padding:10px 3px 7px;
}
.cal-date:nth-child(7n),.cal-month-day:nth-child(7n) { border-right:0; }
.cal-date strong { font-size:clamp(15px,1.35vw,21px); font-weight:750; color:#101735; }
.cal-date small { display:flex; align-items:center; gap:5px; color:#5642a8; font-size:12px; }
.cal-date small::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--crm-violet); }
.cal-date:hover,.cal-month-day:hover { background:#eeeaff; }
.cal-date[aria-pressed="true"],.cal-month-day[aria-pressed="true"] { background:#e4dcfb; }
.cal-date[aria-pressed="true"] strong,.cal-month-day[aria-pressed="true"] strong { color:#5728ad; }
.cal-week-columns { min-height:clamp(300px,47vh,510px); }
.cal-week-column { min-width:0; padding:9px 6px; border-right:1px solid #d4deee; }
.cal-week-column:last-child { border:0; }
.cal-week-column.is-selected { background:rgba(233,224,255,.23); }
.cal-equipment-strip { background:#f6f7fc; border-bottom:1px solid #d4deee; }
.cal-equipment-strip h3 { margin:0; padding:4px 7px 2px; color:var(--crm-muted); font-size:11px; }
.cal-equipment-strip button {
  display:grid; place-content:center; gap:2px; min-width:0; min-height:42px; padding:3px;
  border:0; border-right:1px solid #d4deee; background:none; color:var(--crm-ink); font:inherit; cursor:pointer;
  font-variant-numeric:tabular-nums;
}
.cal-equipment-strip button:last-child { border-right:0; }
.cal-equipment-strip button:hover,.cal-equipment-strip button[aria-pressed="true"] { background:#eae2ff; }
.cal-equipment-strip button strong { font-size:13px; }
.cal-stock-shortage { color:#895009; font-size:11px; font-weight:650; }
.cal-empty-cell { display:block; padding-top:8px; color:var(--crm-muted); text-align:center; }
.cal-order {
  display:grid; align-content:center; gap:3px; width:100%; min-height:64px; margin-bottom:7px;
  padding:5px 7px; border:1px solid #d1d9eb; border-radius:9px;
  color:var(--crm-ink); background:rgba(255,255,255,.68); font:inherit; text-align:left; cursor:pointer;
}
.cal-order:hover { border-color:#a899ed; background:linear-gradient(135deg,#f3efff,#f2f9ff); }
.cal-order[aria-pressed="true"] { border-color:var(--crm-violet); background:linear-gradient(135deg,#eee6fd,#eef5ff); }
.cal-order-meta,.cal-order-action { display:flex; align-items:center; min-width:0; gap:4px; }
.cal-order-meta { justify-content:space-between; min-height:16px; color:var(--crm-muted); }
.cal-order-meta small { font-size:11px; white-space:nowrap; }
.cal-order-extra { padding:1px 4px; border-radius:5px; color:#4c2fa0; background:#ebe3fc; }
.cal-order > strong,.cal-order-action-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-order > strong { font-size:14px; line-height:1.25; }
.cal-order-action { color:#465478; font-size:12px; line-height:1.25; }
.cal-order-action .icon { width:14px; height:14px; }
.cal-order-action time { color:var(--crm-ink); font-weight:750; font-variant-numeric:tabular-nums; }
.cal-untimed {
  flex:none; padding:1px 3px; border-radius:5px;
  background:#e9edf6; color:#465478; font-size:10px; white-space:nowrap;
}
.cal-more-orders {
  width:100%; padding:4px; min-height:32px; font-size:12px; white-space:normal; line-height:1.24;
  color:var(--crm-indigo); border-color:#b6a4ec; text-align:center;
}
.cal-day-details,.cal-attention { padding:12px; }
.cal-day-details h2,.cal-attention h2,.cal-day-title { margin:0 0 10px; color:#101735; font-size:clamp(18px,1.7vw,24px); line-height:1.18; font-weight:750; }
.cal-day-title { padding:0 12px; }
.cal-detail-heading { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:5px 12px; margin-bottom:10px; }
.cal-detail-heading h2 { margin:0; }
.cal-detail-tabs {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; margin-bottom:10px; padding:2px;
  border:1px solid #cdd5ea; border-radius:9px; background:#ffffff58;
}
.cal-detail-tabs .cal-control { min-height:31px; padding:4px; border-color:transparent; }
.cal-stock-summary {
  display:flex; justify-content:space-between; align-items:center; gap:8px; padding:10px; margin-bottom:10px;
  border:1px solid #d7def0; border-radius:9px; background:#f5f4fd; color:#354360;
}
.cal-stock-summary .cal-stock-amount { color:var(--crm-ink); font-size:16px; }
.cal-stock-amount { display:grid; gap:2px; text-align:right; font-variant-numeric:tabular-nums; }
.cal-day-warehouse { margin-bottom:10px; }
.cal-day-warehouse select { width:100%; min-height:33px; font-size:13px; }
.cal-order-shortage { margin:8px; background:#fff7ec; border-color:#efd5ae; }
.cal-order-shortage > strong { display:flex; align-items:center; gap:6px; }
.cal-order-shortage .icon { color:var(--crm-warning); }
.cal-shortage-list {
  margin:0; padding:0; list-style:none; max-height:min(51vh,460px); overflow:auto; overscroll-behavior:contain;
  border:1px solid #dce5f2; border-radius:10px; background:#ffffff58;
}
.cal-order-details > .cal-shortage-list { margin:8px; }
.cal-shortage-list li + li { border-top:1px solid #dce5f2; }
.cal-order-details .cal-shortage-list li,.cal-shortage-list button {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; min-height:37px; padding:8px 10px;
}
.cal-shortage-list button {
  width:100%; grid-template-columns:minmax(0,1fr) auto auto; border:0; background:none;
  color:var(--crm-ink); font:inherit; text-align:start; cursor:pointer;
}
.cal-shortage-list button:hover { background:#f1edfd; }
.cal-shortage-list span { overflow-wrap:anywhere; }
.cal-shortage-list .cal-stock-shortage,.cal-order-shortage .cal-stock-shortage { white-space:nowrap; }
.cal-show-day {
  display:inline-flex; align-items:center; gap:4px; padding:4px; border:0; border-radius:6px; background:none;
  color:var(--crm-indigo); font:inherit; font-weight:650; cursor:pointer;
}
.cal-show-day:hover { background:#eee8fd; }
.cal-show-day .icon { width:15px; height:15px; }
.cal-order-details { border:1px solid #dce5f2; border-radius:10px; background:#ffffff58; }
.cal-order-details > header { padding:12px; border-bottom:1px solid #dce5f2; }
.cal-order-details h3 { margin:0; font-size:16px; line-height:1.28; overflow-wrap:anywhere; }
.cal-order-details > header p { display:flex; align-items:center; gap:5px; margin:5px 0 0; color:#4f5f7d; overflow-wrap:anywhere; }
.cal-order-details > header .icon { width:14px; height:14px; }
.cal-order-details .cal-agenda { border:0; background:none; }
.cal-order-note { padding:9px 12px; border-top:1px solid var(--crm-border); background:#f5f4fd; border-radius:0 0 9px 9px; }
.cal-order-note summary { color:var(--crm-ink); font-weight:650; cursor:pointer; }
.cal-order-note p { max-height:min(32vh,260px); overflow:auto; margin:5px 0 0; color:var(--crm-ink); white-space:pre-wrap; overflow-wrap:anywhere; }
.cal-open-order { width:100%; margin-top:9px; color:var(--crm-indigo); border-color:#b6a4ec; }
.cal-agenda { overflow:hidden; border:1px solid #dce5f2; border-radius:10px; background:#ffffff58; }
.cal-week-details > .cal-agenda { max-height:min(56vh, 520px); overflow:auto; overscroll-behavior:contain; }
.cal-board > .cal-agenda { margin:0 10px 10px; }
.cal-agenda-row {
  display:grid; gap:12px; align-items:start; padding:10px 9px; border-bottom:1px solid #dce5f2;
  color:var(--crm-ink); text-decoration:none;
}
button.cal-agenda-row { width:100%; border-width:0 0 1px; background:none; font:inherit; text-align:start; cursor:pointer; }
.cal-agenda-row:last-child { border-bottom:0; }
:is(a,button).cal-agenda-row:hover { background:#f0ebff; }
.cal-agenda-row.has-clock { grid-template-columns:67px minmax(0,1fr); }
.cal-agenda-clock { font-size:15px; font-weight:750; font-variant-numeric:tabular-nums; }
.cal-agenda-item { display:flex; align-items:flex-start; gap:8px; min-width:0; }
.cal-agenda-item > span { display:grid; gap:3px; min-width:0; overflow-wrap:anywhere; font-size:13px; }
.cal-agenda-item .icon { color:#334267; }
.has-clock > .cal-agenda-item { padding-inline-start:9px; border-inline-start:1px solid #d6deec; }
.cal-agenda-item strong { font-size:15px; }
.cal-agenda :is(small,h3) { color:#4f5f7d; }
.cal-agenda small { display:block; font-size:12px; font-weight:400; }
.cal-agenda h3 { margin:0; padding:8px 9px 0; font-size:13px; }
.cal-attention ul { list-style:none; margin:0; padding:0; overflow:auto; max-height:260px; border:1px solid #dce5f2; border-radius:10px; background:#ffffff58; }
.cal-attention li + li { border-top:1px solid #dce5f2; }
.cal-attention-row {
  display:flex; align-items:center; gap:8px; padding:10px 8px; min-height:39px; color:var(--crm-ink);
  text-decoration:none; font-size:13px;
}
button.cal-attention-row { width:100%; border:0; background:none; font-family:inherit; text-align:start; cursor:pointer; }
.cal-attention-row:hover { background:#f1edfd; }
.cal-attention-row span { flex:1; min-width:0; overflow-wrap:anywhere; }
.cal-attention-row > .icon:first-child { color:var(--crm-warning); }
.cal-attention-row.overdue > .icon:first-child { color:var(--crm-danger); }
.cal-attention-row > .icon:last-child { width:14px; height:14px; color:#637394; }
.cal-empty { margin:0; padding:12px 9px; color:var(--crm-muted); font-size:13px; }
.cal-board > .cal-empty { margin-inline:10px; }
.cal-bookings { padding:7px; border-bottom:1px solid #d4deee; background:#f1effc; }
.cal-bookings h3 { margin:0 0 4px; font-size:12px; color:#524187; }
.cal-booking-list { display:grid; gap:4px; }
.cal-booking {
  display:flex; align-items:center; gap:5px; min-width:0; padding:3px 6px; border:1px solid #d4c7f3; border-radius:7px;
  color:#4d337e; background:#eae2fb; font-size:12px; text-decoration:none;
}
.cal-booking:hover { background:#e0d2fb; }
button.cal-booking { font-family:inherit; text-align:start; cursor:pointer; }
.cal-booking > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-booking small { color:#952b4a; white-space:nowrap; }
.cal-booking .icon { width:14px; height:14px; }
.cal-board > .cal-bookings { margin:0 10px 10px; border:1px solid #dcd4f1; border-radius:9px; }
.cal-month-head { text-align:center; font-size:13px; color:var(--crm-muted); padding-block:6px; border-radius:8px 8px 0 0; }
.cal-month { border:1px solid #d4deee; border-radius:0 0 10px 10px; overflow:hidden; }
.cal-month-day {
  display:flex; flex-direction:column; align-items:flex-start; gap:5px; min-height:77px; padding:7px 5px;
  text-align:left;
}
.cal-month-day:nth-last-child(-n+7) { border-bottom:0; }
.cal-month-day.is-outside { background:#f3f5fb; color:#596581; }
.cal-month-day[aria-current="date"] > strong { background:var(--crm-gradient); border-radius:6px; color:white; padding-inline:4px; }
.cal-month-activity { display:grid; gap:3px; font-size:12px; overflow-wrap:anywhere; }
.cal-month-more,.cal-month-booked { color:#563d96; font-size:11px; }

@media (max-width:1100px) {
  .cal-layout { grid-template-columns:minmax(0,1fr); }
  .cal-side { grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr)); }
}
@media (max-width:560px) {
  .shell.is-calendar-view > .main > .content { padding:12px 10px 16px; }
  .cal-heading { margin-bottom:12px; }
  .cal-primary { min-height:37px; padding-inline:8px; font-size:12px; }
  .cal-toolbar { padding:7px; }
  .cal-navigation,.cal-filter-buttons { gap:5px; }
  .cal-navigation > strong { width:100%; margin:1px 0 0; }
  .cal-filters { gap:5px; padding:6px; }
  .cal-filters .cal-control { padding-inline:6px; }
  .cal-month-day { min-height:64px; padding:4px 2px; }
  .cal-month-activity,.cal-month-more,.cal-month-booked { font-size:10px; }
  .cal-booking small { white-space:normal; }
}
@media (prefers-reduced-motion:reduce) {
  .cal-control,.cal-switch > span::after { transition:none; }
}
