:root {
  --app-bg: #f3f6fb;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-ink: #132136;
  --app-muted: #5f6f87;
  --app-border: #d9e1ee;
  --app-primary: #3a6ea5;
  --app-primary-strong: #2f5f92;
  --app-accent: #1fbf91;
  --app-shadow-sm: 0 8px 22px rgba(17, 35, 65, 0.08);
  --app-shadow-md: 0 16px 34px rgba(17, 35, 65, 0.12);

  --sidebar-bg-start: #15233a;
  --sidebar-bg-end: #1d2d46;
  --sidebar-brand-text: #f8fbff;
  --sidebar-link-text: #e9f1ff;
  --sidebar-icon-color: #dbe8fc;
  --sidebar-title-text: #d7e2f6;
  --sidebar-section-text: #bdcee8;
  --sidebar-divider-color: #2c3e5c;
  --sidebar-link-hover-bg: #2b3d59;
  --sidebar-link-hover-border: #4b5f7f;
  --sidebar-link-active-bg: #2d4e7a;
  --sidebar-link-active-border: #6d8fbe;
  --sidebar-badge-info-bg: #3b82f6;
  --sidebar-badge-danger-bg: #e11d48;

  --priority-case-low: #6c757d;
  --priority-case-normal: #0d6efd;
  --priority-case-high: #dc3545;
  --priority-task-low: #6c757d;
  --priority-task-normal: #0d6efd;
  --priority-task-high: #dc3545;
  --priority-service-low: #6c757d;
  --priority-service-normal: #0d6efd;
  --priority-service-high: #dc3545;
}

body.app-body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--app-ink);
  background:
    radial-gradient(1200px 520px at 5% -15%, #d8ecff 0%, transparent 58%),
    radial-gradient(900px 460px at 100% -20%, #d9f8eb 0%, transparent 52%),
    var(--app-bg);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.app-sidebar {
  background: linear-gradient(185deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
  border-right: 1px solid var(--sidebar-divider-color);
  padding: 1rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-sidebar-brand {
  display: block;
  margin: 0.1rem 0.35rem 1.1rem;
  text-decoration: none;
  font-size: 1.06rem;
}

.app-sidebar .app-brand {
  color: var(--sidebar-brand-text) !important;
}

.app-sidebar-section {
  margin-top: 0.4rem;
}

.app-sidebar-title {
  color: var(--sidebar-title-text);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0.45rem 0.55rem;
}

.app-sidebar-subtitle {
  color: var(--sidebar-section-text);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0.58rem 0.45rem 0.42rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--sidebar-divider-color);
}

.app-sidebar-nav {
  display: grid;
  gap: 0.3rem;
}

.app-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--sidebar-link-text);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.58rem 0.7rem;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.app-side-link-main {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-width: 0;
}

.app-side-link-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-icon-color);
}

.app-side-link-icon svg {
  width: 100%;
  height: 100%;
}

.app-side-link:hover {
  transform: translateX(2px);
  color: #fff;
  background: var(--sidebar-link-hover-bg);
  border-color: var(--sidebar-link-hover-border);
}

.app-side-link.is-active {
  color: #fff;
  background: var(--sidebar-link-active-bg);
  border-color: var(--sidebar-link-active-border);
}

.app-side-link.is-active .app-side-link-icon {
  color: #ffffff;
}

.app-sidebar .badge.text-bg-danger {
  background-color: var(--sidebar-badge-danger-bg) !important;
  color: #fff !important;
}

.app-sidebar .badge.text-bg-primary {
  background-color: var(--sidebar-badge-info-bg) !important;
  color: #fff !important;
}

.app-shell-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--app-border);
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-mobile-menu-btn {
  display: none;
}

.app-mobile-sidebar-backdrop {
  display: none;
}

