:root {
  --blue-dark: #0657ab;
  --blue: #0657ab;
  --blue-deep: #04498f;
  --blue-light: #e8f2ff;
  --yellow: #ffd23f;
  --yellow-dark: #d79d00;
  --yellow-soft: #fff7d6;
  --white: #ffffff;
  --bg: #f5f7fb;
  --text: #102033;
  --muted: #6b7c93;
  --border: #e5eaf2;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 10px 28px rgba(6, 87, 171, 0.1);
  --shadow-heavy: 0 20px 60px rgba(6, 87, 171, 0.2);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.material-symbols-rounded {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.site-login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 210, 63, 0.25), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f5f7fb 48%, #eef4fa 100%);
}

.public-header {
  width: 100%;
  background: var(--white);
  border-bottom: 1px solid rgba(229, 234, 242, 0.9);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(6, 87, 171, 0.06);
}

.public-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
}

.public-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-logo-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--yellow), #ffe784);
  color: var(--blue-dark);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  border: 3px solid #fff5bf;
  box-shadow: 0 10px 24px rgba(215, 157, 0, 0.2);
}

.public-logo-text {
  display: grid;
  line-height: 1.05;
}

.public-logo-text strong {
  color: var(--blue-dark);
  font-size: 19px;
  font-weight: 900;
}

.public-logo-text small {
  color: var(--yellow-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-nav a {
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  color: var(--blue-dark);
  transition: 0.22s ease;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.public-nav a:hover,
.public-nav a.active {
  background: var(--yellow);
  color: var(--blue-dark);
  transform: translateY(-2px);
}

.public-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 22px 52px;
}

.login-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow-soft);
  color: var(--blue-dark);
  border: 1px solid rgba(215, 157, 0, 0.22);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 22px;
}

.hero-copy h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(38px, 6vw, 74px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.055em;
}

.hero-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  margin: 24px 0 0;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-features span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-dark);
  box-shadow: 0 10px 26px rgba(6, 87, 171, 0.07);
}

.hero-features .material-symbols-rounded {
  color: var(--yellow-dark);
  font-size: 19px;
}

.login-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(229, 234, 242, 0.95);
  border-radius: 14px;
  padding: 34px;
  box-shadow: var(--shadow-heavy);
  position: relative;
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 7px;
  background: linear-gradient(90deg, var(--yellow), var(--blue));
}

.login-emblem {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #0657ab, #04498f);
  color: var(--yellow);
  border: 6px solid var(--yellow-soft);
  box-shadow: 0 18px 34px rgba(6, 87, 171, 0.18);
}

.login-emblem span {
  font-size: 48px;
}

.login-panel h2 {
  margin: 0;
  text-align: center;
  color: var(--blue-dark);
  font-size: 30px;
  font-weight: 900;
}

.login-subtitle {
  text-align: center;
  margin: 8px 0 24px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  transition: 0.22s ease;
}

.input-group:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(6, 87, 171, 0.12);
  background: var(--white);
}

.input-group span {
  color: var(--blue);
}

.input-group input {
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 15px 0;
}

.input-group input:focus {
  box-shadow: none;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  font-size: 13px;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: var(--blue-dark);
}

.remember-check input {
  width: auto;
}

.login-options a,
.login-extra-links a {
  color: var(--blue);
  font-weight: 900;
}

.submit-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 15px 20px;
  background: linear-gradient(135deg, #0657ab, #04498f);
  color: var(--white);
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(6, 87, 171, 0.22);
  transition: 0.22s ease;
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(6, 87, 171, 0.3);
}

.login-extra-links {
  text-align: center;
  margin-top: 18px;
}

.login-extra-links p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.public-section {
  max-width: 1180px;
  margin: 0 auto 34px;
  padding: 46px 22px;
  text-align: center;
}

.public-section h2 {
  margin: 0 0 12px;
  font-size: 34px;
  color: var(--blue-dark);
  font-weight: 900;
}

.public-section > p {
  max-width: 780px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.8;
}

.yellow-section {
  background: linear-gradient(135deg, var(--yellow-soft), #ffffff);
  border-radius: 14px;
  border: 1px solid rgba(215, 157, 0, 0.18);
}

.public-card-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.public-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: 0.22s ease;
}

.public-card:hover {
  transform: translateY(-5px);
}

.public-card > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: var(--radius);
  margin: 0 auto 14px;
}

.public-card h3 {
  margin: 0 0 8px;
  color: var(--blue-dark);
}

.public-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.public-footer {
  background: var(--blue-dark);
  color: var(--white);
  text-align: center;
  padding: 26px 18px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.public-footer p {
  margin: 5px 0;
}

.shell {
  display: flex;
  min-height: 100vh;
}

:root {
  --sidebar-open-width: 270px;
  --sidebar-closed-width: 92px;
  --sidebar-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-animation-time: 0.36s;
}

.sidebar {
  width: var(--sidebar-open-width);
  background: linear-gradient(180deg, #0657ab, #04498f);
  color: white;
  padding: 18px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition:
    width var(--sidebar-animation-time) var(--sidebar-ease),
    flex-basis var(--sidebar-animation-time) var(--sidebar-ease),
    padding var(--sidebar-animation-time) var(--sidebar-ease),
    box-shadow var(--sidebar-animation-time) var(--sidebar-ease);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 210, 63, 0.75) rgba(255, 255, 255, 0.08);
  will-change: width, flex-basis, padding;
}

.sidebar::-webkit-scrollbar {
  width: 7px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 210, 63, 0.75);
  border-radius: var(--radius);
}

.shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-closed-width);
  padding: 18px 12px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  position: sticky;
  top: -18px;
  z-index: 5;
  background: linear-gradient(180deg, #0657ab 0%, #0657ab 72%, rgba(6, 87, 171, 0) 100%);
  transition:
    justify-content var(--sidebar-animation-time) var(--sidebar-ease),
    margin-bottom var(--sidebar-animation-time) var(--sidebar-ease);
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 190px;
  opacity: 1;
  overflow: hidden;
  transform: translateX(0);
  transition:
    max-width var(--sidebar-animation-time) var(--sidebar-ease),
    opacity 0.22s ease,
    transform var(--sidebar-animation-time) var(--sidebar-ease),
    margin var(--sidebar-animation-time) var(--sidebar-ease);
  will-change: max-width, opacity, transform;
}

