:root {
  --primary: #db6600;
  --primary-light-bg: #fef0e6;
  --primary-dark-text: #8a4100;
  --primary-strong: #b94f00;
  --emar-accent: #db6600;
  --emar-accent-soft: rgba(219, 102, 0, 0.12);
  --emar-accent-shadow: rgba(219, 102, 0, 0.2);
  --emar-accent-contrast: #8a4100;
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-alt: #f1f1f1;
  --surface-muted: #f8f9fa;
  --border-color: #dee2e6;
  --border-muted: #e9ecef;
  --divider-color: #dee2e6;
  --text-primary: #111111;
  --text-secondary: #333333;
  --text-muted: #6c757d;
  --heading-color: #0d0d0d;
  --shadow-color: rgba(0, 0, 0, 0.05);
  --shadow-strong: rgba(0, 0, 0, 0.2);
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --scrollbar-track: #f1f1f1;
  --scrollbar-thumb: #ced4da;
  --scrollbar-thumb-hover: #adb5bd;
  --input-bg: #ffffff;
  --input-border: #ced4da;
  --input-focus-border: #42a5f5;
  --table-row-hover: #f8f9fa;
  --sidebar-collapsed-width: 96px;
  --sidebar-expanded-width: 250px;
  --sidebar-bg: var(--primary);
  --mobile-sidebar-bg: #db6600;
  --mobile-divider-color: #dee2e6;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 20% 20%, rgba(219, 102, 0, 0.07) 0%, rgba(219, 102, 0, 0) 30%),
    linear-gradient(135deg, #ffffff 0%, #f8f4ff 38%, #fef0e6 75%, #f7f7fb 100%);
  background-attachment: fixed;
  background-size: cover;
  color: var(--text-primary);
  font-family: 'Inter', system-ui, Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease, background-image 0.3s ease;
}

body.theme-blue {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 22% 18%, rgba(25, 118, 210, 0.07) 0%, rgba(25, 118, 210, 0) 30%),
    linear-gradient(135deg, #ffffff 0%, #f0f4ff 40%, #dfe9ff 72%, #f5f8ff 100%);
}

body.theme-green {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 22% 18%, rgba(28, 169, 125, 0.07) 0%, rgba(28, 169, 125, 0) 30%),
    linear-gradient(135deg, #ffffff 0%, #edf7f1 40%, #d8efe4 72%, #f2faf6 100%);
}

body.theme-dark {
  color-scheme: dark;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 176, 103, 0.08) 0%, rgba(255, 176, 103, 0) 28%),
    linear-gradient(145deg, #161616 0%, #101010 40%, #1f1f1f 78%, #0f0f0f 100%);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-strong);
}

hr {
  color: var(--divider-color);
  opacity: 1;
}

.text-muted {
  color: var(--text-muted) !important;
}