.app-top-chip {
  display: inline-flex;
  align-items: stretch;
  gap: 0.48rem;
  border: 1px solid #cdd9ea;
  background: #fff;
  color: #244060;
  border-radius: 999px;
  min-height: 40px;
  padding: 0.18rem 0.62rem 0.18rem 0.18rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.app-top-chip-link {
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.app-top-chip-link:hover {
  border-color: #a7bddc;
  background: #f2f7ff;
  color: #1f395b;
}

.app-top-chip-label {
  display: inline-flex;
  align-items: center;
}

.app-top-chip-logo-wrap {
  width: 34px;
  min-width: 34px;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #c7d4e8;
  background: #ffffff;
  overflow: hidden;
}

.app-top-chip-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-main {
  min-height: 0;
}

.app-content-wrap {
  padding: 1rem 1.2rem 1.3rem;
  animation: app-fade-in 0.28s ease-out;
}

.app-navbar {
  background: linear-gradient(120deg, #1f2d45 0%, #2a3b59 56%, #314868 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-brand {
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  color: #f8fbff !important;
  text-shadow: 0 1px 1px rgba(7, 13, 24, 0.35);
}

.app-brand:hover,
.app-brand:focus {
  color: #ffffff !important;
}

.app-muted {
  color: rgba(232, 239, 253, 0.78);
}

.app-nav-btn {
  border-color: rgba(230, 239, 255, 0.35);
  color: #e9f1ff;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.app-nav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(230, 239, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.app-logout-btn {
  color: #12233e;
  border-color: transparent;
  font-weight: 600;
}

h1, h2, h3, h4, h5 {
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: -0.01em;
  color: #12203a;
}

.text-muted {
  color: var(--app-muted) !important;
}

.card {
  background: var(--app-surface);
  border: 1px solid var(--app-border) !important;
  border-radius: 14px;
  box-shadow: var(--app-shadow-sm);
}

.card-header {
  background: linear-gradient(180deg, #fcfdff 0%, #f7faff 100%) !important;
  border-bottom: 1px solid var(--app-border) !important;
  border-top-left-radius: 14px !important;
  border-top-right-radius: 14px !important;
}

.table {
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  border-bottom-color: #e7edf7;
}

.table thead th {
  color: #35507d;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.table tbody tr:hover {
  background: #f7faff;
}

.task-row-done > td {
  background: #e5e9ef !important;
}

.task-row-done:hover > td {
  background: #dde3eb !important;
}

.form-control,
.form-select {
  border-radius: 10px;
  border-color: #cfd8e7;
  background: #fff;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 2.2rem;
  border-color: #b9c9e2;
  background-color: #f8fbff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath fill='%233f5f8b' d='M2 2l5 5 5-5 1 1-6 6-6-6z'/%3E%3C/svg%3E");
  background-position: right 0.72rem center;
  background-size: 14px 10px;
  background-repeat: no-repeat;
}

.form-control:focus,
.form-select:focus {
  border-color: #95b9ff;
  box-shadow: 0 0 0 0.22rem rgba(31, 94, 255, 0.18);
}

.btn {
  border-radius: 10px;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

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

.btn-dark {
  background: linear-gradient(120deg, var(--app-primary) 0%, var(--app-primary-strong) 100%);
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(47, 95, 146, 0.22);
}

.btn-dark:hover,
.btn-dark:focus {
  background: linear-gradient(120deg, #35689e 0%, #2a567f 100%);
}

.btn-outline-secondary {
  border-color: #bfccdf;
  color: #28405f;
  background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: #f4f8ff;
  color: #1f395f;
  border-color: #9fb4d4;
}

.alert {
  border-radius: 12px;
  border: 1px solid #d3e2ff;
  box-shadow: var(--app-shadow-sm);
}

.app-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.app-page-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
}

.case-page-identity {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-width: 0;
}

.case-page-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid #c7d5eb;
  background: #eff5ff;
  overflow: hidden;
  flex: 0 0 auto;
}

.case-page-avatar-link {
  display: block;
  width: 100%;
  height: 100%;
}

.case-page-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-page-avatar-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2f517c;
  font-weight: 700;
  font-size: 0.95rem;
}

.app-page-subtitle {
  margin: 0.25rem 0 0;
  color: var(--app-muted);
}

.app-page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-view-toggle {
  border-radius: 8px;
  overflow: hidden;
}

.app-view-toggle-btn {
  min-width: 42px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.55rem;
}

.app-view-toggle-btn.is-active {
  background: #e9f2ff;
  border-color: #9fb4d4;
  color: #1f395f;
}

.app-view-toggle-icon {
  width: 18px;
  height: 18px;
}

.app-kpi-card {
  position: relative;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--app-shadow-md);
  border-color: rgba(58, 110, 165, 0.34);
}

.app-kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #537096;
  font-weight: 700;
}

.app-kpi-value {
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  line-height: 1.1;
  margin-top: 0.25rem;
  color: #142845;
}

.app-tile-hover {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.app-tile-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(17, 35, 65, 0.11);
  border-color: rgba(58, 110, 165, 0.35) !important;
  background: #f7fbff;
}

.app-filter-toolbar .card-body {
  padding: 0.95rem 1rem;
}

.app-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.app-tab-shell .nav-tabs {
  border-bottom-color: #d5e0ef;
}

.app-tab-shell .nav-link {
  color: #37567f;
  border: 1px solid transparent;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.app-tab-shell .nav-link.active {
  background: #fff;
  color: #173256;
  border-color: #d5e0ef #d5e0ef #fff;
  font-weight: 700;
}

.app-empty-state {
  text-align: center;
  padding: 1.2rem 1rem;
  color: var(--app-muted);
}

.app-empty-title {
  font-weight: 700;
  color: #28405f;
}

.app-empty-text {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}

.case-basic-layout.has-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 1rem 1.25rem;
  align-items: start;
}

.case-basic-main {
  min-width: 0;
}

.case-basic-side {
  display: flex;
  justify-content: flex-end;
}

.case-photo-panel {
  width: min(240px, 100%);
  border: 1px solid #d5e0ef;
  border-radius: 12px;
  background: #fbfdff;
  padding: 0.6rem;
  box-shadow: 0 6px 18px rgba(17, 35, 65, 0.08);
}

.case-photo-panel-title {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #33527a;
  font-weight: 700;
}

.case-photo-panel-subtitle {
  font-size: 0.76rem;
  color: #5f6f87;
  margin-top: 0.1rem;
  margin-bottom: 0.45rem;
}

.case-photo-link {
  display: block;
  text-decoration: none;
}

.case-photo-image {
  display: block;
  width: 100%;
  max-height: 290px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cdd9ea;
  background: #f3f6fb;
}

.case-photo-name {
  margin-top: 0.48rem;
  text-align: center;
  font-weight: 700;
  color: #1e3a61;
  font-size: 0.84rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (max-width: 991px) {
  .case-basic-layout.has-photo {
    grid-template-columns: 1fr;
  }

  .case-basic-side {
    order: -1;
    justify-content: flex-end;
    margin-bottom: 0.35rem;
  }
}

.app-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.36rem 0.56rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.app-status-badge.is-open {
  color: #1a6a53;
  background: #e8fbf3;
  border-color: #b9ebd7;
}

.app-status-badge.is-complete {
  color: #5a3f13;
  background: #fff7df;
  border-color: #f0dc9d;
}

.app-status-badge.is-new {
  color: #1f4d91;
  background: #eaf2ff;
  border-color: #c7dbff;
}

.app-priority-badge {
  color: #fff !important;
}

.app-priority-badge.is-task.is-low {
  background-color: var(--priority-task-low) !important;
}

.app-priority-badge.is-task.is-normal {
  background-color: var(--priority-task-normal) !important;
}

.app-priority-badge.is-task.is-high {
  background-color: var(--priority-task-high) !important;
}

.app-priority-badge.is-case.is-low {
  background-color: var(--priority-case-low) !important;
}

.app-priority-badge.is-case.is-normal {
  background-color: var(--priority-case-normal) !important;
}

.app-priority-badge.is-case.is-high {
  background-color: var(--priority-case-high) !important;
}

.pagination .page-link {
  border-radius: 8px;
  border-color: #c7d4e8;
  color: #2a466c;
}

.pagination .page-item + .page-item {
  margin-left: 0.3rem;
}

.pagination .page-item.active .page-link,
.pagination .page-link:hover {
  background: #e9f1ff;
  border-color: #adc4e8;
  color: #1d3f6b;
}

.pagination .page-item.disabled .page-link {
  background: #f7f9fc;
  color: #8fa0b8;
}

.dashboard-latest-table td:nth-child(3),
.dashboard-latest-table td:nth-child(4) {
  white-space: nowrap;
}

.dashboard-unassigned-table {
  width: 100%;
}

.dashboard-unassigned-table th,
.dashboard-unassigned-table td {
  vertical-align: middle;
}

.dashboard-unassigned-table th:nth-child(1),
.dashboard-unassigned-table td:nth-child(1) {
  white-space: nowrap;
}

.dashboard-unassigned-table th:nth-child(2),
.dashboard-unassigned-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.dashboard-unassigned-table th:nth-child(3),
.dashboard-unassigned-table td:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-unassigned-table th:nth-child(4),
.dashboard-unassigned-table td:nth-child(4) {
  width: 92px;
  min-width: 92px;
  white-space: nowrap;
}

.dashboard-unassigned-table thead th {
  white-space: nowrap;
}

@media (max-width: 1500px) and (max-height: 760px) {
  .dashboard-unassigned-table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.03em;
  }
}

.company-setup-layout {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 1rem;
  align-items: start;
}

.company-setup-nav-card {
  position: sticky;
  top: 88px;
}

.company-setup-nav-title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #58729a;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.company-setup-nav-list {
  display: grid;
  gap: 0.4rem;
}

