/*
 * SNES eLeave — responsive application layout
 * Additive presentation layer. Existing forms, URLs, permissions, and data logic remain authoritative.
 */

:root {
  --snes-layout-speed: 200ms;
  --snes-layout-sidebar: 272px;
  --snes-layout-mobile-nav: 76px;
}

.snes-app-ready {
  background-color: var(--snes-canvas);
}

.snes-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
}

.snes-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* Compact application header */

.snes-app-ready .utility-header {
  flex-wrap: nowrap;
  min-height: 68px;
  padding: 10px 16px;
}

.snes-app-ready .top-brand {
  gap: 10px;
  min-width: 0;
}

.snes-app-ready .brand-mark {
  flex-basis: 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.snes-app-ready .brand-mark img {
  width: 42px;
  height: 42px;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.snes-app-ready .top-brand-title {
  display: grid;
  min-width: 0;
  line-height: 1.12;
  white-space: normal;
}

.snes-app-ready .top-brand-title strong {
  overflow: hidden;
  color: var(--snes-navy-950);
  font-size: clamp(12px, 3.5vw, 16px);
  font-weight: 850;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.snes-app-ready .top-brand-title span {
  color: var(--snes-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.snes-app-ready .utility-links {
  display: block;
  width: auto;
  min-width: auto;
  padding: 0;
  border: 0;
}

.snes-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.snes-icon-button,
.snes-profile-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--snes-navy-800);
  background: #fff;
  border: 1px solid var(--snes-line);
  border-radius: 14px;
  cursor: pointer;
  transition:
    color var(--snes-layout-speed) ease,
    background var(--snes-layout-speed) ease,
    border-color var(--snes-layout-speed) ease,
    box-shadow var(--snes-layout-speed) ease,
    transform var(--snes-layout-speed) ease;
}

.snes-icon-button:hover,
.snes-profile-button:hover {
  color: var(--snes-blue-700);
  background: var(--snes-sky-50);
  border-color: #bfdbfe;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.11);
}

.snes-notification-badge {
  position: absolute;
  top: 5px;
  right: 4px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  background: var(--snes-red-600);
  border: 2px solid #fff;
  border-radius: 999px;
}

.snes-profile-control {
  position: relative;
}

.snes-profile-button {
  gap: 6px;
  padding: 3px 6px 3px 3px;
  border-radius: 999px;
}

.snes-profile-button > .snes-icon {
  width: 16px;
  height: 16px;
}

.snes-profile-initial {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  background: linear-gradient(145deg, var(--snes-navy-800), var(--snes-blue-500));
  border-radius: 50%;
}

.snes-profile-label {
  display: none;
  max-width: 130px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.snes-profile-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 120;
  display: grid;
  width: min(275px, calc(100vw - 32px));
  gap: 5px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--snes-line);
  border-radius: 17px;
  box-shadow: var(--snes-shadow-md);
  animation: snes-menu-in var(--snes-layout-speed) ease both;
}

.snes-profile-menu .signed-in-user {
  display: block;
  max-width: none;
  margin: 0 0 3px;
  padding: 10px 11px;
  overflow: hidden;
  color: var(--snes-navy-800);
  font-size: 11px;
  text-overflow: ellipsis;
  background: var(--snes-sky-50);
  border: 0;
  border-radius: 11px;
}

.snes-profile-menu > a,
.snes-profile-menu > button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--snes-navy-800);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
}

.snes-profile-menu > a:hover,
.snes-profile-menu > button:hover {
  color: var(--snes-blue-700);
  background: var(--snes-sky-50);
}

/* Desktop sidebar */

.snes-app-sidebar {
  display: none;
}

.snes-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.snes-sidebar-brand img {
  width: 54px;
  height: 54px;
  padding: 3px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.snes-sidebar-brand span {
  display: grid;
  min-width: 0;
}

.snes-sidebar-brand strong {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.snes-sidebar-brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 700;
}

.snes-sidebar-role {
  margin: 25px 6px 9px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.snes-sidebar-nav,
.snes-sidebar-account {
  display: grid;
  gap: 5px;
}

.snes-sidebar-nav a,
.snes-sidebar-account a,
.snes-sidebar-account button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  transition:
    color var(--snes-layout-speed) ease,
    background var(--snes-layout-speed) ease,
    border-color var(--snes-layout-speed) ease,
    transform var(--snes-layout-speed) ease;
}

.snes-sidebar-nav a:hover,
.snes-sidebar-account a:hover,
.snes-sidebar-account button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.snes-sidebar-nav a.active,
.snes-sidebar-nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.88), rgba(13, 148, 136, 0.78));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 11px 26px rgba(0, 0, 0, 0.18);
}