.brand-icon {
  min-width: 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--blue-dark);
  border-radius: var(--radius);
  font-weight: 900;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
}

.brand p {
  margin: 3px 0 0;
  opacity: 0.78;
  font-size: 13px;
  white-space: nowrap;
}

.brand-text,
.nav-text {
  display: inline-block;
  width: auto;
  max-width: 170px;
  opacity: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(0);
  transition:
    max-width var(--sidebar-animation-time) var(--sidebar-ease),
    opacity 0.22s ease,
    transform var(--sidebar-animation-time) var(--sidebar-ease);
  will-change: max-width, opacity, transform;
}

.brand-toggle {
  min-width: 36px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: rgba(255, 210, 63, 0.18);
  color: var(--yellow);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease,
    width var(--sidebar-animation-time) var(--sidebar-ease),
    min-width var(--sidebar-animation-time) var(--sidebar-ease),
    height var(--sidebar-animation-time) var(--sidebar-ease);
}

.brand-toggle:hover {
  background: var(--yellow);
  color: var(--blue-dark);
  transform: scale(1.04);
}

.brand-toggle .material-symbols-rounded {
  transition: transform var(--sidebar-animation-time) var(--sidebar-ease);
}

.shell.sidebar-animating .brand-toggle .material-symbols-rounded {
  transform: rotate(180deg) scale(1.05);
}

.shell.sidebar-animating .sidebar {
  pointer-events: none;
}

.shell.sidebar-collapsed .brand {
  justify-content: center;
}

.shell.sidebar-collapsed .brand-left {
  display: flex;
  max-width: 0;
  opacity: 0;
  margin-right: -12px;
  pointer-events: none;
  transform: translateX(-12px);
}

.shell.sidebar-collapsed .brand-toggle {
  min-width: 44px;
  width: 44px;
  height: 44px;
}

.shell.sidebar-collapsed .brand-text,
.shell.sidebar-collapsed .nav-text {
  width: auto;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
}

nav {
  display: grid;
  gap: 8px;
  padding-bottom: 20px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 14px;
  border-radius: var(--radius);
  opacity: 0.88;
  font-weight: 800;
  white-space: nowrap;
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    opacity 0.22s ease,
    transform 0.28s var(--sidebar-ease),
    padding var(--sidebar-animation-time) var(--sidebar-ease),
    gap var(--sidebar-animation-time) var(--sidebar-ease);
}

nav a .material-symbols-rounded {
  flex: 0 0 auto;
  transition: transform 0.28s var(--sidebar-ease);
}

.shell.sidebar-collapsed nav a {
  justify-content: center;
  gap: 0;
  padding: 13px;
}

.shell.sidebar-collapsed nav a .material-symbols-rounded {
  transform: scale(1.08);
}

nav a:hover,
nav a.active {
  background: rgba(255, 210, 63, 0.2);
  color: var(--yellow);
  opacity: 1;
  transform: translateX(4px);
}

.shell.sidebar-collapsed nav a:hover,
.shell.sidebar-collapsed nav a.active {
  transform: translateX(0);
}

main {
  flex: 1;
  padding: clamp(16px, 2vw, 28px);
  min-width: 0;
  display: grid;
  gap: 20px;
  align-content: start;
}

.topbar {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 2vw, 22px);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-top: 5px solid var(--yellow);
}

.topbar h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(20px, 2vw, 28px);
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: var(--radius);
  padding: 10px 14px;
  max-width: 240px;
}

.user-pill strong,
.user-pill small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill small {
  display: block;
  color: var(--muted);
  text-transform: capitalize;
}

.notification-wrap {
  position: relative;
}

.notification-btn {
  position: relative;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--blue-dark);
  cursor: pointer;
  transition: 0.22s ease;
}

.notification-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(215, 157, 0, 0.24);
}

.notification-badge {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 2px solid white;
}

.notification-menu {
  position: absolute;
  right: 0;
  top: 56px;
  width: 390px;
  max-width: calc(100vw - 36px);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-heavy);
  padding: 12px;
  display: none;
  z-index: 30;
  animation: popIn 0.2s ease;
}

.notification-menu.show {
  display: block;
}

.notification-menu-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--border);
}

.notification-menu-header h3 {
  margin: 0;
  color: var(--blue-dark);
}

.notification-menu-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.notification-menu-header > span {
  color: var(--yellow-dark);
}

.mark-read-form {
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
}

.mark-read-form button,
.mark-read-inline button {
  width: 100%;
  border: 1px solid rgba(6, 87, 171, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue-light), #ffffff);
  color: var(--blue-dark);
  padding: 11px 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.22s ease;
  box-shadow: 0 8px 18px rgba(6, 87, 171, 0.06);
}

.mark-read-form button:hover,
.mark-read-inline button:hover {
  background: linear-gradient(135deg, var(--yellow), var(--yellow-soft));
  transform: translateY(-2px);
}

.mark-read-inline {
  margin: 0;
}

.notification-empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 26px 14px;
  color: var(--muted);
}

.notification-empty span {
  color: var(--blue);
  font-size: 34px;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--border);
  transition: 0.2s ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: #f8fbff;
  border-radius: var(--radius);
}

.notification-item strong {
  color: var(--blue-dark);
  font-size: 14px;
}

.notification-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notification-dot {
  min-width: 10px;
  width: 10px;
  height: 10px;
  background: var(--yellow);
  border-radius: 50%;
  margin-top: 5px;
  box-shadow: 0 0 0 4px var(--yellow-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr));
  gap: 16px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2vw, 22px);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: 0.22s ease;
  min-width: 0;
}

.stat-card > div {
  min-width: 0;
}

.stat-card:hover,
.panel:hover {
  transform: translateY(-2px);
}

.stat-card > span {
  min-width: 52px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue-light);
  color: var(--blue);
}

.stat-card.yellow > span {
  background: var(--yellow-soft);
  color: #806000;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.stat-card h3 {
  margin: 5px 0 0;
  color: var(--blue-dark);
  font-size: clamp(24px, 3vw, 30px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 20px;
}

.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2vw, 24px);
  transition: 0.22s ease;
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.panel h3,
.panel-header h3 {
  margin: 0;
  color: var(--blue-dark);
}

