:root {
  --sms-sidebar-width: 250px;
  --sms-primary: #4f46e5;
  --sms-bg: #f4f6fb;
  --sms-card-bg: #ffffff;
  --sms-border: #e6e9f2;
  --sms-text-muted: #6b7280;
}

[data-bs-theme="dark"] {
  --sms-bg: #0f1420;
  --sms-card-bg: #161c2c;
  --sms-border: #232a3d;
  --sms-text-muted: #9aa4b8;
}

body {
  background: var(--sms-bg);
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

.app-topbar {
  background: var(--sms-card-bg);
  border-bottom: 1px solid var(--sms-border);
  z-index: 1030;
}

.app-topbar .navbar-brand {
  max-width: 40vw;
  overflow: hidden;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .app-topbar .navbar-brand {
    max-width: 32vw;
  }
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 56px);
}

.app-sidebar {
  width: var(--sms-sidebar-width);
  flex-shrink: 0;
  background: var(--sms-card-bg);
  border-right: 1px solid var(--sms-border);
}

.app-sidebar .nav-link {
  color: var(--sms-text-muted);
  border-radius: .5rem;
  font-weight: 500;
}

.app-sidebar .nav-link.active,
.app-sidebar .nav-link:hover {
  background: var(--sms-primary);
  color: #fff;
}

.app-content {
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
}

.app-footer {
  background: var(--sms-card-bg);
  border-top: 1px solid var(--sms-border);
}

.card {
  background: var(--sms-card-bg);
  border: 1px solid var(--sms-border);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #818cf8 100%);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: 1rem;
  box-shadow: 0 20px 45px rgba(15, 20, 32, .25);
}

.calendar-table td {
  vertical-align: middle;
  position: relative;
  height: 2.1rem;
}

.calendar-today {
  background: var(--sms-primary);
  color: #fff;
  border-radius: .4rem;
  font-weight: 600;
}

.calendar-has-event {
  cursor: default;
}

.calendar-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f59e0b;
  margin: 2px auto 0;
}

.calendar-today .calendar-dot {
  background: #fff;
}

.widget-loading {
  position: relative;
  min-height: 160px;
}

.widget-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--sms-border) 25%, rgba(120, 130, 160, .18) 50%, var(--sms-border) 75%);
  background-size: 200% 100%;
  animation: sms-shimmer 1.2s ease-in-out infinite;
  border-radius: .5rem;
}

.widget-loading.is-loaded::before {
  content: none;
}

@keyframes sms-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform .2s ease-in-out;
    z-index: 1020;
    /* Without this the fixed-height sidebar simply clips any nav items past
       the viewport bottom with no way to reach them — on a module list this
       long, that hides roughly half the nav on a phone. */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
}