.snes-sidebar-account {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

/* Welcome panel and shortcut cards */

.snes-app-ready .date-row {
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.snes-welcome-copy {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
}

.snes-welcome-copy > span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.snes-welcome-copy h1 {
  margin: 1px 0 3px;
  color: #fff;
  font-size: clamp(24px, 7vw, 37px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.snes-welcome-copy p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.snes-hero-date {
  flex: 0 0 auto;
  min-width: 116px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  backdrop-filter: blur(7px);
}

.snes-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.snes-quick-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 104px;
  padding: 14px;
  color: var(--snes-navy-900);
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  box-shadow: var(--snes-shadow-sm);
  transition:
    transform var(--snes-layout-speed) ease,
    box-shadow var(--snes-layout-speed) ease,
    border-color var(--snes-layout-speed) ease;
}

.snes-quick-card > .snes-icon:first-child {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
}

.snes-quick-card > .snes-icon:last-child {
  display: none;
  width: 17px;
  height: 17px;
  color: #94a3b8;
}

.snes-quick-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.snes-quick-card strong {
  color: var(--snes-navy-900);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.snes-quick-card small {
  margin-top: 4px;
  color: var(--snes-muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
}

.snes-quick-card.tone-green > .snes-icon:first-child {
  color: var(--snes-teal-700);
  background: var(--snes-teal-100);
}

.snes-quick-card.tone-blue > .snes-icon:first-child {
  color: var(--snes-blue-700);
  background: var(--snes-sky-100);
}

.snes-quick-card.tone-purple > .snes-icon:first-child {
  color: #7c3aed;
  background: #ede9fe;
}

.snes-quick-card.tone-amber > .snes-icon:first-child {
  color: #b45309;
  background: #fef3c7;
}

.snes-admin-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.snes-metric-card {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  gap: 10px;
  min-height: 112px;
  padding: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 19px;
  box-shadow: var(--snes-shadow-sm);
}

.snes-metric-card > .snes-icon {
  width: 39px;
  height: 39px;
  padding: 9px;
  color: var(--snes-blue-700);
  background: var(--snes-sky-100);
  border-radius: 12px;
}

.snes-metric-card.tone-teal > .snes-icon {
  color: var(--snes-teal-700);
  background: var(--snes-teal-100);
}

.snes-metric-card.tone-purple > .snes-icon {
  color: #7c3aed;
  background: #ede9fe;
}

.snes-metric-card.tone-amber > .snes-icon {
  color: #b45309;
  background: #fef3c7;
}

.snes-metric-card > span {
  display: grid;
  align-content: start;
  min-width: 0;
}

.snes-metric-card small {
  color: var(--snes-muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.snes-metric-card strong {
  margin-top: 3px;
  color: var(--snes-navy-900);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.035em;
}

.snes-metric-card em {
  margin-top: 6px;
  color: var(--snes-muted);
  font-size: 9px;
  font-style: normal;
  line-height: 1.3;
}

.snes-admin-dashboard-main,
.snes-admin-dashboard-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.snes-admin-dashboard-main {
  grid-column: 1 / -1;
}

/* Mobile bottom navigation */

.snes-mobile-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 150;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: calc(var(--snes-layout-mobile-nav) + env(safe-area-inset-bottom));
  padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 19px 19px 0 0;
  box-shadow: 0 -10px 30px rgba(13, 39, 78, 0.11);
  backdrop-filter: blur(16px);
}

.snes-mobile-nav a,
.snes-mobile-nav button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 55px;
  padding: 5px 2px 3px;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: #77869a;
  font-size: 9px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: color var(--snes-layout-speed) ease, background var(--snes-layout-speed) ease;
}

.snes-mobile-nav .snes-icon {
  width: 21px;
  height: 21px;
}

.snes-mobile-nav a.active,
.snes-mobile-nav a[aria-current="page"] {
  color: var(--snes-blue-700);
  background: var(--snes-sky-50);
}

.snes-mobile-nav a.active::after,
.snes-mobile-nav a[aria-current="page"]::after {
  position: absolute;
  right: 28%;
  bottom: 1px;
  left: 28%;
  height: 3px;
  content: "";
  background: var(--snes-blue-600);
  border-radius: 999px;
}

.snes-app-ready .main-area {
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.snes-app-ready .site-footer {
  display: none;
}

/* Bottom sheets */

body.snes-sheet-open {
  overflow: hidden;
}

.snes-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  align-items: end;
  padding: 12px 0 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity var(--snes-layout-speed) ease;
}

.snes-sheet-backdrop.is-open {
  opacity: 1;
}

.snes-bottom-sheet {
  width: min(100%, 560px);
  max-height: min(86svh, 720px);
  margin: 0 auto;
  padding: 8px 17px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 55px rgba(8, 27, 54, 0.2);
  transform: translateY(24px);
  transition: transform var(--snes-layout-speed) ease;
}

.snes-sheet-backdrop.is-open .snes-bottom-sheet {
  transform: translateY(0);
}

.snes-sheet-handle {
  width: 42px;
  height: 5px;
  margin: 2px auto 11px;
  background: #d7e0ec;
  border-radius: 999px;
}

.snes-bottom-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 13px;
  border-bottom: 1px solid var(--snes-line);
}

.snes-bottom-sheet > header span {
  color: var(--snes-blue-600);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.snes-bottom-sheet > header h2 {
  margin: 1px 0 0;
  color: var(--snes-navy-950);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.snes-sheet-close {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--snes-muted);
  background: #f1f5f9;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

.snes-more-links,
.snes-more-account {
  display: grid;
  gap: 6px;
  padding: 12px 0;
}

.snes-more-account {
  border-top: 1px solid var(--snes-line);
}

.snes-more-links a,
.snes-more-account a,
.snes-more-account button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 10px;
  color: var(--snes-navy-800);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
}

.snes-more-links a .snes-icon:first-child,
.snes-more-account a .snes-icon:first-child,
.snes-more-account button .snes-icon:first-child {
  width: 38px;
  height: 38px;
  padding: 9px;
  color: var(--snes-blue-700);
  background: var(--snes-sky-50);
  border-radius: 12px;
}

.snes-more-links a.active {
  color: var(--snes-blue-700);
  background: var(--snes-sky-50);
  border-color: #dbeafe;
}

.snes-more-logout {
  color: #b91c1c !important;
}

.snes-day-list {
  display: grid;
  gap: 9px;
  padding-top: 13px;
}

.snes-day-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: linear-gradient(145deg, #fff, var(--snes-sky-50));
  border: 1px solid #dbeafe;
  border-radius: 15px;
}

.snes-day-list article > .snes-icon {
  width: 42px;
  height: 42px;
  padding: 10px;
  color: var(--snes-teal-700);
  background: var(--snes-teal-100);
  border-radius: 13px;
}

.snes-day-list article > span {
  display: grid;
  min-width: 0;
}

.snes-day-list strong {
  overflow: hidden;
  color: var(--snes-navy-900);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
}

.snes-day-list small {
  margin-top: 2px;
  color: var(--snes-muted);
  font-size: 10px;
}

.snes-day-empty {
  margin-top: 13px;
  padding: 22px 14px;
  color: var(--snes-muted);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 15px;
}

/* Responsive calendar behavior */

.snes-calendar-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.snes-calendar-dots i {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--snes-blue-500);
  border-radius: 50%;
}

.snes-calendar-dots i:nth-child(2) {
  background: var(--snes-teal-600);
}

.snes-calendar-dots i:nth-child(3) {
  background: #8b5cf6;
}

.employee-calendar-page .database-header {
  margin-bottom: 16px;
}

.snes-employee-calendar-layout {
  display: grid;
  gap: 15px;
}

.snes-employee-calendar-card,
.snes-selected-day-card {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--snes-line);
  border-radius: 19px;
  box-shadow: var(--snes-shadow-sm);
}

.snes-employee-calendar-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.snes-employee-calendar-toolbar h2 {
  margin: 0;
  color: var(--snes-navy-950);
  font-size: clamp(17px, 5vw, 25px);
  font-weight: 900;
  text-align: center;
  letter-spacing: -0.03em;
}

.snes-employee-calendar-toolbar button,
.snes-calendar-today {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  color: var(--snes-navy-800);
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--snes-line);
  border-radius: 13px;
  cursor: pointer;
  transition:
    color var(--snes-layout-speed) ease,
    background var(--snes-layout-speed) ease,
    border-color var(--snes-layout-speed) ease;
}

.snes-calendar-today {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 10px;
  padding: 9px 13px;
  color: var(--snes-blue-700);
  background: var(--snes-sky-50);
  border-color: #dbeafe;
}

.snes-employee-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.snes-calendar-weekday {
  padding: 5px 1px;
  color: var(--snes-muted);
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}

.snes-employee-calendar-day {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  min-height: 55px;
  padding: 5px 2px;
  color: var(--snes-navy-800);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition:
    color var(--snes-layout-speed) ease,
    background var(--snes-layout-speed) ease,
    border-color var(--snes-layout-speed) ease,
    transform var(--snes-layout-speed) ease;
}

.snes-employee-calendar-day:hover {
  background: var(--snes-sky-50);
  border-color: #dbeafe;
}

.snes-employee-calendar-day.outside-month {
  color: #a8b3c2;
  background: #fafbfd;
}

.snes-employee-calendar-day.is-today {
  border-color: var(--snes-blue-500);
  box-shadow: inset 0 0 0 1px var(--snes-blue-500);
}

.snes-employee-calendar-day.is-selected {
  color: #fff;
  background: linear-gradient(145deg, var(--snes-navy-800), var(--snes-blue-600));
  border-color: transparent;
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.2);
}

.snes-employee-calendar-day.is-selected .snes-calendar-dots i {
  background: #fff;
}

.snes-employee-calendar-day small {
  color: inherit;
  font-size: 7px;
  font-weight: 850;
}

.snes-employee-calendar-number {
  font-size: 12px;
  font-weight: 850;
}

.snes-calendar-loading {
  grid-column: 1 / -1;
  min-height: 260px;
  padding: 80px 14px;
  color: var(--snes-muted);
  font-size: 12px;
  text-align: center;
}

.snes-calendar-loading.is-error {
  color: #b91c1c;
}

.snes-selected-day-card > header span {
  color: var(--snes-blue-600);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.snes-selected-day-card > header h2 {
  margin: 2px 0 0;
  color: var(--snes-navy-950);
  font-size: clamp(19px, 5.5vw, 27px);
  font-weight: 900;
  letter-spacing: -0.035em;
}

/* Existing dialogs become contemporary sheets on small screens */

.snes-app-ready .modal-backdrop {
  padding: 12px 0 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: none;
}

.snes-app-ready .modal-backdrop:not([hidden]) {
  animation: snes-backdrop-in var(--snes-layout-speed) ease both;
}

.snes-app-ready .modal {
  width: min(100%, 720px);
  max-height: 88svh;
  border-radius: 24px 24px 0 0;
  animation: snes-sheet-in var(--snes-layout-speed) ease both;
}

/* Mobile calendar cells show indicators; details live in a readable sheet. */

@media (max-width: 1023px) {
  /* The fixed bottom navigation replaces the legacy horizontal menu. */
  .snes-app-ready .primary-nav {
    display: none;
  }

  .snes-app-ready .primary-nav-inner {
    gap: 0;
  }
}

@media (max-width: 767px) {
  .snes-app-ready .action-button,
  .snes-app-ready .compact-button,
  .snes-app-ready .calendar-tool-button {
    min-height: 44px;
  }

  .snes-app-ready .leave-calendar-card {
    padding: 13px;
  }

  .snes-app-ready .calendar-scroll-shell {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .snes-app-ready .leave-calendar {
    min-width: 0;
  }

  .snes-app-ready .calendar-weekdays {
    font-size: 8px;
    letter-spacing: 0;
  }

  .snes-app-ready .calendar-weekdays > div {
    min-width: 0;
    padding: 8px 1px 7px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
  }

  .snes-app-ready .calendar-grid {
    grid-template-rows: repeat(6, minmax(62px, auto));
  }

  .snes-app-ready .calendar-grid[data-weeks="4"] {
    grid-template-rows: repeat(4, minmax(62px, auto));
  }

  .snes-app-ready .calendar-grid[data-weeks="5"] {
    grid-template-rows: repeat(5, minmax(62px, auto));
  }

  .snes-app-ready .calendar-grid[data-weeks="6"] {
    grid-template-rows: repeat(6, minmax(62px, auto));
  }

  .snes-app-ready .calendar-day {
    position: relative;
    min-width: 0;
    min-height: 62px;
    padding: 5px 2px;
    overflow: hidden;
    border-radius: 9px;
    cursor: pointer;
  }

  .snes-app-ready .calendar-day-events,
  .snes-app-ready .calendar-leave-entry {
    display: none !important;
  }

  .snes-app-ready .calendar-day-number {
    font-size: 11px;
  }

  .snes-app-ready .calendar-day-count {
    display: inline-flex;
    min-width: 16px;
    min-height: 16px;
    padding: 1px 4px;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    border-radius: 999px;
  }

  .snes-app-ready .calendar-day > .snes-calendar-dots {
    position: absolute;
    right: 2px;
    bottom: 4px;
    left: 2px;
  }

  .snes-app-ready .calendar-legend {
    font-size: 9px;
  }

  /* Dense tables become labeled cards instead of horizontal miniatures. */
  .snes-card-table {
    overflow: visible;
    background: transparent;
    border: 0;
  }

  .snes-card-table table {
    display: block;
    min-width: 0;
    background: transparent;
  }

  .snes-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .snes-card-table tbody {
    display: grid;
    gap: 10px;
  }

  .snes-card-table tbody tr {
    display: block;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--snes-line);
    border-radius: 16px;
    box-shadow: 0 7px 20px rgba(13, 39, 78, 0.06);
  }

  .snes-card-table tbody td {
    display: grid;
    grid-template-columns: minmax(90px, 38%) minmax(0, 1fr);
    gap: 9px;
    width: 100%;
    padding: 10px 12px;
    word-break: break-word;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf1f7;
  }

  .snes-card-table tbody td:last-child {
    border-bottom: 0;
  }

  .snes-card-table tbody td::before {
    color: var(--snes-muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    content: attr(data-label);
  }

  .snes-card-table tbody td[colspan] {
    display: block;
  }

  .snes-card-table tbody td[colspan]::before {
    display: none;
  }

  .snes-card-table .row-actions {
    justify-content: flex-end;
  }

  .snes-card-table .table-action,
  .snes-card-table .action-button {
    min-height: 44px;
  }
}

/* Keep the reference layout while preserving the existing photographic design. */

body:has(.login-shell) .login-shell {
  align-items: center;
  justify-content: center;
  padding-right: 16px;
  padding-left: 16px;
}

body:has(.login-shell) .login-card {
  width: min(100%, 460px);
  text-align: center;
}

body:has(.login-shell) .login-seal {
  width: 92px;
  height: 92px;
  margin: 0 auto 15px;
  border-radius: 50%;
}

body:has(.login-shell) .login-form,
body:has(.login-shell) .login-form label {
  text-align: left;
}

body:has(.login-shell) .login-form > button[type="submit"] {
  min-height: 50px;
  border-radius: 15px;
}

/* Tablet refinements */

@media (min-width: 600px) {
  .snes-profile-label {
    display: block;
  }

  .snes-quick-card {
    grid-template-columns: 48px minmax(0, 1fr) 18px;
    min-height: 110px;
    padding: 16px;
  }

  .snes-quick-card > .snes-icon:first-child {
    width: 48px;
    height: 48px;
  }

  .snes-quick-card > .snes-icon:last-child {
    display: grid;
  }

  .snes-quick-card strong {
    font-size: 14px;
  }

  .snes-quick-card small,
  .snes-metric-card em {
    font-size: 10px;
  }

  .snes-metric-card {
    min-height: 122px;
    padding: 17px;
  }

  .snes-employee-calendar-day {
    min-height: 70px;
  }
}

/* Full desktop application shell begins at the requested breakpoint. */

@media (min-width: 1024px) {
  .snes-app-ready .page-shell {
    display: grid;
    grid-template-columns: var(--snes-layout-sidebar) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "sidebar header"
      "sidebar main"
      "sidebar footer";
    min-height: 100svh;
  }

  .snes-app-sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    grid-area: sidebar;
    flex-direction: column;
    height: 100svh;
    padding: 23px 17px 18px;
    overflow-y: auto;
    color: #fff;
    background:
      radial-gradient(circle at 15% 0, rgba(59, 130, 246, 0.32), transparent 18rem),
      linear-gradient(175deg, var(--snes-navy-950), var(--snes-navy-800) 62%, #0b486b);
    box-shadow: 10px 0 35px rgba(8, 27, 54, 0.12);
  }

  .snes-app-ready .utility-header {
    grid-area: header;
    padding: 12px 28px;
  }

  .snes-app-ready .primary-nav-wrap {
    display: none;
  }

  .snes-app-ready .main-area {
    grid-area: main;
    width: min(100%, 1400px);
    min-width: 0;
    margin: 0 auto;
    padding: 25px 28px 52px;
  }

  .snes-app-ready .site-footer {
    display: flex;
    grid-area: footer;
    width: 100%;
    max-width: 1400px;
    padding: 20px 28px;
  }

  .snes-mobile-nav {
    display: none;
  }

  .snes-app-ready .date-row {
    min-height: 154px;
  }

  .snes-quick-actions,
  .snes-admin-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
  }

  .snes-quick-card:hover {
    border-color: #c7d8ef;
    box-shadow: 0 15px 34px rgba(13, 39, 78, 0.12);
    transform: translateY(-3px);
  }

  .snes-admin-dashboard-main {
    grid-template-columns: minmax(0, 2fr) minmax(310px, 1fr);
    align-items: start;
    gap: 18px;
  }

  .snes-admin-dashboard-side {
    gap: 18px;
  }

  .snes-role-employee.snes-page-dashboard .landing-content > .employee-profile-strip,
  .snes-role-employee.snes-page-dashboard .landing-content > .employee-stat-grid {
    grid-column: 1 / -1;
  }

  .snes-role-employee.snes-page-dashboard .landing-content > .recent-card:has(#selfBalanceGrid) {
    grid-column: 1 / span 5;
  }

  .snes-role-employee.snes-page-dashboard .landing-content > .recent-card:has(#selfRecentApplicationsBody) {
    grid-column: 6 / -1;
  }

  .snes-employee-calendar-layout {
    grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr);
    align-items: start;
    gap: 20px;
  }

  .snes-employee-calendar-card,
  .snes-selected-day-card {
    padding: 21px;
    border-radius: 22px;
  }

  .snes-selected-day-card {
    position: sticky;
    top: 94px;
  }

  .snes-employee-calendar-day {
    min-height: 82px;
  }

  .snes-sheet-backdrop {
    align-items: center;
    justify-items: center;
    padding: 24px;
  }

  .snes-bottom-sheet {
    width: min(100%, 560px);
    padding: 18px 22px 22px;
    border-radius: 24px;
    transform: translateY(14px);
  }

  .snes-sheet-handle {
    display: none;
  }

  .snes-app-ready .modal-backdrop {
    place-items: center;
    padding: 24px;
  }

  .snes-app-ready .modal {
    max-height: calc(100svh - 48px);
    border-radius: 24px;
    animation-name: snes-dialog-in;
  }
}

@media (max-width: 430px) {
  .snes-app-ready .utility-header {
    gap: 7px;
    padding: 9px 11px;
  }

  .snes-app-ready .top-brand-title strong {
    max-width: 150px;
  }

  .snes-app-ready .brand-mark {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .snes-app-ready .brand-mark img {
    width: 42px;
    height: 42px;
  }

  .snes-profile-button {
    min-width: 44px;
    min-height: 44px;
  }

  .snes-profile-button > .snes-icon,
  .snes-profile-label {
    display: none;
  }

  .snes-app-ready .main-area {
    padding-right: 12px;
    padding-left: 12px;
  }

  .snes-app-ready .date-row {
    min-height: 144px;
    padding: 17px;
  }

  .snes-welcome-copy p {
    max-width: 210px;
  }

  .snes-hero-date {
    min-width: 96px;
    padding: 9px;
  }

  .snes-hero-date strong {
    font-size: 14px;
  }

  .snes-quick-card {
    min-height: 108px;
    padding: 12px;
  }
}

@media (max-width: 360px) {
  .snes-app-ready .top-brand-title strong {
    max-width: 118px;
    font-size: 10.5px;
  }

  .snes-app-ready .top-brand-title span {
    font-size: 9px;
  }

  .snes-app-ready .date-row {
    align-items: stretch;
    flex-direction: column;
  }

  .snes-hero-date {
    align-self: flex-start;
    width: auto;
  }

  .snes-quick-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .snes-quick-card > .snes-icon:first-child {
    width: 40px;
    height: 40px;
  }
}

@keyframes snes-menu-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes snes-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes snes-sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes snes-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .snes-app-ready *,
  .snes-app-ready *::before,
  .snes-app-ready *::after,
  .snes-sheet-backdrop,
  .snes-bottom-sheet {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .snes-app-sidebar,
  .snes-mobile-nav,
  .snes-sheet-backdrop,
  .snes-header-actions,
  .snes-quick-actions {
    display: none !important;
  }

  .snes-app-ready .page-shell {
    display: block;
  }
}