.panel p,
.panel-header p {
  color: var(--muted);
}

.panel-header p {
  margin: 5px 0 0;
}

.notification-list {
  display: grid;
  gap: 12px;
}

.schedule-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: 0.22s ease;
}

.schedule-notice:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 87, 171, 0.24);
  box-shadow: 0 10px 24px rgba(6, 87, 171, 0.08);
}

.schedule-date-box {
  min-width: 58px;
  width: 58px;
  border-radius: var(--radius);
  background: var(--blue);
  color: white;
  text-align: center;
  overflow: hidden;
}

.schedule-date-box strong {
  display: block;
  background: var(--yellow);
  color: var(--blue-dark);
  font-size: 12px;
  padding: 5px;
  text-transform: uppercase;
}

.schedule-date-box span {
  display: block;
  font-size: 24px;
  font-weight: 900;
  padding: 7px 0;
}

.schedule-notice h4 {
  margin: 0;
  color: var(--blue-dark);
}

.schedule-notice p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-card {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  border: 1px dashed rgba(6, 87, 171, 0.22);
  border-radius: var(--radius);
  background: #f8fbff;
}

.empty-card span {
  font-size: 42px;
  color: var(--blue);
  margin-bottom: 8px;
}

.empty-card strong {
  color: var(--blue-dark);
}

.empty-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.quick-actions {
  display: grid;
  gap: 12px;
}

.quick-actions a {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: #f8fbff;
  padding: 14px;
  border-radius: var(--radius);
  font-weight: 900;
  color: var(--blue-dark);
  transition: 0.22s ease;
}

.quick-actions a:hover {
  background: var(--yellow-soft);
  border-color: rgba(215, 157, 0, 0.28);
  transform: translateX(4px);
}

.quick-actions span {
  color: var(--blue);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: end;
}

.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.full {
  grid-column: 1 / -1;
}

.form-submit {
  display: flex;
  align-items: flex-end;
}

.form-submit .btn {
  min-height: 48px;
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 13px 14px;
  outline: none;
  font: inherit;
  transition: 0.2s ease;
  min-height: 48px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(6, 87, 171, 0.12);
  background: white;
}

textarea {
  resize: vertical;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 11px 16px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.22s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--blue-dark);
  color: white;
}

.btn.primary:hover {
  background: var(--blue-deep);
}

.btn.ghost {
  background: var(--blue-light);
  color: var(--blue-dark);
  border: 1px solid rgba(6, 87, 171, 0.16);
}

.btn.ghost:hover {
  background: var(--yellow-soft);
}

.btn.danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn.danger:hover {
  background: #fecaca;
}

.btn.small {
  padding: 9px 10px;
  border-radius: var(--radius);
  min-height: 40px;
}

.btn.full {
  width: 100%;
}

button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.yellow-pill {
  background: var(--yellow-soft);
  color: #806000;
  border: 1px solid rgba(215, 157, 0, 0.25);
}

.blue-pill {
  background: var(--blue-light);
  color: var(--blue-dark);
  border: 1px solid rgba(6, 87, 171, 0.18);
}

.password-note {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: auto;
  background: #ffffff;
}

.table-wrap th {
  text-align: left;
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #f8fbff;
}

.table-wrap td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

.table-wrap tbody tr {
  transition: background-color 0.2s ease;
}

.table-wrap tbody tr:hover {
  background: #f8fbff;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.action-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.responsive-card-list {
  display: none;
  gap: 12px;
}

.mini-card {
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(6, 87, 171, 0.06);
}

.mini-card strong {
  color: var(--blue-dark);
}

.mini-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.mini-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#calendar {
  background: white;
}

.fc {
  font-family: "Inter", sans-serif;
}

.fc .fc-toolbar-title {
  color: var(--blue-dark);
  font-weight: 900;
}

.fc .fc-button-primary {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  border-radius: var(--radius);
  font-weight: 800;
}

.fc .fc-button-primary:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.fc .fc-button-primary:disabled {
  background: var(--blue);
  border-color: var(--blue);
  opacity: 0.65;
}

.fc-event {
  border-radius: 8px;
  padding: 4px;
  font-weight: 700;
  cursor: pointer;
}

.modal,
.alert-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 87, 171, 0.56);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.modal.show,
.alert-modal.show {
  display: grid;
  animation: fadeIn 0.2s ease;
}

.modal-card,
.alert-modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow-heavy);
  position: relative;
  animation: popIn 0.25s ease;
}

.form-modal {
  max-width: 560px;
}

.modal-card h3,
.alert-modal-card h3 {
  margin-top: 0;
  color: var(--blue-dark);
}

.modal-subtitle {
  color: var(--muted);
  margin-top: -8px;
}

.modal-close,
.alert-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--blue-light);
  color: var(--blue-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.modal-icon,
.alert-modal-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--blue-dark);
  margin-bottom: 16px;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.alert-modal-card {
  text-align: center;
  border-top: 7px solid var(--blue);
}

.alert-modal-card.success {
  border-top-color: var(--success);
}

.alert-modal-card.error {
  border-top-color: var(--danger);
}

.alert-modal-icon {
  margin: 0 auto 18px;
}

.alert-modal-card.success .alert-modal-icon {
  background: #dcfce7;
  color: #166534;
}

.alert-modal-card.error .alert-modal-icon {
  background: #fee2e2;
  color: #991b1b;
}

.alert-modal-icon span {
  font-size: 38px;
}