.company-setup-nav-link {
  border: 1px solid #cfdbec;
  background: #f7faff;
  color: #1d3f67;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.company-setup-nav-link:hover {
  background: #edf4ff;
  border-color: #b9cdec;
}

.company-setup-nav-link.is-active {
  background: #1d4f8d;
  border-color: #1d4f8d;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(20, 60, 108, 0.2);
}

.company-setup-main .card-header strong {
  color: #1f3654;
}

.company-logo-preview-tile {
  border: 1px dashed #bfd0e8;
  background: #f8fbff;
  border-radius: 12px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.company-logo-preview-img {
  max-width: 100%;
  max-height: 92px;
  object-fit: contain;
}

.company-logo-preview-empty {
  font-size: 0.86rem;
  color: #6983a8;
}

.company-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.company-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.company-color-field {
  border: 1px solid #d7e2f0;
  border-radius: 12px;
  background: #fbfdff;
  padding: 0.6rem 0.7rem;
}

.company-color-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.company-color-input.form-control-color {
  width: 54px;
  min-width: 54px;
  height: 38px;
  border-radius: 10px;
  padding: 0.2rem;
  cursor: pointer;
}

.company-color-value {
  display: inline-block;
  padding: 0.23rem 0.5rem;
  border-radius: 999px;
  background: #edf3fd;
  border: 1px solid #cbdaf0;
  color: #365a85;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.company-advanced-toggle {
  border: 1px solid #d7e2f0;
  border-radius: 12px;
  background: #f9fcff;
  padding: 0.55rem 0.7rem;
}

.company-advanced-toggle > summary {
  cursor: pointer;
  color: #22476f;
  font-weight: 600;
  font-size: 0.9rem;
}

.company-priority-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #45648b;
  margin-bottom: 0.45rem;
}