.main-wrapper { position: relative; }
.main-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--overlay-bg); z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.main-overlay.active { opacity: 1; visibility: visible; }
.sidebar { width: var(--sidebar-collapsed-width); background: linear-gradient(180deg, #ffe6cc 0%, #ffb067 32%, #db6600 100%); height: 100vh; position: fixed; top: 0; left: 0; padding: 1.5rem 1rem; display: flex; flex-direction: column; align-items: center; transition: width 0.3s ease; z-index: 1000; overflow-y: auto; overflow-x: hidden; }
.sidebar.expanded, .sidebar.hover-expanded { width: var(--sidebar-collapsed-width); align-items: center; }
.sidebar-item { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; width: 100%; padding: 0.75rem 0.5rem; margin-bottom: 0.5rem; border-radius: 8px; text-decoration: none; color: #fff; transition: background-color 0.2s ease; text-align: center; white-space: normal; }
.sidebar-item:hover, .sidebar-item.active { background-color: rgba(255, 255, 255, 0.2); }
.sidebar-item .icon { font-size: 1.35rem; min-width: 32px; text-align: center; }
.sidebar-item .text { opacity: 1; transition: opacity 0.2s ease; font-weight: 600; font-size: 0.8rem; line-height: 1.2; }
.main-content { margin-left: var(--sidebar-collapsed-width); width: calc(100% - var(--sidebar-collapsed-width)); transition: margin-left 0.3s ease; background: transparent; color: var(--text-primary); }
.topbar { display: flex; align-items: center; padding: 1.25rem 1.75rem; gap: 1.5rem; background-color: #ffffff; background-image: linear-gradient(90deg, #ffffff 0%, #ffe2c9 36%, #ffb067 72%, rgba(219, 102, 0, 0.36) 100%); color: var(--heading-color); position: sticky; top: 0; z-index: 900; border-bottom: 1px solid rgba(17, 17, 17, 0.05); box-shadow: 0 16px 40px rgba(17, 17, 17, 0.12); }
#sidebar-toggle { font-size: 1.5rem; cursor: pointer; color: var(--heading-color); display: none; }
.topbar h5,
.topbar .user-name-primary,
.topbar .user-name-secondary,
.topbar i,
.topbar .btn-user { color: var(--heading-color); }
.topbar-main { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar-context { display: flex; align-items: center; gap: 1rem; }
.topbar-actions { display: flex; align-items: center; gap: 1rem; margin-left: auto; flex: 1 1 auto; justify-content: flex-end; }
.search-container { position: relative; flex-grow: 1; display: flex; justify-content: center; max-width: 480px; }
.search-input-wrapper { position: relative; width: 100%; }
.search-input-icon { position: absolute; inset-inline-start: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; font-size: 0.95rem; }
.topbar .form-control { max-width: 100%; background-color: #ffffff; border-color: rgba(17, 17, 17, 0.08); color: var(--text-primary); padding-inline-start: 2.5rem; border-radius: 999px; box-shadow: 0 14px 34px rgba(17, 17, 17, 0.08); }
.topbar .form-control::placeholder { color: var(--text-muted); }
.topbar .form-control:focus { background-color: #ffffff; border-color: rgba(219, 102, 0, 0.4); box-shadow: 0 0 0 4px rgba(219, 102, 0, 0.08), 0 16px 36px rgba(17, 17, 17, 0.1); }
.search-container.is-open .form-control { background-color: #ffffff; }
.search-dropdown { position: absolute; top: calc(100% + 0.75rem); inset-inline: 0; background: var(--surface); border-radius: 14px; border: 1px solid rgba(17, 17, 17, 0.08); box-shadow: 0 18px 36px rgba(17, 17, 17, 0.22); padding: 0.75rem; z-index: 950; color: var(--text-primary); min-width: 320px; opacity: 0; transform: translateY(8px) scale(0.985); visibility: hidden; transition: transform 0.29s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease, box-shadow 0.29s ease, visibility 0.24s ease; transform-origin: top center; }
.search-container.is-open .search-dropdown { opacity: 1; transform: translateY(0) scale(1); visibility: visible; }
.search-dropdown .spinner-border { color: var(--primary); }
.search-status { padding: 0.35rem 0.5rem; }
.search-results-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.search-result-group { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--text-muted); padding: 0.65rem 0.65rem 0.35rem; }
.search-result-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.6rem 0.65rem; border-radius: 0.75rem; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; }
.search-result-item:hover, .search-result-item:focus, .search-result-item.is-active { background-color: rgba(219, 102, 0, 0.12); color: var(--text-primary); }
.search-result-icon { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background-color: rgba(219, 102, 0, 0.12); color: var(--primary); flex-shrink: 0; font-size: 0.95rem; }
.search-result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.search-result-title { font-weight: 600; display: inline-flex; align-items: center; gap: 0.45rem; color: var(--heading-color); }
.search-result-description { font-size: 0.85rem; color: var(--text-muted); white-space: normal; }
.search-result-badge { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.1rem 0.45rem; border-radius: 999px; background-color: var(--primary-light-bg); color: var(--primary); font-weight: 600; box-shadow: 0 8px 18px rgba(17, 17, 17, 0.08); }
.search-dropdown::-webkit-scrollbar { width: 8px; }
.search-dropdown::-webkit-scrollbar-thumb { background-color: rgba(17, 17, 17, 0.12); border-radius: 999px; }
.search-dropdown::-webkit-scrollbar-thumb:hover { background-color: rgba(17, 17, 17, 0.22); }
.theme-dark .search-dropdown { background: #1e1f25; border-color: rgba(255, 255, 255, 0.08); color: #f8f9fa; box-shadow: 0 18px 36px rgba(0, 0, 0, 0.6); }
.theme-dark .search-result-icon { background-color: rgba(219, 102, 0, 0.18); color: #ffb067; }
.theme-dark .search-result-description { color: rgba(255, 255, 255, 0.7); }
.theme-dark .search-result-badge { background-color: rgba(219, 102, 0, 0.24); color: #ffb067; }
.theme-dark .search-dropdown .spinner-border { color: #ffb067; }
.search-container[data-global-search] .search-dropdown { display: flex; flex-direction: column; gap: 0.35rem; }
.topbar-icons { display: flex; align-items: center; gap: 1.5rem; }
.search-toggle-btn { background: #ffffff; border: 1px solid rgba(17, 17, 17, 0.07); color: var(--heading-color); width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 14px 34px rgba(17, 17, 17, 0.08); }
.search-toggle-btn:active { transform: scale(0.98); }
.search-toggle-btn:hover, .search-toggle-btn:focus { background: #f6f8fb; box-shadow: 0 0 0 4px rgba(219, 102, 0, 0.08), 0 16px 36px rgba(17, 17, 17, 0.1); color: var(--heading-color); }
.topbar-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--heading-color);
  border: 1px solid rgba(17, 17, 17, 0.07);
  padding: 0;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.08);
}

.topbar-icon-btn:focus,
.topbar-icon-btn:hover {
  background: #f6f8fb;
  color: var(--heading-color);
  box-shadow: 0 0 0 4px rgba(219, 102, 0, 0.08), 0 16px 36px rgba(17, 17, 17, 0.1);
}

.topbar-icon-btn:active {
  transform: scale(0.98);
}
.btn-user { background: #ffffff; border: 1px solid rgba(17, 17, 17, 0.08); padding: 0.5rem 1rem; border-radius: 999px; font-weight: 600; transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease; color: var(--heading-color); box-shadow: 0 14px 34px rgba(17, 17, 17, 0.08); }
.btn-user:focus { box-shadow: 0 0 0 4px rgba(219, 102, 0, 0.08), 0 16px 36px rgba(17, 17, 17, 0.1); }
.btn-user:hover, .btn-user[aria-expanded="true"] { background: #f6f8fb; color: var(--heading-color); }
.btn-user .fa-chevron-down { font-size: 0.75rem; }
.user-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(145deg, #fff7ef, #ffffff); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; border: 1px solid rgba(17, 17, 17, 0.06); box-shadow: 0 10px 24px rgba(17, 17, 17, 0.08); }
.btn-layout-edit { border: 1px solid rgba(219, 102, 0, 0.35); background: linear-gradient(120deg, #fff7f0, #ffffff); color: var(--primary); box-shadow: 0 10px 25px rgba(219, 102, 0, 0.12); font-weight: 600; }
.btn-layout-edit:hover { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 12px 28px rgba(219, 102, 0, 0.22); }
.user-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar-fallback { display: inline-flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-weight: 700; letter-spacing: 0.02em; color: #fff; }
.calendar-peek-menu { min-width: 360px; padding: 1rem; border: 1px solid rgba(17, 17, 17, 0.08); border-radius: 18px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), #ffffff); box-shadow: 0 18px 36px rgba(17, 17, 17, 0.16); opacity: 0; transform: translateY(10px) scale(0.985); transform-origin: top right; transition: transform 0.29s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease, box-shadow 0.29s ease; }
.dropdown-menu.show.calendar-peek-menu { opacity: 1; transform: translateY(0) scale(1); }
.calendar-peek-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.calendar-peek-label { font-weight: 700; color: var(--heading-color); }
.calendar-peek-sub { font-size: 0.9rem; color: var(--text-muted); }
.calendar-peek-month { font-weight: 700; color: var(--heading-color); }
.calendar-peek-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; margin-bottom: 0.35rem; font-size: 0.78rem; color: var(--text-muted); text-align: center; text-transform: uppercase; letter-spacing: 0.08em; }
.calendar-peek-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; }
.calendar-peek-cell { border-radius: 12px; padding: 0.55rem 0; text-align: center; font-weight: 700; color: var(--heading-color); background: rgba(17, 17, 17, 0.03); border: 1px solid rgba(17, 17, 17, 0.04); pointer-events: none; }
.calendar-peek-cell.is-muted { color: var(--text-muted); opacity: 0.75; background: rgba(17, 17, 17, 0.02); }
.calendar-peek-cell.is-today { background: linear-gradient(145deg, rgba(219, 102, 0, 0.18), rgba(219, 102, 0, 0.08)); color: var(--heading-color); border-color: rgba(219, 102, 0, 0.45); box-shadow: 0 10px 24px rgba(219, 102, 0, 0.15); }
.notif-menu { min-width: 380px; padding: 1rem; border-radius: 18px; border: 1px solid rgba(17, 17, 17, 0.08); background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), #ffffff); box-shadow: 0 18px 36px rgba(17, 17, 17, 0.18); max-height: 70vh; overflow: hidden; opacity: 0; transform: translateY(10px) scale(0.985); transition: transform 0.29s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease, box-shadow 0.29s ease; transform-origin: top right; }
.dropdown-menu.show.notif-menu { opacity: 1; transform: translateY(0) scale(1); }
.notif-menu-header { padding-bottom: 0.75rem; margin-bottom: 0.75rem; border-bottom: 1px solid rgba(17, 17, 17, 0.06); }
.notif-title { font-weight: 700; color: var(--heading-color); }
.notif-subtext { color: var(--text-muted); font-size: 0.9rem; }
.notif-actions { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.35rem; }
.notif-clear-btn { border: 1px solid rgba(17, 17, 17, 0.08); background: rgba(17, 17, 17, 0.04); color: var(--text-primary); padding: 0.25rem 0.65rem; border-radius: 999px; font-weight: 700; font-size: 0.85rem; box-shadow: 0 10px 22px rgba(17, 17, 17, 0.08); transition: background-color 0.18s ease, transform 0.15s ease, box-shadow 0.2s ease; }
.notif-clear-btn:hover, .notif-clear-btn:focus { background: rgba(219, 102, 0, 0.12); border-color: rgba(219, 102, 0, 0.35); color: var(--heading-color); box-shadow: 0 0 0 3px rgba(219, 102, 0, 0.12), 0 12px 28px rgba(17, 17, 17, 0.16); }
.notif-clear-btn:active { transform: translateY(1px); }
.notif-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 48vh; overflow-y: auto; padding-right: 0.25rem; }
.notif-item { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: center; padding: 0.65rem 0.75rem; border-radius: 14px; text-decoration: none; background: rgba(17, 17, 17, 0.03); border: 1px solid rgba(17, 17, 17, 0.05); color: var(--text-primary); transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease; }
.notif-item:hover { background: rgba(219, 102, 0, 0.08); box-shadow: 0 10px 24px rgba(17, 17, 17, 0.08); transform: translateY(-1px); color: var(--heading-color); }
.notif-item-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #ffffff; color: var(--primary); border: 1px solid rgba(17, 17, 17, 0.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.notif-item-icon.is-alert { background: rgba(220, 53, 69, 0.08); color: #dc3545; border-color: rgba(220, 53, 69, 0.25); }
.notif-item-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.notif-item-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.notif-item-title { font-weight: 700; color: var(--heading-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item-tag { font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: rgba(17, 17, 17, 0.06); color: var(--text-primary); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.notif-item-tag.is-alert { background: rgba(220, 53, 69, 0.12); color: #c03445; }
.notif-item-message { color: var(--text-muted); font-size: 0.92rem; word-break: break-word; }
.notif-empty { padding: 0.5rem 0.75rem; }
.notif-footer { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgba(17, 17, 17, 0.06); display: flex; align-items: center; justify-content: space-between; }
.notif-link { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; font-weight: 700; color: var(--primary); }
.resident-switcher .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: #fff;
}
.resident-switcher .dropdown-toggle:disabled {
  opacity: 0.6;
}
.resident-switcher-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(17, 17, 17, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.resident-switcher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.resident-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.resident-switcher-name {
  flex: 1;
}
.resident-alert-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-weight: 700;
}
.resident-avatar-list { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.resident-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: #fff;
  padding: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(17, 17, 17, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.resident-avatar-btn:hover,
.resident-avatar-btn:focus {
  transform: translateY(-1px);
  border-color: rgba(219, 102, 0, 0.4);
  box-shadow: 0 10px 18px rgba(17, 17, 17, 0.12);
}
.resident-avatar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.resident-avatar-btn--active {
  border-color: rgba(219, 102, 0, 0.7);
  box-shadow: 0 0 0 3px rgba(219, 102, 0, 0.2);
}
.resident-avatar-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: #fff7f1;
  color: #bf5a00;
}
.resident-avatar-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.resident-avatar-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.1);
}
.resident-avatar-indicator--warning {
  background: #fbbf24;
}
.resident-avatar-indicator--danger {
  background: #ef4444;
}
.resident-avatar-count {
  position: absolute;
  bottom: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.user-name { display: flex; flex-direction: column; line-height: 1.1; }
.user-name-primary { font-size: 0.95rem; font-weight: 700; }
.user-name-secondary { font-size: 0.78rem; opacity: 0.7; }
.user-menu-dropdown { min-width: 220px; border: none; border-radius: 0.75rem; padding: 0.5rem 0; }
.user-menu-dropdown .dropdown-item { font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; }
.user-menu-dropdown .dropdown-item i { color: inherit; }
.user-menu-dropdown .dropdown-item:hover { background: rgba(219, 102, 0, 0.08); color: var(--primary); }
.user-menu-dropdown .dropdown-item.text-danger:hover { background: rgba(220, 53, 69, 0.12); color: #dc3545; }
.user-menu .dropdown-header { padding: 0.25rem 1rem 0; }

/* Global skeleton loader */
.skeleton-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.is-mobile-app .skeleton-overlay {
  display: flex;
}

.skeleton-overlay.is-hidden,
body.is-loaded .skeleton-overlay,
body:not(.is-mobile-app) .skeleton-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.skeleton-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.skeleton-block { border-radius: 14px; background: linear-gradient(90deg, #ececec 25%, #f7f7f7 37%, #ececec 63%); background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite; min-height: 90px; box-shadow: 0 8px 20px rgba(17, 17, 17, 0.05); }
.skeleton-topbar { height: 56px; border-radius: 14px; }
.skeleton-sidebar { display: none; }
.skeleton-circle { width: 56px; height: 56px; border-radius: 50%; }

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* --- Shared hero layout for management pages --- */
.page-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  padding: 1.75rem 2rem;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border-muted);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.08);
}

.page-hero::after {
  content: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  color: var(--heading-color);
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark-text);
}

.hero-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  margin: 0;
}

.hero-description {
  margin: 0;
  color: var(--text-secondary);
  max-width: 520px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border-muted);
  min-width: 140px;
}

.hero-pill .pill-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-dark-text);
  font-weight: 600;
}

.hero-pill .pill-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--heading-color);
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-actions .btn {
  border-radius: 999px;
  padding-inline: 1.25rem;
  font-weight: 600;
  box-shadow: none;
}

.hero-actions .btn i {
  margin-right: 0.4rem;
}

.hero-avatar {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.85);
}

/* --- Original Card Styles --- */
.card { border: none; border-radius: 12px; box-shadow: 0 4px 12px var(--shadow-color); background-color: var(--surface); color: inherit; display: flex; flex-direction: column; transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.card-header-pills { display: flex; justify-content: space-between; align-items: center; }
.card-header-pills a, .card-header-pills i { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.card-header-pills i { cursor: pointer; }
.content { background: var(--surface-alt); border-radius: 8px; min-height: 100px; flex-grow: 1; }
.stat-item { line-height: 1.2; }
.staff-member { display: flex; align-items: center; gap: 10px; }
.staff-member img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.resident-icons { display: flex; gap: 8px; align-items: center; }
.resident-icons i { font-size: 40px; }
.resident-orange { color: #fd9c40; } .resident-green { color: #23b56a; }
.nav-pills .nav-link { border-radius: 20px; padding: 4px 12px; font-size: 13px; color: var(--text-secondary); font-weight: 500; transition: all 0.2s ease; }
.nav-pills .nav-link.active { background: var(--primary); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.staff-list-container { max-height: 100%; overflow-y: auto; }
.staff-list { display: flex; flex-direction: column; gap: 1.25rem; }
.staff-member { display: flex; align-items: center; gap: 15px; text-align: left; }
.staff-avatar { width: 45px; height: 45px; border-radius: 50%; background-color: var(--heading-color); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1rem; flex-shrink: 0; border: 2px solid #fff; box-shadow: 0 0 5px rgba(0,0,0,0.2); }
.staff-details { display: flex; flex-direction: column; line-height: 1.3; }
.staff-name { font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.role-tag { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 15px; color: #fff; text-align: center; width: fit-content; }
.role-admin { background-color: #0d6efd; } .role-manager { background-color: #198754; } .role-caregiver { background-color: #0dcaf0; } .role-licensor { background-color: #6f42c1; } .role-pharmacy { background-color: #fd7e14; } .role-default { background-color: #6c757d; }
.card.card-lg { min-height: 280px; }
.card.card-xl { min-height: 350px; }
.dashboard-quick-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.dashboard-quick-action { background-color: var(--primary-light-bg); color: var(--primary-dark-text); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.8rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.dashboard-quick-action i { font-size: 0.85rem; }
.dashboard-quick-action:hover { background-color: var(--primary); color: #ffffff; transform: translateY(-1px); }
.dashboard-scrollable { overflow-y: auto; }
.dashboard-scrollable-md { max-height: 320px; }
.dashboard-scrollable-lg { max-height: 420px; }
.dashboard-scrollable::-webkit-scrollbar { width: 6px; }
.dashboard-scrollable::-webkit-scrollbar-track { background: transparent; }
.dashboard-scrollable::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.15); border-radius: 999px; }
.sidebar-item[data-bs-toggle="collapse"] { position: relative; }
.sidebar-item[data-bs-toggle="collapse"]::after { content: '\f054'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 12px; transition: transform 0.3s ease; font-size: 0.75rem; opacity: 0.75; }
.sidebar-item[data-bs-toggle="collapse"]:not(.collapsed)::after { transform: rotate(90deg); }
.submenu-items { background-color: rgba(0,0,0,0.1); border-radius: 8px; margin: 0 0.5rem 0.5rem; }
.sidebar.expanded .submenu-items, .sidebar.hover-expanded .submenu-items { background-color: transparent; }
.submenu-items .sub-item { padding-top: 0.5rem; padding-bottom: 0.5rem; margin-bottom: 0; }
.submenu-items .sub-item .text { font-size: 14px; opacity: 0; }
.submenu-items .sub-item .icon { display: none; }
.sidebar .submenu-items .sub-item { padding-left: 1rem; text-align: left; }
.sidebar .submenu-items .sub-item .text { opacity: 1; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: var(--scrollbar-track); border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb { background-color: var(--scrollbar-thumb); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
.sidebar::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }

/* Dashboard Resident List Styles */
.resident-list-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.resident-item-dashboard { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text-secondary); background-color: var(--surface); padding: 0.5rem; border-radius: 8px; transition: background-color 0.2s ease; }
.resident-item-dashboard:hover { background-color: var(--surface-alt); }
.resident-avatar-dashboard { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.resident-name-dashboard { font-weight: 500; font-size: 14px; }

/* Medication card */
.medication-card { gap: 0.5rem; }
.medication-card .card-header-pills h6 { display: inline-flex; align-items: center; gap: 0.4rem; }
.medication-card .pill-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
.medication-card .pill-stat { border: 1px solid var(--border-muted); border-radius: 12px; padding: 0.65rem 0.75rem; background: var(--surface); display: flex; align-items: center; justify-content: space-between; }
.medication-card .pill-stat .label { color: var(--text-muted); font-size: 0.85rem; }
.medication-card .pill-stat .value { font-weight: 700; }
.medication-card .list-group-item { border-color: var(--border-muted); }

/* Birthday card */
.birthdays-card h6 { margin-bottom: 0; }
.birthday-section-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.35rem; font-weight: 700; }
.birthday-empty { border: 1px dashed var(--border-muted); padding: 0.75rem; border-radius: 12px; color: var(--text-muted); }

/* Dashboard layout page */
.dashboard-layout-preview .layout-pill { background: var(--surface-muted); border: 1px solid var(--border-muted); border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.45rem; }
.dashboard-layout-preview .layout-card { border: 1px solid var(--border-muted); border-radius: 14px; padding: 0.85rem; background: var(--surface); box-shadow: 0 8px 20px rgba(17, 17, 17, 0.04); display: grid; grid-template-columns: auto auto 1fr auto; gap: 0.75rem; align-items: center; }
.dashboard-layout-preview .layout-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.dashboard-layout-preview .layout-card-item { user-select: none; }
.dashboard-layout-preview .layout-card-ghost { opacity: 0.5; transform: scale(0.98); border: 1px dashed var(--border-muted); }
.dashboard-layout-preview .layout-card-dragging { cursor: grabbing; }
.layout-card-handle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-muted); background: var(--surface-muted); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: grab; }
.layout-card-handle:active { cursor: grabbing; }
.layout-card-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-light-bg); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.layout-card-copy p { line-height: 1.35; }
.dashboard-layout-preview.mobile-mode .layout-card-grid { grid-template-columns: 1fr; }
.dashboard-layout-preview.mobile-mode .layout-card { grid-template-columns: auto 1fr; grid-template-areas: "handle badge" "icon copy"; align-items: flex-start; }
.dashboard-layout-preview.mobile-mode .layout-card-handle { grid-area: handle; }
.dashboard-layout-preview.mobile-mode .layout-card-badge { grid-area: badge; justify-self: end; }
.dashboard-layout-preview.mobile-mode .layout-card-icon { grid-area: icon; }
.dashboard-layout-preview.mobile-mode .layout-card-copy { grid-area: copy; }
.layout-pill-handle { background: var(--primary-light-bg); color: var(--primary-dark-text); border-color: var(--primary); }
.dashboard-layout-settings .list-group-item { border: none; padding: 0.75rem 0; }
.dashboard-layout-settings .list-group { border: none; }
.dashboard-layout-settings .badge { font-weight: 600; }

/* --- Dashboard Notes Card --- */
.list-group-item .note-title-dashboard {
    font-weight: 600;
    color: var(--text-secondary);
    display: block; /* Make title clickable */
}

/* =========================================
   Custom & Animated Facility Switcher (Bootstrap 5 markup)
   ========================================= */

/* Toggle button styling */
#customFacilitySwitcher .dropdown-toggle.btn {
  display: flex;
  align-items: center;
  background-color: var(--surface);
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: none;
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: box-shadow .2s ease, transform .2s ease;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-color, var(--text-primary));
}

/* Lift on hover and when open (Bootstrap sets aria-expanded) */
#customFacilitySwitcher .dropdown-toggle.btn:hover,
#customFacilitySwitcher .dropdown-toggle[aria-expanded="true"] {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,.1);
}

/* Icon color and spacing */
#customFacilitySwitcher .dropdown-toggle i {
  color: var(--primary, #0d6efd);
  margin-right: .35rem;
}

/* Custom caret */
#customFacilitySwitcher .dropdown-toggle::after {
  margin-left: .75rem;
  transition: transform .2s ease;
}

/* Rotate caret when open (use aria-expanded) */
#customFacilitySwitcher .dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* Animated menu */
#customFacilitySwitcher .dropdown-menu {
  border: none;
  border-radius: .75rem;
  box-shadow: 0 10px 30px var(--shadow-color);
  background-color: var(--surface);
  padding: .5rem;
  margin-top: .5rem !important;

  /* animation base */
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;

  /* allow transition while hidden */
  display: block;

  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

/* Expanded state */
#customFacilitySwitcher .dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Items */
#customFacilitySwitcher .dropdown-item {
  padding: .6rem 1rem;
  border-radius: .5rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Active with check */
#customFacilitySwitcher .dropdown-item.active {
  color: var(--primary, #0d6efd);
  background-color: var(--primary-light, rgba(13,110,253,.08));
}

#customFacilitySwitcher .dropdown-item.active::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: .8rem;
}

/* Optional: legacy select look if present elsewhere */
.facility-switcher-container { position: relative; display: flex; align-items: center; }
.facility-switcher-container .facility-icon { position: absolute; left: 10px; color: #6c757d; z-index: 1; }
.facility-switcher-container .form-select { padding-left: 30px; font-weight: 500; border: 1px solid #ced4da; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; }
.facility-switcher-container .form-select:hover { border-color: #86b7fe; }
.facility-switcher-container .form-select:focus { border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 .25rem rgba(13,110,253,.25); }


/* Themes */

/*
========================================
    THEME OVERRIDES
========================================
*/

/* --- Theme: Blue --- */
.theme-blue {
    --primary: #1976d2;
    --primary-light-bg: #e8f1ff;
    --primary-dark-text: #0f4aa3;
    --primary-strong: #1256a8;
    --emar-accent: #1976d2;
    --emar-accent-soft: rgba(25, 118, 210, 0.12);
    --emar-accent-shadow: rgba(25, 118, 210, 0.2);
    --emar-accent-contrast: #0f4aa3;
    --bg: #f5f8ff;
    --surface: #ffffff;
    --surface-alt: #eef3ff;
    --surface-muted: #f4f7ff;
    --border-color: #d6e4ff;
    --border-muted: #e1e9ff;
    --divider-color: #d6e4ff;
    --text-primary: #0c1b3f;
    --text-secondary: #213b63;
    --text-muted: #6277a1;
    --heading-color: #0c1b3f;
    --shadow-color: rgba(25, 118, 210, 0.1);
    --shadow-strong: rgba(25, 118, 210, 0.25);
    --overlay-bg: rgba(12, 27, 63, 0.45);
    --scrollbar-track: #eef3ff;
    --scrollbar-thumb: #c4d5ff;
    --scrollbar-thumb-hover: #aac2ff;
    --input-bg: #ffffff;
    --input-border: #c7d7f5;
    --input-focus-border: #1976d2;
    --table-row-hover: #f0f4ff;
    --mobile-sidebar-bg: #0d47a1;
}

.theme-blue .sidebar {
    background: linear-gradient(180deg, #e9f1ff 0%, #7bb6ff 30%, #0d47a1 100%);
}
.theme-blue .sidebar-link {
    color: #bbdefb; /* Light Blue Text */
}
.theme-blue .sidebar-link:hover,
.theme-blue .sidebar-item.active .sidebar-link {
    color: #ffffff;
    background-color: #1565c0; /* Medium Blue */
}
.theme-blue .topbar {
    background-color: #ffffff;
    background-image: linear-gradient(90deg, #ffffff 0%, #e6f0ff 36%, #8ab8ff 70%, rgba(25, 118, 210, 0.32) 100%);
}
.theme-blue .btn-primary {
    background-color: #1976d2;
    border-color: #1976d2;
}
.theme-blue .btn-primary:hover {
    background-color: #1565c0;
    border-color: #1565c0;
}
.theme-blue .tabs .tab.active {
    border-bottom-color: #1976d2;
    color: #1976d2;
}


/* --- Theme: Green --- */
.theme-green {
    --primary: #1ca97d;
    --primary-light-bg: #e6f6ef;
    --primary-dark-text: #0d5b41;
    --primary-strong: #0f7a57;
    --emar-accent: #388e3c;
    --emar-accent-soft: rgba(56, 142, 60, 0.12);
    --emar-accent-shadow: rgba(56, 142, 60, 0.2);
    --emar-accent-contrast: #1f5e26;
    --bg: #f2faf6;
    --surface: #ffffff;
    --surface-alt: #ecf7f0;
    --surface-muted: #f5fbf8;
    --border-color: #cfe8da;
    --border-muted: #def0e5;
    --divider-color: #cfe8da;
    --text-primary: #0f2c20;
    --text-secondary: #1f4b36;
    --text-muted: #5d7a68;
    --heading-color: #0f2c20;
    --shadow-color: rgba(28, 169, 125, 0.12);
    --shadow-strong: rgba(28, 169, 125, 0.28);
    --overlay-bg: rgba(15, 44, 32, 0.4);
    --scrollbar-track: #ecf7f0;
    --scrollbar-thumb: #c5e2d1;
    --scrollbar-thumb-hover: #abd4bf;
    --input-bg: #ffffff;
    --input-border: #c0dfcd;
    --input-focus-border: #1ca97d;
    --table-row-hover: #eaf5ef;
    --mobile-sidebar-bg: #1b5e20;
}

.theme-green .sidebar {
    background: linear-gradient(180deg, #eaf7ec 0%, #6cce74 30%, #1b5e20 100%);
}
.theme-green .sidebar-link {
    color: #c8e6c9; /* Light Green Text */
}
.theme-green .sidebar-link:hover,
.theme-green .sidebar-item.active .sidebar-link {
    color: #ffffff;
    background-color: #2e7d32; /* Medium Green */
}
.theme-green .topbar {
    background-color: #ffffff;
    background-image: linear-gradient(90deg, #ffffff 0%, #e8f7ea 36%, #8ad394 70%, rgba(56, 142, 60, 0.28) 100%);
}
.theme-green .btn-primary {
    background-color: #388e3c;
    border-color: #388e3c;
}
.theme-green .btn-primary:hover {
    background-color: #2e7d32;
    border-color: #2e7d32;
}
.theme-green .tabs .tab.active {
    border-bottom-color: #388e3c;
    color: #388e3c;
}


/* --- Theme: Dark --- */
.theme-dark {
    --primary: #db6600;
    --primary-light-bg: rgba(219, 102, 0, 0.12);
    --primary-dark-text: #ffb36d;
    --primary-strong: #f08a2e;
    --emar-accent: #ff9d4c;
    --emar-accent-soft: rgba(255, 157, 76, 0.2);
    --emar-accent-shadow: rgba(255, 157, 76, 0.35);
    --emar-accent-contrast: #ffe0c2;
    --bg: #121212;
    --surface: #1e1e1e;
    --surface-alt: #1a1a1a;
    --surface-muted: #181818;
    --border-color: #333333;
    --border-muted: #2a2a2a;
    --divider-color: #333333;
    --text-primary: #e0e0e0;
    --text-secondary: #cfcfcf;
    --text-muted: #9e9e9e;
    --heading-color: #f5f5f5;
    --shadow-color: rgba(0, 0, 0, 0.55);
    --shadow-strong: rgba(0, 0, 0, 0.7);
    --overlay-bg: rgba(0, 0, 0, 0.65);
    --scrollbar-track: #1a1a1a;
    --scrollbar-thumb: #333333;
    --scrollbar-thumb-hover: #444444;
    --input-bg: #333333;
    --input-border: #555555;
    --input-focus-border: #42a5f5;
    --table-row-hover: #1f1f1f;
    --mobile-sidebar-bg: #1e1e1e;
    --mobile-divider-color: #333333;
}

.theme-dark .main-content {
    background: transparent;
}

.theme-dark .sidebar {
    background: linear-gradient(180deg, #2a2a2a 0%, #1e1e1e 55%, #101010 100%);
}

.theme-dark .topbar {
    background-color: var(--surface);
    background-image: linear-gradient(90deg, #1f1f1f 0%, #1a1a1a 45%, rgba(255, 176, 103, 0.25) 100%);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.theme-dark .topbar h5,
.theme-dark .topbar .user span,
.theme-dark .topbar i,
.theme-dark #sidebar-toggle {
    color: var(--text-primary);
}

.theme-dark .search-input-icon {
    color: rgba(255, 255, 255, 0.65);
}

.theme-dark .topbar .form-control {
    background-color: var(--surface-alt);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.theme-dark .topbar .form-control::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.theme-dark .topbar .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 176, 103, 0.15), 0 16px 36px rgba(0, 0, 0, 0.6);
}

.theme-dark .search-toggle-btn,
.theme-dark .topbar-icon-btn {
    background: var(--surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.theme-dark .search-toggle-btn:hover,
.theme-dark .search-toggle-btn:focus,
.theme-dark .topbar-icon-btn:hover,
.theme-dark .topbar-icon-btn:focus {
    background: #262626;
    box-shadow: 0 0 0 4px rgba(255, 176, 103, 0.1), 0 16px 36px rgba(0, 0, 0, 0.6);
}

.theme-dark .calendar-peek-menu {
    background: linear-gradient(180deg, rgba(34, 34, 34, 0.95), #1f1f1f);
    border-color: var(--border-color);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.65);
}
.theme-dark .calendar-peek-cell { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.theme-dark .calendar-peek-cell.is-muted { color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.02); }
.theme-dark .calendar-peek-cell.is-today { background: linear-gradient(145deg, rgba(255, 176, 103, 0.18), rgba(255, 176, 103, 0.08)); border-color: rgba(255, 176, 103, 0.55); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); }

.theme-dark .notif-menu { background: linear-gradient(180deg, rgba(34, 34, 34, 0.96), #1f1f1f); border-color: var(--border-color); box-shadow: 0 18px 36px rgba(0, 0, 0, 0.65); }
.theme-dark .notif-item { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.theme-dark .notif-item:hover { background: rgba(255, 176, 103, 0.12); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55); color: var(--text-primary); }
.theme-dark .notif-item-icon { background: var(--surface-alt); border-color: var(--border-color); color: var(--primary); }
.theme-dark .notif-item-icon.is-alert { background: rgba(220, 53, 69, 0.15); border-color: rgba(220, 53, 69, 0.4); }
.theme-dark .notif-item-message { color: rgba(255, 255, 255, 0.65); }
.theme-dark .notif-link { color: var(--primary); }

.theme-dark .btn-user {
    background: var(--surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.theme-dark .btn-user:hover,
.theme-dark .btn-user[aria-expanded="true"],
.theme-dark .btn-user:focus {
    background: #262626;
    color: var(--text-primary);
    box-shadow: 0 0 0 4px rgba(255, 176, 103, 0.1), 0 16px 36px rgba(0, 0, 0, 0.6);
}

.theme-dark .user-avatar {
    background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

.theme-dark .sidebar-link {
    color: var(--text-secondary);
}

.theme-dark .sidebar-link:hover,
.theme-dark .sidebar-item.active .sidebar-link {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .card {
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-dark .card-header,
.theme-dark .card-footer {
    border-color: var(--border-color);
}

.theme-dark .modal-content {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark .modal-header,
.theme-dark .modal-footer {
    border-color: var(--border-color);
}

.theme-dark .table {
    color: var(--text-primary);
}

.theme-dark .table-hover > tbody > tr:hover > * {
    color: var(--text-primary);
    background-color: var(--table-row-hover);
}

.theme-dark .tabs .tab {
    color: var(--text-secondary);
}

.theme-dark .tabs .tab.active {
    border-bottom-color: #42a5f5;
    color: #42a5f5;
}

.theme-dark .form-control,
.theme-dark .form-select {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--input-border);
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 0.25rem rgba(66, 165, 245, 0.25);
}

.not-found-wrapper {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.not-found-public {
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(219, 102, 0, 0.06) 0%, rgba(219, 102, 0, 0.02) 100%);
}

.not-found-card {
    max-width: 500px;
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    padding: 2.5rem 2rem;
}

.not-found-card .card-title {
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.not-found-card .card-text {
    font-size: 1rem;
    line-height: 1.6;
}

.not-found-icon {
    font-size: 3rem;
    color: var(--primary);
}

.is-mobile-app .mobile-apk-download {
    display: none !important;
}

@media (max-width: 767.98px) {
    .not-found-wrapper {
        min-height: calc(100vh - 120px);
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .not-found-card {
        padding: 2rem 1.5rem;
    }
}