.alert-modal-card p {
  margin: 10px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.fade-in {
  animation: fadeSlide 0.45s ease both;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  width: 100%;
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .login-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-copy p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-features {
    justify-content: center;
  }

  .public-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 780px) {
  .public-header-inner {
    flex-direction: column;
  }

  .public-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .public-main {
    padding-top: 42px;
  }

  .login-panel {
    padding: 26px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .shell {
    flex-direction: column;
  }

  .sidebar,
  .shell.sidebar-collapsed .sidebar {
    width: 100%;
    height: auto;
    max-height: none;
    position: relative;
    padding: 16px;
    overflow: hidden;
  }

  .brand {
    top: -16px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    background: linear-gradient(180deg, #0657ab 0%, #0657ab 78%, rgba(6, 87, 171, 0) 100%);
  }

  .shell.sidebar-collapsed .brand-left,
  .brand-left {
    display: flex;
    max-width: 190px;
    opacity: 1;
    margin-right: 0;
    pointer-events: auto;
    transform: none;
  }

  .shell.sidebar-collapsed .brand-text,
  .shell.sidebar-collapsed .nav-text,
  .brand-text,
  .nav-text {
    width: auto;
    max-width: 170px;
    opacity: 1;
    pointer-events: auto;
    overflow: hidden;
    transform: none;
  }

  .sidebar nav {
    display: grid;
    max-height: 620px;
    opacity: 1;
    overflow: hidden;
    transform: translateY(0);
    transition:
      max-height 0.38s var(--sidebar-ease),
      opacity 0.24s ease,
      transform var(--sidebar-animation-time) var(--sidebar-ease),
      padding var(--sidebar-animation-time) var(--sidebar-ease),
      margin var(--sidebar-animation-time) var(--sidebar-ease);
    will-change: max-height, opacity, transform;
  }

  .shell.mobile-nav-collapsed nav {
    display: grid;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .shell.mobile-nav-collapsed .brand {
    margin-bottom: 0;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .shell.sidebar-collapsed nav a,
  nav a {
    justify-content: flex-start;
    gap: 12px;
  }

  main {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .user-pill {
    max-width: calc(100vw - 96px);
  }

  .stats-grid,
  .resource-grid,
  .form-grid,
  .public-card-grid {
    grid-template-columns: 1fr;
  }

  .notification-menu {
    right: auto;
    left: 0;
  }

  .desktop-table {
    display: none;
  }

  .responsive-card-list {
    display: grid;
  }

  .schedule-notice {
    align-items: flex-start;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    gap: 10px;
  }

  .fc .fc-toolbar-title {
    font-size: 18px;
  }

  .modal-card,
  .alert-modal-card {
    padding: 24px;
  }
}

/* Clean mobile + calendar responsive rules */
.calendar-panel {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.calendar-header {
  align-items: center;
  flex-wrap: wrap;
}

.calendar-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.calendar-shell::-webkit-scrollbar {
  height: 8px;
}

.calendar-shell::-webkit-scrollbar-track {
  background: #edf3fa;
  border-radius: 10px;
}

.calendar-shell::-webkit-scrollbar-thumb {
  background: rgba(6, 87, 171, 0.45);
  border-radius: 10px;
}

.export-btn {
  min-height: 44px;
}

.calendar-mobile-note {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--yellow-soft);
  color: var(--blue-dark);
  border: 1px solid rgba(215, 157, 0, 0.22);
  border-radius: var(--radius);
  padding: 11px 13px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 800;
}

.calendar-mobile-note .material-symbols-rounded {
  color: var(--yellow-dark);
}

#calendar,
.fc {
  width: 100%;
  max-width: 100%;
}

#calendar {
  background: white;
}

.fc .fc-toolbar {
  gap: 10px;
  flex-wrap: wrap;
}

.fc .fc-toolbar-chunk {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fc .fc-toolbar-title {
  font-size: clamp(16px, 2.2vw, 24px);
  line-height: 1.25;
  text-align: center;
}

.fc .fc-button {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 13px;
}

.fc .fc-view-harness {
  min-height: 620px;
}

.fc .fc-list {
  border-radius: var(--radius);
  overflow: hidden;
}

.fc .fc-list-event-title,
.fc .fc-list-event-time {
  font-size: 13px;
}

.fc .fc-timegrid-event,
.fc .fc-daygrid-event,
.fc .fc-event-title,
.fc .fc-event-time {
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.disabled-link {
  opacity: 0.45;
  pointer-events: none;
}

.teacher-search-form {
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .calendar-header {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-header .export-btn {
    width: 100%;
  }

  .calendar-mobile-note {
    display: flex;
  }

  .calendar-shell {
    overflow-x: hidden;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .fc .fc-toolbar-chunk {
    justify-content: center;
    width: 100%;
  }

  .fc .fc-toolbar-title {
    width: 100%;
    text-align: center;
  }

  .fc .fc-button {
    flex: 1;
  }

  .fc .fc-view-harness {
    min-height: 540px;
  }
}

@media (max-width: 640px) {
  .calendar-panel {
    padding: 14px;
  }

  .calendar-mobile-note {
    font-size: 12px;
    align-items: flex-start;
  }

  .fc .fc-toolbar-chunk {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .fc .fc-toolbar-chunk:nth-child(2) {
    display: block;
  }

  .fc .fc-toolbar-chunk:nth-child(3) {
    grid-template-columns: 1fr;
  }

  .fc .fc-button {
    width: 100%;
    font-size: 12px;
    padding: 8px 9px;
  }

  .fc .fc-toolbar-title {
    font-size: 16px;
    margin: 4px 0;
  }

  .fc .fc-view-harness {
    min-height: 500px;
  }

  .fc .fc-list-day-cushion {
    padding: 9px 10px;
  }

  .fc .fc-list-event td {
    padding: 9px 8px;
  }

  .fc .fc-list-event-time {
    white-space: nowrap;
    width: 86px;
  }

  .fc .fc-daygrid-day-number {
    font-size: 12px;
    padding: 4px;
  }

  .fc .fc-col-header-cell-cushion {
    font-size: 11px;
    padding: 6px 2px;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 72px;
  }

  .fc .fc-daygrid-event {
    font-size: 11px;
    padding: 2px 3px;
  }
}

@media (max-width: 520px) {
  .public-nav a {
    font-size: 12px;
    padding: 0 10px;
  }

  nav {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    align-items: flex-start;
  }

  .notification-menu {
    width: calc(100vw - 32px);
  }

  .mini-card {
    flex-direction: column;
  }

  .mini-card-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .schedule-notice {
    flex-direction: column;
  }

  .schedule-date-box {
    width: 100%;
  }

  .modal,
  .alert-modal {
    padding: 14px;
  }

  .time-grid {
    grid-template-columns: 1fr;
  }

  .calendar-panel {
    padding: 12px;
  }

  .calendar-mobile-note {
    padding: 10px 11px;
    margin-bottom: 12px;
  }

  .fc .fc-toolbar {
    gap: 8px;
  }

  .fc .fc-toolbar-chunk {
    gap: 6px;
  }

  .fc .fc-button {
    min-height: 36px;
  }

  .fc .fc-view-harness {
    min-height: 470px;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 64px;
  }

  .fc .fc-daygrid-event {
    font-size: 10.5px;
    line-height: 1.2;
  }
}

/* =========================================================
   FTRC FIXES: header alignment, responsive calendar,
   and teacher dashboard full-width notification card
   ========================================================= */

/* Header alignment override */
.public-header-inner {
  max-width: 1140px;
  min-height: 88px;
  padding: 0 22px;
  align-items: center;
  gap: 28px;
}

.public-logo {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}

.public-logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}

.public-logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}

.public-logo-text strong {
  font-size: 20px;
  line-height: 1;
}

.public-logo-text small {
  font-weight: 900;
  letter-spacing: 0.09em;
  margin-top: 5px;
  line-height: 1;
}

.public-nav {
  justify-content: flex-end;
  gap: 18px;
  margin-left: auto;
}

.public-nav a {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 10px;
  font-weight: 900;
  line-height: 1;
}

.public-nav a:hover,
.public-nav a.active {
  transform: translateY(-1px);
}

/* Responsive calendar override */
.calendar-panel {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.calendar-header {
  align-items: center;
  flex-wrap: wrap;
}

.calendar-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

#calendar,
.fc {
  width: 100%;
  max-width: 100%;
}

.fc .fc-toolbar {
  gap: 10px;
  flex-wrap: wrap;
}

.fc .fc-toolbar-chunk {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fc .fc-toolbar-title {
  font-size: clamp(16px, 2.2vw, 24px);
  line-height: 1.25;
  text-align: center;
}

.fc .fc-button {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 13px;
}

.fc .fc-view-harness {
  min-height: 620px;
}

.fc .fc-timegrid-event,
.fc .fc-daygrid-event,
.fc .fc-event-title,
.fc .fc-event-time {
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Teacher dashboard full-width layout */
.teacher-dashboard-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: stretch;
}

.teacher-dashboard-grid > .teacher-notifications-card,
.teacher-dashboard-grid > .teacher-assigned-schedules-card {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
}

.teacher-notifications-card,
.teacher-assigned-schedules-card {
  width: 100% !important;
  max-width: none !important;
}

.teacher-notifications-card .notification-list {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.teacher-notifications-card .empty-card,
.teacher-notifications-card .schedule-notice {
  width: 100%;
  max-width: none;
}

.teacher-notifications-card .empty-card {
  min-height: 155px;
}

@media (max-width: 900px) {
  .calendar-header {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-header .export-btn {
    width: 100%;
  }

  .calendar-mobile-note {
    display: flex;
  }

  .calendar-shell {
    overflow-x: hidden;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .fc .fc-toolbar-chunk {
    justify-content: center;
    width: 100%;
  }

  .fc .fc-toolbar-title {
    width: 100%;
    text-align: center;
  }

  .fc .fc-button {
    flex: 1;
  }

  .fc .fc-view-harness {
    min-height: 540px;
  }
}

@media (max-width: 780px) {
  .public-header-inner {
    min-height: auto;
    padding: 16px 18px;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
  }

  .public-logo {
    justify-content: center;
  }

  .public-nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-left: 0;
  }

  .public-nav a {
    height: 34px;
    font-size: 12px;
    padding: 0 10px;
  }

  .teacher-dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .teacher-dashboard-grid > .teacher-notifications-card,
  .teacher-dashboard-grid > .teacher-assigned-schedules-card {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 640px) {
  .calendar-panel {
    padding: 14px;
  }

  .calendar-mobile-note {
    font-size: 12px;
    align-items: flex-start;
  }

  .fc .fc-toolbar-chunk {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .fc .fc-toolbar-chunk:nth-child(2) {
    display: block;
  }

  .fc .fc-toolbar-chunk:nth-child(3) {
    grid-template-columns: 1fr;
  }

  .fc .fc-button {
    width: 100%;
    font-size: 12px;
    padding: 8px 9px;
  }

  .fc .fc-toolbar-title {
    font-size: 16px;
    margin: 4px 0;
  }

  .fc .fc-view-harness {
    min-height: 500px;
  }

  .fc .fc-list-day-cushion {
    padding: 9px 10px;
  }

  .fc .fc-list-event td {
    padding: 9px 8px;
  }

  .fc .fc-list-event-time {
    white-space: nowrap;
    width: 86px;
  }

  .fc .fc-daygrid-day-number {
    font-size: 12px;
    padding: 4px;
  }

  .fc .fc-col-header-cell-cushion {
    font-size: 11px;
    padding: 6px 2px;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 72px;
  }

  .fc .fc-daygrid-event {
    font-size: 11px;
    padding: 2px 3px;
  }
}

@media (max-width: 520px) {
  .calendar-panel {
    padding: 12px;
  }

  .calendar-mobile-note {
    padding: 10px 11px;
    margin-bottom: 12px;
  }

  .fc .fc-toolbar {
    gap: 8px;
  }

  .fc .fc-toolbar-chunk {
    gap: 6px;
  }

  .fc .fc-button {
    min-height: 36px;
  }

  .fc .fc-view-harness {
    min-height: 470px;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 64px;
  }

  .fc .fc-daygrid-event {
    font-size: 10.5px;
    line-height: 1.2;
  }
}

/* =========================================================
   CLEAN APP LAYOUT FIX
   - Sidebar stays fixed/non-scrollable on desktop.
   - Only main page content scrolls.
   - Mobile keeps normal page flow.
   ========================================================= */
html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body:not(.site-login-page) {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

body:not(.site-login-page) .shell {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

body:not(.site-login-page) .sidebar,
body:not(.site-login-page) .shell.sidebar-collapsed .sidebar {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  position: sticky;
  top: 0;
  overflow: hidden;
  overscroll-behavior: none;
  flex-shrink: 0;
}

body:not(.site-login-page) .sidebar {
  width: var(--sidebar-open-width);
  flex: 0 0 var(--sidebar-open-width);
}

body:not(.site-login-page) .shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-closed-width);
  flex-basis: var(--sidebar-closed-width);
}

body:not(.site-login-page) main {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-content: stretch;
  justify-content: flex-start;
  gap: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: clamp(16px, 2vw, 28px);
  background: var(--bg);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.site-login-page {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

body:not(.site-login-page) main > .topbar,
body:not(.site-login-page) main > section,
body:not(.site-login-page) main > .panel,
body:not(.site-login-page) main > .stats-grid,
body:not(.site-login-page) main > .dashboard-grid {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 780px) {
  html,
  body:not(.site-login-page) {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body:not(.site-login-page) .shell {
    height: auto;
    min-height: 100vh;
    max-height: none;
    overflow: visible;
    flex-direction: column;
  }

  body:not(.site-login-page) .sidebar,
  body:not(.site-login-page) .shell.sidebar-collapsed .sidebar {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    position: relative;
    top: auto;
    overflow: hidden;
  }

  body:not(.site-login-page) main {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    gap: 14px;
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .brand,
  .brand-left,
  .brand-text,
  .nav-text,
  .brand-toggle,
  .brand-toggle .material-symbols-rounded,
  nav,
  nav a,
  nav a .material-symbols-rounded {
    transition: none !important;
    animation: none !important;
  }
}

/* =========================================================
   FTRC notification action badges: new / updated / deleted
   ========================================================= */
.notification-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  margin-right: 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

.notification-action-pill .material-symbols-rounded {
  font-size: 15px;
  line-height: 1;
}

.notification-action-pill.notification-created {
  color: #0657ab;
  background: #fff7d6;
  border: 1px solid rgba(215, 157, 0, 0.28);
}

.notification-action-pill.notification-updated {
  color: #04498f;
  background: #e8f2ff;
  border: 1px solid rgba(6, 87, 171, 0.22);
}

.notification-action-pill.notification-deleted {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid rgba(220, 38, 38, 0.22);
}

.notification-item.notification-updated .notification-dot,
.schedule-notice.notification-updated .schedule-date-box {
  box-shadow: 0 0 0 4px rgba(6, 87, 171, 0.12);
}

.notification-item.notification-deleted .notification-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px #fee2e2;
}

.schedule-notice.notification-deleted {
  background: #fffafa;
  border-color: rgba(220, 38, 38, 0.18);
}

.schedule-notice.notification-deleted .schedule-date-box {
  background: #991b1b;
}

.schedule-notice.notification-updated {
  background: #f8fbff;
  border-color: rgba(6, 87, 171, 0.2);
}

.schedule-notice h4 .notification-action-pill {
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  .notification-action-pill {
    margin-right: 0;
    margin-bottom: 6px;
  }

  .notification-item strong,
  .schedule-notice h4 {
    display: grid;
    gap: 4px;
  }
}

/* =========================================================
   CUSTOM DROPDOWN / DATE PICKER CSS
   - Required by the existing JavaScript generated controls.
   - CSS is kept in assets/app.css, not app.php.
   ========================================================= */
select.ftrc-native-select-hidden,
input[type="date"].ftrc-native-date-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.custom-select-shell,
.custom-date-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 60;
}

.time-grid .custom-select-shell {
  min-width: 0;
}

.custom-select-trigger,
.custom-date-trigger {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcff;
  color: var(--text);
  padding: 13px 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.custom-select-trigger:hover,
.custom-date-trigger:hover,
.custom-select-shell.open .custom-select-trigger,
.custom-date-shell.open .custom-date-trigger {
  border-color: rgba(6, 87, 171, 0.42);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(6, 87, 171, 0.08);
}

.custom-select-trigger:focus,
.custom-date-trigger:focus {
  outline: none;
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(6, 87, 171, 0.14), 0 12px 24px rgba(6, 87, 171, 0.08);
}

.custom-select-label,
.custom-date-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-caret,
.custom-date-caret {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: var(--blue-light);
  flex-shrink: 0;
  transition: transform 0.22s ease, background-color 0.22s ease;
}

.custom-date-caret {
  background: var(--yellow-soft);
  color: var(--yellow-dark);
}

.custom-select-shell.open .custom-select-caret,
.custom-date-shell.open .custom-date-caret {
  transform: rotate(180deg);
  background: var(--yellow);
  color: var(--blue-dark);
}

.custom-select-panel,
.custom-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  z-index: 8000;
  background: #ffffff;
  border: 1px solid rgba(6, 87, 171, 0.14);
  border-radius: 14px;
  box-shadow: 0 20px 46px rgba(6, 87, 171, 0.2);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-10px) scaleY(0.96);
  transform-origin: top center;
  transition: opacity 0.2s ease, max-height 0.24s ease, transform 0.24s ease;
}

.custom-select-shell.open,
.custom-date-shell.open {
  z-index: 9000;
}

.custom-select-shell.open .custom-select-panel {
  opacity: 1;
  max-height: 340px;
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: auto;
  transform: translateY(0) scaleY(1);
}

.custom-date-shell.open .custom-date-popover {
  opacity: 1;
  max-height: 520px;
  overflow: visible;
  pointer-events: auto;
  transform: translateY(0) scaleY(1);
}

.custom-select-shell.drop-up .custom-select-panel,
.custom-date-shell.drop-up .custom-date-popover {
  top: auto;
  bottom: calc(100% + 8px);
  transform-origin: bottom center;
}

.custom-select-panel {
  padding: 6px;
}

.custom-select-panel::-webkit-scrollbar,
.custom-date-popover::-webkit-scrollbar {
  width: 8px;
}

.custom-select-panel::-webkit-scrollbar-track,
.custom-date-popover::-webkit-scrollbar-track {
  background: #edf3fa;
  border-radius: 10px;
}

.custom-select-panel::-webkit-scrollbar-thumb,
.custom-date-popover::-webkit-scrollbar-thumb {
  background: rgba(6, 87, 171, 0.45);
  border-radius: 10px;
}

.custom-select-search-wrap {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 6px 6px 8px;
  margin: -6px -6px 6px;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.94) 100%);
  border-bottom: 1px solid rgba(6, 87, 171, 0.08);
}

.custom-select-search {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(6, 87, 171, 0.16);
  border-radius: 11px;
  background: #f8fbff;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.custom-select-search:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(6, 87, 171, 0.12);
}

.custom-select-empty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.custom-select-option {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  animation: dropdownOptionIn 0.22s ease both;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.custom-select-option:hover,
.custom-select-option:focus {
  outline: none;
  background: var(--blue-light);
  color: var(--blue-dark);
}

.custom-select-option.is-selected {
  background: var(--yellow-soft);
  color: var(--blue-dark);
}

.custom-select-option.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.custom-select-check {
  font-size: 18px;
  color: var(--yellow-dark);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.custom-select-option.is-selected .custom-select-check {
  opacity: 1;
}

.custom-date-popover {
  padding: 14px;
}

.custom-date-header,
.custom-date-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.custom-date-header {
  margin-bottom: 12px;
}

.custom-date-title {
  flex: 1;
  color: var(--blue-dark);
  font-weight: 900;
  text-align: center;
  font-size: 14px;
}

.custom-date-nav,
.custom-date-action {
  border: 1px solid rgba(6, 87, 171, 0.14);
  background: #f8fbff;
  color: var(--blue-dark);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
}

.custom-date-nav {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.custom-date-nav:hover,
.custom-date-action:hover {
  background: var(--yellow-soft);
}

.custom-date-weekdays,
.custom-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.custom-date-weekday {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  padding: 4px 0;
}

.custom-date-day {
  min-height: 34px;
  border: none;
  border-radius: 10px;
  background: #f8fbff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  animation: dateCellDrop 0.2s ease both;
}

.custom-date-day:hover {
  background: var(--blue-light);
  color: var(--blue-dark);
}

.custom-date-day.is-selected {
  background: var(--blue-dark);
  color: #ffffff;
}

.custom-date-day.is-today {
  border: 1px solid rgba(6, 87, 171, 0.28);
}

.custom-date-day.is-muted {
  opacity: 0.38;
  background: #f3f6fb;
}

.custom-date-day.is-disabled {
  opacity: 0.32;
  cursor: not-allowed;
  text-decoration: line-through;
}

.custom-date-actions {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.custom-date-action {
  padding: 9px 12px;
  font-size: 12px;
}

.panel.dropdown-layer-active,
.calendar-panel.dropdown-layer-active,
.modal-card.dropdown-layer-active,
.panel:focus-within {
  position: relative;
  z-index: 7000;
  transform: none !important;
}

.modal,
.alert-modal {
  z-index: 250000;
}

.modal-card,
.alert-modal-card {
  z-index: 250010;
}

.modal.show,
.alert-modal.show {
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px;
}

.modal.show .custom-select-shell,
.modal.show .custom-date-shell,
.alert-modal.show .custom-select-shell,
.alert-modal.show .custom-date-shell {
  z-index: 250020;
}

.modal.show .custom-select-shell.open,
.modal.show .custom-date-shell.open,
.alert-modal.show .custom-select-shell.open,
.alert-modal.show .custom-date-shell.open {
  z-index: 250030;
}

.modal.show .custom-select-panel,
.modal.show .custom-date-popover,
.alert-modal.show .custom-select-panel,
.alert-modal.show .custom-date-popover {
  z-index: 250040;
}

@keyframes dropdownOptionIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dateCellDrop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes calendarContentDrop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Rows-per-page stays native; it must not become the animated custom dropdown. */
.page-limit-form .custom-select-shell,
.page-limit-form .custom-select-trigger,
.page-limit-form .custom-select-panel {
  display: none !important;
}

.page-limit-form select.page-limit-select,
.page-limit-form select.page-limit-select.ftrc-native-select-hidden,
select.page-limit-select[data-native-select="true"] {
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  display: inline-block !important;
  width: auto !important;
  min-width: 112px !important;
  max-width: 150px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 7px 9px !important;
  margin: 0 !important;
  border: 1px solid rgba(6, 87, 171, 0.16) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: var(--text) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}

/* =========================================================
   ORDINARY TABLE LAYOUT - REPLACED, NOT OVERRIDDEN
   - Removed the old forced min-height/flex table blocks.
   - Card height now follows the actual table height.
   - Table cards are 100% width.
   - Wide tables use native horizontal scroll inside .table-wrap.
   ========================================================= */
.panel,
.page-fill-panel,
.table-panel,
section.panel:has(.table-wrap),
section.panel:has(.pagination-row) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  box-sizing: border-box !important;
}

body:not(.site-login-page) main > section.panel,
body:not(.site-login-page) main > section.panel:last-of-type,
body:not(.site-login-page) main > section.panel.page-fill-panel,
body:not(.site-login-page) main > section.panel.has-pagination,
body:not(.site-login-page) main > section.panel:has(.table-wrap),
body:not(.site-login-page) main > section.panel:has(.pagination-row),
body:not(.site-login-page) main > section.panel.page-fill-panel:last-of-type,
body:not(.site-login-page) main > section.panel.has-pagination:last-of-type,
body:not(.site-login-page) main > section.panel:has(.table-wrap):last-of-type {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  display: block !important;
  overflow: visible !important;
}

body.app-page-dashboard main > section.panel:has(.table-wrap),
body.app-page-dashboard main > section.dashboard-schedule-panel,
body.app-page-dashboard .dashboard-schedule-panel {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  display: block !important;
  overflow: hidden !important;
}

.table-wrap,
.table-wrap.desktop-table,
.desktop-table.table-wrap,
.panel > .table-wrap,
.page-fill-panel > .table-wrap,
.dashboard-schedule-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  cursor: auto !important;
  user-select: auto !important;
  overscroll-behavior: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.table-wrap::before,
.table-wrap::after,
.interactive-table-wrap::before,
.interactive-table-wrap::after {
  content: none !important;
  display: none !important;
}

.table-wrap table,
.table-wrap.desktop-table table,
.panel > .table-wrap table,
.page-fill-panel > .table-wrap table,
.dashboard-schedule-table-wrap table {
  width: 100% !important;
  min-width: 900px !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  table-layout: auto !important;
  background: #ffffff !important;
}

body.app-page-dashboard .table-wrap table,
body.app-page-dashboard .dashboard-schedule-table-wrap table {
  min-width: 1040px !important;
}

body.app-page-admins .table-wrap table {
  min-width: 1080px !important;
}

body.app-page-teachers .table-wrap table {
  min-width: 860px !important;
}

body.app-page-subjects .table-wrap table {
  min-width: 720px !important;
}

body.app-page-locations .table-wrap table {
  min-width: 860px !important;
}

body.app-page-schedules .table-wrap table {
  min-width: 1120px !important;
}

.table-wrap thead,
.table-wrap thead th,
.table-wrap th,
.table-wrap td,
.table-wrap tbody tr,
.table-wrap tbody tr:hover,
.table-wrap tbody tr.table-row-active {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  transform: none !important;
  box-shadow: none !important;
}

.table-wrap thead {
  display: table-header-group !important;
}

.table-wrap thead th,
.table-wrap th {
  text-align: left !important;
  padding: 14px !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  border-bottom: 1px solid var(--border) !important;
  background: #f8fbff !important;
  white-space: nowrap !important;
}

.table-wrap td {
  padding: 15px 14px !important;
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  border-bottom: 1px solid var(--border) !important;
  background: transparent !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.table-wrap tbody tr {
  cursor: default !important;
  transition: background-color 0.18s ease !important;
}

.table-wrap tbody tr:hover {
  background: #f8fbff !important;
}

.table-wrap tbody tr.table-row-active {
  background: transparent !important;
}

.table-wrap td.empty {
  height: auto !important;
  min-height: 0 !important;
  text-align: center !important;
  color: var(--muted) !important;
  padding: 30px !important;
  white-space: normal !important;
  background: #ffffff !important;
}

.table-wrap .action-row,
.action-row {
  position: static !important;
  z-index: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.table-wrap .action-row form,
.action-row form {
  margin: 0 !important;
  display: inline-flex !important;
}

.responsive-card-list {
  display: none !important;
}

.desktop-table,
.table-wrap.desktop-table {
  display: block !important;
}

.pagination-row {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
  margin: 14px 0 0 !important;
  padding: 14px 0 0 !important;
  border-top: 1px solid var(--border) !important;
  background: transparent !important;
  box-sizing: border-box !important;
}

.pagination-info {
  flex: 1 1 auto !important;
  min-width: 220px !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.45 !important;
}

.pagination-controls,
.pagination-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  min-width: 0 !important;
}

.page-limit-form {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 6px 8px !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  background: #f8fbff !important;
  box-shadow: 0 8px 18px rgba(6, 87, 171, 0.06) !important;
}

.page-limit-form label {
  flex: 0 0 auto !important;
  margin: 0 !important;
  color: var(--blue-dark) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

@media (max-width: 780px) {
  .desktop-table,
  .table-wrap.desktop-table,
  .table-wrap {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  .responsive-card-list {
    display: none !important;
  }

  .table-wrap table,
  body.app-page-dashboard .table-wrap table,
  body.app-page-admins .table-wrap table,
  body.app-page-teachers .table-wrap table,
  body.app-page-subjects .table-wrap table,
  body.app-page-locations .table-wrap table,
  body.app-page-schedules .table-wrap table {
    min-width: 760px !important;
  }

  .pagination-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .pagination-info,
  .pagination-controls,
  .pagination-actions,
  .page-limit-form {
    width: 100% !important;
    min-width: 0 !important;
  }

  .pagination-controls {
    justify-content: stretch !important;
  }

  .page-limit-form {
    justify-content: space-between !important;
  }

  .pagination-actions {
    justify-content: flex-end !important;
  }
}

/* =========================================================
   CALENDAR PROTECTION
   FullCalendar uses its own internal tables. App table rules
   are scoped to .table-wrap, and this guard keeps calendar intact.
   ========================================================= */
.calendar-panel,
.calendar-shell,
#calendar {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.calendar-panel .table-wrap,
.calendar-shell .table-wrap {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.calendar-panel .fc,
.calendar-shell .fc,
#calendar .fc,
.calendar-panel .fc *,
.calendar-shell .fc *,
#calendar .fc * {
  box-sizing: border-box;
}

.calendar-panel .fc table,
.calendar-shell .fc table,
#calendar .fc table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: transparent !important;
}

.calendar-panel .fc th,
.calendar-panel .fc td,
.calendar-shell .fc th,
.calendar-shell .fc td,
#calendar .fc th,
#calendar .fc td {
  position: static !important;
  z-index: auto !important;
  height: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  border-bottom: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  vertical-align: top !important;
}

.calendar-panel .fc tbody tr,
.calendar-panel .fc tbody tr:hover,
.calendar-shell .fc tbody tr,
.calendar-shell .fc tbody tr:hover,
#calendar .fc tbody tr,
#calendar .fc tbody tr:hover {
  cursor: auto !important;
  transform: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.calendar-panel .fc .fc-scrollgrid,
.calendar-panel .fc .fc-scrollgrid table,
.calendar-panel .fc .fc-col-header,
.calendar-panel .fc .fc-daygrid-body,
.calendar-panel .fc .fc-timegrid-body,
.calendar-shell .fc .fc-scrollgrid,
.calendar-shell .fc .fc-scrollgrid table,
.calendar-shell .fc .fc-col-header,
.calendar-shell .fc .fc-daygrid-body,
.calendar-shell .fc .fc-timegrid-body,
#calendar .fc .fc-scrollgrid,
#calendar .fc .fc-scrollgrid table,
#calendar .fc .fc-col-header,
#calendar .fc .fc-daygrid-body,
#calendar .fc .fc-timegrid-body {
  width: 100% !important;
}

.calendar-panel .fc .fc-col-header-cell-cushion,
.calendar-panel .fc .fc-daygrid-day-number,
.calendar-shell .fc .fc-col-header-cell-cushion,
.calendar-shell .fc .fc-daygrid-day-number,
#calendar .fc .fc-col-header-cell-cushion,
#calendar .fc .fc-daygrid-day-number {
  color: inherit;
  text-decoration: none;
}

.calendar-panel .fc .fc-list-event td,
.calendar-shell .fc .fc-list-event td,
#calendar .fc .fc-list-event td {
  padding: 9px 8px !important;
}