.company-integrations-note {
  border: 1px dashed #bfd0e8;
  background: #f8fbff;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

.company-setup-preview {
  position: sticky;
  top: 88px;
}

.company-preview-card .card-body {
  display: grid;
  gap: 0.9rem;
}

.company-preview-sidebar-box {
  border-radius: 14px;
  padding: 0.8rem;
  background: linear-gradient(170deg, var(--sidebar-bg-start), var(--sidebar-bg-end));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.company-preview-brand {
  color: var(--sidebar-link-text);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.company-preview-link {
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--sidebar-link-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.86rem;
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.35rem;
}

.company-preview-link.is-active {
  background: var(--sidebar-link-active-bg);
  border-color: var(--sidebar-link-active-border);
}

.company-preview-badge {
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2rem 0.45rem;
}

.company-preview-badge.info {
  background: var(--sidebar-badge-info-bg);
}

.company-preview-badge.danger {
  background: var(--sidebar-badge-danger-bg);
}

@media (max-width: 1400px) {
  .company-setup-layout {
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  }

  .company-setup-preview {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 992px) {
  .company-setup-layout {
    grid-template-columns: 1fr;
  }

  .company-setup-nav-card,
  .company-setup-preview {
    position: static;
  }
}

.app-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.app-calendar-switcher {
  position: relative;
}

.app-calendar-switcher-trigger {
  min-width: 250px;
  text-align: left;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
}

.app-calendar-switcher-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 300px;
  z-index: 20;
  border: 1px solid #c8d5ea;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 22px rgba(16, 34, 57, 0.14);
  padding: 0.6rem;
}

.app-calendar-switcher-head {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #33527a;
  font-weight: 700;
  border-bottom: 1px solid #dde6f3;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
}

.app-calendar-switcher-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.app-calendar-switcher-nav {
  display: inline-flex;
  gap: 0.25rem;
}

.app-calendar-switcher-form .form-select {
  min-width: 108px;
  width: auto;
}

.app-calendar-picker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.app-calendar-picker .form-select {
  min-width: 140px;
}

.app-calendar-table thead th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.84rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.app-calendar-cell-wrap {
  width: 14.2%;
}

.app-calendar-cell {
  min-height: clamp(72px, calc((100vh - 370px) / 6), 118px);
  background: #fff;
  padding: 0.4rem !important;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.app-calendar-cell.is-other-month {
  background: #f4f7fc;
}

.app-calendar-cell:hover {
  border-color: #8eb0df !important;
  box-shadow: 0 6px 16px rgba(47, 95, 146, 0.16);
  background: #f7fbff;
  transform: translateY(-1px);
}

.app-calendar-cell:hover:not(.is-over-event) {
  border-color: #7ab596 !important;
  box-shadow: 0 7px 18px rgba(31, 140, 87, 0.18);
}

.app-calendar-cell:focus-visible {
  outline: 0;
  border-color: #5f93da !important;
  box-shadow: 0 0 0 0.2rem rgba(31, 94, 255, 0.2);
}

.app-calendar-day-number {
  font-size: 0.98rem;
  font-weight: 700;
  color: #27466b;
}

.app-calendar-day-number.is-today {
  color: #0d6efd;
}

.app-calendar-events {
  align-content: start;
}

.app-calendar-event-link {
  display: block;
  padding: 0.12rem 0;
  line-height: 1.25;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.app-calendar-event-link:hover,
.app-calendar-event-link:focus-visible {
  background: #e9f2ff;
  color: #11427a !important;
  box-shadow: inset 0 0 0 1px #9dbcea;
  text-decoration: none;
  outline: none;
}

.app-calendar-mini-badge {
  font-size: 0.62rem;
  line-height: 1;
  padding: 0.2rem 0.32rem;
}

.app-calendar-cell-actions {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.18rem;
}

.app-calendar-add-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.73rem;
  line-height: 1;
  border-radius: 6px;
  border: 1px dashed #9eb5d6;
  color: #315b8e;
  background: #f5f9ff;
  padding: 0.22rem 0.38rem;
  text-decoration: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.14s ease, transform 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.app-calendar-cell-hint {
  font-size: 0.68rem;
  color: #5e7392;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.app-calendar-cell:hover:not(.is-over-event) .app-calendar-add-link,
.app-calendar-cell:focus-visible .app-calendar-add-link,
.app-calendar-cell:hover:not(.is-over-event) .app-calendar-cell-hint,
.app-calendar-cell:focus-visible .app-calendar-cell-hint {
  opacity: 1;
  transform: translateY(0);
}

.app-calendar-add-link:hover,
.app-calendar-add-link:focus-visible {
  border-color: #6fa084;
  background: #edf9f2;
  color: #195b3d;
  text-decoration: none;
  outline: none;
}

.app-calendar-month-page .app-page-head {
  margin-bottom: 0.6rem;
}

.app-calendar-month-page .app-page-title {
  font-size: clamp(1.2rem, 1.5vw, 1.6rem);
}

.app-calendar-month-page .app-page-subtitle {
  margin-top: 0.12rem;
}

@media (max-width: 992px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(86vw, 320px);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 0;
    z-index: 1045;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
  }

  .app-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell.is-mobile-sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-mobile-menu-btn {
    display: inline-flex;
    margin-right: 0.45rem;
  }

  .app-mobile-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 17, 31, 0.36);
    opacity: 0;
    pointer-events: none;
    z-index: 1040;
    transition: opacity 0.18s ease;
  }

  .app-shell.is-mobile-sidebar-open .app-mobile-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .app-topbar {
    padding: 0.75rem 0.9rem;
  }

  .app-content-wrap {
    padding: 0.85rem 0.65rem 1rem;
  }

  .app-page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .app-calendar-cell {
    min-height: 160px;
  }

  .app-calendar-switcher-panel {
    min-width: 265px;
  }

  .app-calendar-switcher-nav {
    justify-content: flex-start;
  }

  .app-calendar-picker .form-select {
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    padding: 0.8rem 0.7rem;
  }

  .app-sidebar-nav {
    grid-template-columns: 1fr;
  }

  .app-side-link {
    padding: 0.55rem 0.62rem;
  }

  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .app-topbar-left,
  .app-topbar-right {
    width: 100%;
  }

  .app-topbar-right {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .app-topbar-right .small {
    display: block;
    max-width: 100%;
    word-break: break-word;
  }

  .app-content-wrap {
    padding: 0.8rem 0.55rem 0.95rem;
  }
}

@media (max-width: 576px) {
  .app-sidebar-brand {
    margin-bottom: 0.85rem;
  }

  .app-top-chip {
    max-width: 100%;
    white-space: normal;
  }

  .app-calendar-switcher-trigger,
  .app-calendar-switcher-panel {
    min-width: 100%;
  }

  .app-calendar-picker .form-select,
  .app-calendar-switcher-form .form-select {
    min-width: 100%;
    width: 100%;
  }
}

@keyframes app-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
