:root {
  --primary-green: #7fb63b;
  --primary-blue: #0095da;
  --deep-blue: #006bb5;
  --text: #17324d;
  --muted: #667085;
  --bg: #f2f8fc;
  --card: #ffffff;
  --border: #d9e7f1;
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 3rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: circularstd, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body.sidebar-open {
  overflow: hidden;
}

.app-footer {
  text-align: center;
  padding: 14px 18px;
  font-size: 13px;
  color: #64748b;
  border-top: 1px solid var(--border);
  background: #fff;
}

a {
  color: var(--primary-blue);
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

@keyframes navItemIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.sidebar {
  width: 264px;
  background:
    radial-gradient(1200px 500px at -20% -10%, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(900px 420px at 120% 10%, rgba(111,162,51,0.25) 0%, rgba(111,162,51,0) 55%),
    linear-gradient(180deg, var(--deep-blue) 0%, var(--primary-blue) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 14px;
  box-shadow: 12px 0 28px rgba(16, 24, 40, 0.16);
  display: flex;
  flex-direction: column;
  transition: width .2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 6px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  margin-bottom: 12px;
  flex: none;
}

.sidebar-brand-link {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.sidebar-brand img {
  width: 190px;
  max-width: 100%;
  height: auto;
  transition: opacity .15s ease;
}

.sidebar-clock {
  flex: none;
  text-align: center;
  padding: 10px 6px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}

.sidebar-clock-time {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: #fff;
}

.sidebar-clock-date {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
}

@media (min-width: 901px) {
  .app-shell.sidebar-collapsed .sidebar-clock {
    display: none;
  }
}

.sidebar-collapse-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .2s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.22);
}

.sidebar-collapse-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
}

.sidebar-nav a {
  color: rgba(255,255,255,0.92);
  font-weight: 500;
  font-size: 15px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  white-space: nowrap;
  opacity: 0;
  animation: navItemIn .35s ease both;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}

.sidebar-nav a:nth-child(1) { animation-delay: .02s; }
.sidebar-nav a:nth-child(2) { animation-delay: .05s; }
.sidebar-nav a:nth-child(3) { animation-delay: .08s; }
.sidebar-nav a:nth-child(4) { animation-delay: .11s; }
.sidebar-nav a:nth-child(5) { animation-delay: .14s; }
.sidebar-nav a:nth-child(6) { animation-delay: .17s; }
.sidebar-nav a:nth-child(7) { animation-delay: .2s; }
.sidebar-nav a:nth-child(8) { animation-delay: .23s; }
.sidebar-nav a:nth-child(9) { animation-delay: .26s; }
.sidebar-nav a:nth-child(10) { animation-delay: .29s; }

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.14);
  transform: translateX(3px);
}

.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.1) 100%);
  box-shadow: 0 10px 22px rgba(0,0,0,0.14);
  color: #fff;
}

.sidebar-nav a::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0);
  transition: background .15s ease;
}

.sidebar-nav a.active::before {
  background: var(--primary-green);
  box-shadow: 0 0 10px rgba(127,182,59,0.8);
}

.nav-icon {
  flex: none;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-nav a.active .nav-icon,
.sidebar-nav a:hover .nav-icon {
  opacity: 1;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section {
  margin-top: 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 900;
  color: rgba(255,255,255,0.68);
  padding: 8px 10px 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
  white-space: nowrap;
}

.sidebar-section .nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.sidebar-section .nav-icon svg {
  width: 14px;
  height: 14px;
}

.sidebar-user {
  flex: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}

.sidebar-user-logout {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background .15s ease;
}

.sidebar-user-logout:hover {
  background: rgba(220,38,38,0.55);
}

.sidebar-user-logout svg {
  width: 16px;
  height: 16px;
}

@media (min-width: 901px) {
  .app-shell.sidebar-collapsed .sidebar {
    width: 76px;
  }
  .app-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
  }
  .app-shell.sidebar-collapsed .sidebar-brand-link {
    display: none;
  }
  .app-shell.sidebar-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
  }
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .sidebar-section .nav-label,
  .app-shell.sidebar-collapsed .sidebar-user-info,
  .app-shell.sidebar-collapsed .sidebar-user-logout {
    display: none;
  }
  .app-shell.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
    padding: 11px;
  }
  .app-shell.sidebar-collapsed .sidebar-section {
    justify-content: center;
    padding: 8px 0;
  }
  .app-shell.sidebar-collapsed .sidebar-user {
    justify-content: center;
  }
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-menu-btn svg {
  width: 22px;
  height: 22px;
}

.sidebar-overlay {
  display: none;
}

.app-topbar-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.digital-clock-time {
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  font-size: 34px;
  letter-spacing: 1px;
}

.digital-clock-date {
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}

.app-user {
  font-weight: 800;
  color: var(--muted);
}

.app-logout {
  font-weight: 900;
  color: #fff;
  background: var(--primary-green);
  padding: 10px 12px;
  border-radius: 12px;
}

.app-content {
  padding: 18px;
}

.topbar {
  background: linear-gradient(90deg, var(--primary-green) 0%, #6dad3a 34%, var(--primary-blue) 100%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

@keyframes loginGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes loginBlobDrift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -24px) scale(1.08); }
  66% { transform: translate(-20px, 18px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes loginLogoIn {
  0% { opacity: 0; transform: scale(0.7) rotate(-6deg); }
  60% { opacity: 1; transform: scale(1.05) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loginPulseDash {
  to { stroke-dashoffset: 0; }
}

@keyframes loginShine {
  0% { transform: translateX(-120%) skewX(-20deg); }
  100% { transform: translateX(220%) skewX(-20deg); }
}

@keyframes loginShake {
  0% { opacity: 0; transform: translateX(0); }
  20% { opacity: 1; transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { opacity: 1; transform: translateX(0); }
}

.login-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(120deg, #eaf6ff 0%, #f2f8fc 35%, #edf9f0 70%, #eaf6ff 100%);
  background-size: 200% 200%;
  animation: loginGradientShift 14s ease-in-out infinite;
  padding: 32px 18px;
}

.login-blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.55;
  animation: loginBlobDrift 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.login-blob-1 {
  width: 280px;
  height: 280px;
  top: -60px;
  left: -60px;
  background: radial-gradient(circle, rgba(0,149,218,0.35) 0%, rgba(0,149,218,0) 70%);
}

.login-blob-2 {
  width: 320px;
  height: 320px;
  bottom: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(127,182,59,0.32) 0%, rgba(127,182,59,0) 70%);
  animation-delay: 2.5s;
  animation-duration: 12s;
}

.login-blob-3 {
  width: 200px;
  height: 200px;
  top: 40%;
  right: 8%;
  background: radial-gradient(circle, rgba(0,107,181,0.25) 0%, rgba(0,107,181,0) 70%);
  animation-delay: 5s;
  animation-duration: 9s;
}

.login-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: stretch;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 107, 181, 0.3);
  animation: loginCardIn 0.6s cubic-bezier(.2,.8,.2,1) both;
}

.login-visual {
  position: relative;
  overflow: hidden;
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  color: #fff;
  background: linear-gradient(150deg, var(--primary-green) 0%, #57a5c9 45%, var(--primary-blue) 100%);
}

.login-visual-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 55%);
  pointer-events: none;
}

.login-visual-content {
  position: relative;
  z-index: 1;
}

.login-visual h1 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 12px;
  animation: loginFadeUp 0.6s ease both;
  opacity: 0;
}

.login-visual p {
  color: rgba(255,255,255,0.92);
  margin: 0 0 22px;
  animation: loginFadeUp 0.6s ease both;
  animation-delay: 0.2s;
  opacity: 0;
}

.login-feature-list {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  animation: loginFadeUp 0.5s ease both;
}

.login-feature-list li:nth-child(1) { animation-delay: 0.3s; }
.login-feature-list li:nth-child(2) { animation-delay: 0.42s; }
.login-feature-list li:nth-child(3) { animation-delay: 0.54s; }

.login-feature-icon {
  flex: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.2);
  border-radius: 9px;
}

.login-feature-icon svg { width: 16px; height: 16px; }

.login-pulse-line {
  width: 100%;
  max-width: 260px;
  height: 40px;
  opacity: 0.85;
}

.login-pulse-line path {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: loginPulseDash 2.4s ease-in-out infinite alternate;
}

.login-panel {
  position: relative;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 34px;
}

.login-panel .card {
  width: 100%;
  max-width: 360px;
  border: none;
  box-shadow: none;
  padding: 0;
  animation: loginCardIn 0.6s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: 0.15s;
  opacity: 0;
}

.login-panel .logo-panel img {
  width: min(220px, 100%);
  animation: loginLogoIn 0.8s cubic-bezier(.2,.8,.3,1.2) both;
}

.login-panel h2 {
  margin: 0 0 6px;
}

.login-panel .muted {
  margin: 0 0 22px;
}

.login-panel .alert {
  animation: loginShake 0.5s ease both;
}

.login-panel .alert-error {
  background: rgba(220,38,38,0.06);
}

.login-panel .alert-success {
  background: rgba(16,185,129,0.06);
  animation: loginFadeUp 0.4s ease both;
}

.login-panel .field {
  opacity: 0;
  animation: loginFadeUp 0.5s ease both;
}

.login-panel .field:nth-of-type(1) { animation-delay: 0.25s; }
.login-panel .field:nth-of-type(2) { animation-delay: 0.35s; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  display: flex;
  color: var(--muted);
  pointer-events: none;
}

.input-wrap .input-icon svg { width: 16px; height: 16px; }

.input-wrap input {
  padding-left: 38px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  padding: 6px;
  display: flex;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
}

.password-toggle:hover {
  background: var(--bg);
  color: var(--text);
}

.password-toggle svg { width: 17px; height: 17px; }

.login-container .field input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.login-container .field input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(0, 149, 218, 0.15);
  transform: translateY(-1px);
}

.btn-login {
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  opacity: 0;
  animation: loginFadeUp 0.5s ease both;
  animation-delay: 0.45s;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px -6px rgba(0, 149, 218, 0.5);
}

.btn-login::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: loginShine 3.2s ease-in-out infinite;
}

.btn-login svg { width: 16px; height: 16px; }

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -6px rgba(0, 149, 218, 0.6);
}

.btn-login:active {
  transform: translateY(0);
}

@media (max-width: 860px) {
  .login-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  .login-visual {
    padding: 32px 28px;
    order: -1;
  }
  .login-visual h1 { font-size: 22px; }
  .login-feature-list { display: none; }
  .login-pulse-line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .login-container,
  .login-blob,
  .login-grid,
  .login-panel .card,
  .login-panel .logo-panel img,
  .login-visual h1,
  .login-visual p,
  .login-feature-list li,
  .login-panel .field,
  .btn-login,
  .login-pulse-line path,
  .login-panel .alert,
  .btn-login::after {
    animation: none;
    opacity: 1;
  }
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 64px;
  width: auto;
  background: transparent;
  padding: 0;
  border-radius: 8px;
  border: none;
}

.brand-title {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a {
  color: rgba(255,255,255,0.92);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.nav a.active,
.nav a:hover {
  background: rgba(255,255,255,0.16);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  border-radius: 10px;
  transition: opacity .15s ease;
}

.accordion-header:hover {
  opacity: 0.75;
}

.accordion-header h3 {
  margin: 0;
}

.accordion-chevron {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--primary-blue);
  transition: transform .25s ease;
}

.accordion-header[aria-expanded="false"] .accordion-chevron {
  transform: rotate(-90deg);
}

.accordion-body {
  overflow: hidden;
  margin-top: 14px;
  transition: max-height .28s ease, opacity .2s ease, margin-top .28s ease;
}

.accordion-body.is-collapsed {
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .accordion-body {
    transition: none;
  }
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text);
  display: inline-flex;
}

.modal-close:hover {
  background: #f1f5f9;
}

.modal-body {
  overflow: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.m-0 { margin: var(--space-0) !important; }
.m-1 { margin: var(--space-1) !important; }
.m-2 { margin: var(--space-2) !important; }
.m-3 { margin: var(--space-3) !important; }
.m-4 { margin: var(--space-4) !important; }
.m-5 { margin: var(--space-5) !important; }

.mt-0 { margin-top: var(--space-0) !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }

.mb-0 { margin-bottom: var(--space-0) !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-5 { margin-bottom: var(--space-5) !important; }

.ml-0, .ms-0 { margin-left: var(--space-0) !important; }
.ml-1, .ms-1 { margin-left: var(--space-1) !important; }
.ml-2, .ms-2 { margin-left: var(--space-2) !important; }
.ml-3, .ms-3 { margin-left: var(--space-3) !important; }
.ml-4, .ms-4 { margin-left: var(--space-4) !important; }
.ml-5, .ms-5 { margin-left: var(--space-5) !important; }

.mr-0, .me-0 { margin-right: var(--space-0) !important; }
.mr-1, .me-1 { margin-right: var(--space-1) !important; }
.mr-2, .me-2 { margin-right: var(--space-2) !important; }
.mr-3, .me-3 { margin-right: var(--space-3) !important; }
.mr-4, .me-4 { margin-right: var(--space-4) !important; }
.mr-5, .me-5 { margin-right: var(--space-5) !important; }

.mx-0 { margin-left: var(--space-0) !important; margin-right: var(--space-0) !important; }
.mx-1 { margin-left: var(--space-1) !important; margin-right: var(--space-1) !important; }
.mx-2 { margin-left: var(--space-2) !important; margin-right: var(--space-2) !important; }
.mx-3 { margin-left: var(--space-3) !important; margin-right: var(--space-3) !important; }
.mx-4 { margin-left: var(--space-4) !important; margin-right: var(--space-4) !important; }
.mx-5 { margin-left: var(--space-5) !important; margin-right: var(--space-5) !important; }

.my-0 { margin-top: var(--space-0) !important; margin-bottom: var(--space-0) !important; }
.my-1 { margin-top: var(--space-1) !important; margin-bottom: var(--space-1) !important; }
.my-2 { margin-top: var(--space-2) !important; margin-bottom: var(--space-2) !important; }
.my-3 { margin-top: var(--space-3) !important; margin-bottom: var(--space-3) !important; }
.my-4 { margin-top: var(--space-4) !important; margin-bottom: var(--space-4) !important; }
.my-5 { margin-top: var(--space-5) !important; margin-bottom: var(--space-5) !important; }

.p-0 { padding: var(--space-0) !important; }
.p-1 { padding: var(--space-1) !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-5 { padding: var(--space-5) !important; }

.pt-0 { padding-top: var(--space-0) !important; }
.pt-1 { padding-top: var(--space-1) !important; }
.pt-2 { padding-top: var(--space-2) !important; }
.pt-3 { padding-top: var(--space-3) !important; }
.pt-4 { padding-top: var(--space-4) !important; }
.pt-5 { padding-top: var(--space-5) !important; }

.pb-0 { padding-bottom: var(--space-0) !important; }
.pb-1 { padding-bottom: var(--space-1) !important; }
.pb-2 { padding-bottom: var(--space-2) !important; }
.pb-3 { padding-bottom: var(--space-3) !important; }
.pb-4 { padding-bottom: var(--space-4) !important; }
.pb-5 { padding-bottom: var(--space-5) !important; }

.pl-0, .ps-0 { padding-left: var(--space-0) !important; }
.pl-1, .ps-1 { padding-left: var(--space-1) !important; }
.pl-2, .ps-2 { padding-left: var(--space-2) !important; }
.pl-3, .ps-3 { padding-left: var(--space-3) !important; }
.pl-4, .ps-4 { padding-left: var(--space-4) !important; }
.pl-5, .ps-5 { padding-left: var(--space-5) !important; }

.pr-0, .pe-0 { padding-right: var(--space-0) !important; }
.pr-1, .pe-1 { padding-right: var(--space-1) !important; }
.pr-2, .pe-2 { padding-right: var(--space-2) !important; }
.pr-3, .pe-3 { padding-right: var(--space-3) !important; }
.pr-4, .pe-4 { padding-right: var(--space-4) !important; }
.pr-5, .pe-5 { padding-right: var(--space-5) !important; }

.px-0 { padding-left: var(--space-0) !important; padding-right: var(--space-0) !important; }
.px-1 { padding-left: var(--space-1) !important; padding-right: var(--space-1) !important; }
.px-2 { padding-left: var(--space-2) !important; padding-right: var(--space-2) !important; }
.px-3 { padding-left: var(--space-3) !important; padding-right: var(--space-3) !important; }
.px-4 { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }
.px-5 { padding-left: var(--space-5) !important; padding-right: var(--space-5) !important; }

.py-0 { padding-top: var(--space-0) !important; padding-bottom: var(--space-0) !important; }
.py-1 { padding-top: var(--space-1) !important; padding-bottom: var(--space-1) !important; }
.py-2 { padding-top: var(--space-2) !important; padding-bottom: var(--space-2) !important; }
.py-3 { padding-top: var(--space-3) !important; padding-bottom: var(--space-3) !important; }
.py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }
.py-5 { padding-top: var(--space-5) !important; padding-bottom: var(--space-5) !important; }

.col-6 {
  grid-column: span 6;
}

.col-4 {
  grid-column: span 4;
}

.col-3 {
  grid-column: span 3;
}

.col-12 {
  grid-column: span 12;
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-blue);
  color: #fff;
}

.btn-green {
  background: var(--primary-green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--deep-blue);
}

.btn-green:hover {
  background: #6fa233;
}

.btn-sky {
  background: #4fc3e7;
  color: #fff;
}

.btn-sky:hover {
  background: #3bb6db;
}

.btn-mini {
  padding: 8px 10px;
  border-radius: 12px;
}

.btn-mini svg {
  width: 18px;
  height: 18px;
}

.btn-sm {
  padding: 6px 10px;
  border-radius: 10px;
}

.btn-sm.btn-icon {
  padding: 6px 8px;
}

.btn-sm.btn-icon svg {
  width: 14px;
  height: 14px;
}

.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: #7c3aed;
  color: #fff;
}

.btn-danger:hover {
  background: #6d28d9;
}

.btn-orange {
  background: #f97316;
  color: #fff;
}

.btn-orange:hover {
  background: #ea580c;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-with-icon svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  font-weight: 700;
  font-size: 13px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.phone-input-group {
  display: flex;
  align-items: stretch;
}

.phone-input-group .phone-country-select {
  flex: 0 0 128px;
  width: 128px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  background: #f8fafc;
  font-weight: 700;
  padding-left: 8px;
  padding-right: 4px;
}

.phone-input-group input[type="tel"] {
  flex: 1 1 auto;
  min-width: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.phone-input-group .phone-country-select:focus,
.phone-input-group input[type="tel"]:focus {
  position: relative;
  z-index: 1;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table thead th {
  background: #f4f7fb;
  color: var(--text);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  padding: 13px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.table thead tr:first-child th:first-child {
  border-top-left-radius: 10px;
}

.table thead tr:first-child th:last-child {
  border-top-right-radius: 10px;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: rgba(0, 149, 218, 0.05);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.badge.booked { border-color: rgba(30,136,229,0.25); color: var(--primary-blue); }
.badge.checked_in { border-color: rgba(124,179,66,0.25); color: var(--primary-green); }
.badge.completed { border-color: rgba(16,185,129,0.25); color: #059669; }
.badge.cancelled { border-color: rgba(220,38,38,0.25); color: #dc2626; }
.badge.active { border-color: rgba(16,185,129,0.25); color: #059669; }
.badge.deactive { border-color: rgba(100,116,139,0.25); color: #64748b; }
.badge.close { border-color: rgba(220,38,38,0.25); color: #dc2626; }
.badge.visit-new { background: rgba(127,182,59,0.12); border-color: rgba(127,182,59,0.3); color: #4d7a1f; }
.badge.visit-online { background: rgba(0,149,218,0.12); border-color: rgba(0,149,218,0.3); color: var(--primary-blue); }
.badge.visit-registered { background: rgba(168,85,247,0.12); border-color: rgba(168,85,247,0.3); color: #7e22ce; }

.badge.pay-cash { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); color: #059669; }
.badge.pay-online { background: rgba(6,182,212,0.12); border-color: rgba(6,182,212,0.3); color: #0e7490; }
.badge.pay-google-pay { background: rgba(0,149,218,0.12); border-color: rgba(0,149,218,0.3); color: var(--primary-blue); }
.badge.pay-amazon-pay { background: rgba(245,158,11,0.14); border-color: rgba(245,158,11,0.35); color: #b45309; }
.badge.pay-free { background: rgba(100,116,139,0.12); border-color: rgba(100,116,139,0.3); color: #64748b; }
.badge.pay-other { background: rgba(100,116,139,0.1); border-color: rgba(100,116,139,0.25); color: #475569; }

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 14px;
  font-weight: 800;
}

.crumbs a {
  color: var(--text);
  opacity: 0.9;
}

.crumbs .sep {
  opacity: 0.5;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.profile-left {
  grid-column: span 4;
}

.profile-right {
  grid-column: span 8;
}

.profile-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
}

.profile-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.profile-name {
  font-size: 18px;
  font-weight: 1000;
  text-align: center;
  margin-top: 8px;
}

.profile-sub {
  text-align: center;
  font-weight: 900;
  color: var(--primary-blue);
  margin-top: 6px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px 16px;
}

.info-item {
  grid-column: span 4;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
}

.info-label {
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary-blue);
}

.info-value {
  color: var(--text);
  font-weight: 900;
}

.remark-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.remark-actions textarea {
  min-height: 56px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.gallery-item {
  position: relative;
  grid-column: span 2;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.gallery-compare-select {
  display: none;
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.55);
  align-items: center;
  justify-content: center;
}

.compare-mode-active .gallery-compare-select {
  display: flex;
}

.gallery-compare-select input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.compare-panel {
  width: min(1200px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding-right: 4px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.compare-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-col-label {
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  opacity: 0.9;
  text-align: center;
}

.compare-col img {
  width: 100%;
  height: 320px;
  object-fit: contain;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
}

.compare-diff-stage {
  position: relative;
}

@media (max-width: 900px) {
  .compare-grid { grid-template-columns: 1fr; }
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.gallery-item .gallery-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
}

.gallery-date-title {
  font-weight: 1000;
  margin: 0 0 10px 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-panel {
  width: min(1100px, 100%);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lightbox-title {
  color: #fff;
  font-weight: 900;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lightbox-media {
  position: relative;
  height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  touch-action: none;
  cursor: zoom-in;
}

.lightbox-media.is-zoomed {
  cursor: grab;
}

.lightbox-media.is-dragging {
  cursor: grabbing;
}

.lightbox-media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.lightbox-zoom {
  min-width: 52px;
  text-align: center;
  align-self: center;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  opacity: 0.9;
}

.lightbox-hint {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  text-align: center;
}

.btn-lightbox {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}

.btn-lightbox:hover {
  background: rgba(255,255,255,0.16);
}

@media (max-width: 900px) {
  .profile-left { grid-column: span 12; }
  .profile-right { grid-column: span 12; }
  .info-item { grid-column: span 6; }
  .gallery-item { grid-column: span 4; }
}

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #fff;
  margin-bottom: 12px;
}

.alert-error { border-color: rgba(220,38,38,0.25); color: #b91c1c; }
.alert-success { border-color: rgba(16,185,129,0.25); color: #047857; }

.muted {
  color: var(--muted);
}

.logo-panel {
  text-align: center;
  margin-bottom: 14px;
}

.logo-panel img {
  width: min(380px, 100%);
  height: auto;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@keyframes statCardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes statBlobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6px, 8px) scale(1.06); }
}

@keyframes statIconPop {
  from { opacity: 0; transform: scale(0.5) rotate(-12deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.stat-card {
  grid-column: span 3;
  border-radius: 20px;
  padding: 20px;
  color: #fff;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(16, 24, 40, 0.35);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s ease;
  animation: statCardIn 0.55s cubic-bezier(.2,.8,.2,1) both;
  will-change: transform;
}

.stat-grid .stat-card:nth-child(1) { animation-delay: 0.02s; }
.stat-grid .stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-grid .stat-card:nth-child(3) { animation-delay: 0.14s; }
.stat-grid .stat-card:nth-child(4) { animation-delay: 0.20s; }

.stat-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 18px 34px -10px rgba(16, 24, 40, 0.45);
}

.stat-card:active {
  transform: translateY(-2px) scale(1.005);
}

.stat-card:focus-visible {
  outline: 3px solid rgba(255,255,255,0.55);
  outline-offset: 2px;
}

.stat-row-link {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
}

.stat-row-link:hover {
  text-decoration: underline;
}

.stat-card:before,
.stat-card:after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  top: -50px;
  right: -60px;
  animation: statBlobFloat 7s ease-in-out infinite;
}

.stat-card:after {
  width: 120px;
  height: 120px;
  top: 30px;
  right: -30px;
  background: rgba(255,255,255,0.10);
  animation-duration: 9s;
  animation-delay: 1.2s;
}

.stat-card.blue { background: linear-gradient(135deg, #4f93f5 0%, #2f6fed 55%, #2453c4 100%); }
.stat-card.purple { background: linear-gradient(135deg, #b06ae8 0%, #9b51e0 55%, #7c34c2 100%); }
.stat-card.teal { background: linear-gradient(135deg, #29d3ae 0%, #1abc9c 55%, #109f85 100%); }
.stat-card.navy { background: linear-gradient(135deg, #3d4fb0 0%, #2c3e95 55%, #1f2c71 100%); }

.stat-icon {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  backdrop-filter: blur(2px);
  animation: statIconPop 0.5s cubic-bezier(.2,.8,.3,1.4) both;
  animation-delay: 0.15s;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

.stat-title {
  position: relative;
  z-index: 1;
  font-weight: 900;
  opacity: 0.95;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-number {
  position: relative;
  z-index: 1;
  font-size: 30px;
  font-weight: 1000;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .stat-card,
  .stat-card:before,
  .stat-card:after,
  .stat-icon {
    animation: none;
  }
  .stat-card {
    transition: none;
  }
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.mini-grid .card {
  grid-column: span 4;
}

.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(242, 248, 252, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.page-loader.show {
  display: flex;
}

.page-loader .spinner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 4px solid rgba(0, 149, 218, 0.18);
  border-top-color: var(--primary-blue);
  animation: dropt-spin 0.9s linear infinite;
}

@keyframes dropt-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .col-6 { grid-column: span 12; }
  .col-4 { grid-column: span 12; }
  .col-3 { grid-column: span 6; }
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .app-menu-btn { display: inline-flex; }
  .app-topbar { height: auto; padding: 10px 12px; gap: 10px; }
  .app-topbar-left { min-width: 0; }
  .app-topbar-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
  .app-topbar-right { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .digital-clock-time { font-size: 26px; }
  .app-user { font-size: 12px; }
  .app-logout { padding: 8px 10px; border-radius: 10px; font-size: 12px; }
  .sidebar-collapse-btn { display: none; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 60;
    transform: translateX(-110%);
    transition: transform .18s ease;
  }
  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.38);
    z-index: 55;
  }
  .app-shell.sidebar-open .sidebar-overlay {
    display: block;
  }
  .table-responsive .table {
    min-width: 720px;
  }
  .table th,
  .table td {
    font-size: 12px;
    padding: 8px 8px;
    white-space: nowrap;
  }
  .stat-card { grid-column: span 12; }
  .mini-grid .card { grid-column: span 12; }
}

/* Toast notifications (save / update / error feedback) */
.toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  --toast-color: #16a34a;
  --toast-tint: rgba(22, 163, 74, 0.1);
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 46px 20px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--toast-color);
  box-shadow: 0 20px 44px -14px rgba(16, 24, 40, 0.4), 0 0 0 5px var(--toast-tint);
  overflow: hidden;
  animation: toastIn .5s cubic-bezier(.2, .9, .3, 1.15) both;
}

.toast-success {
  --toast-color: #16a34a;
  --toast-tint: rgba(22, 163, 74, 0.1);
}

.toast-error {
  --toast-color: #dc2626;
  --toast-tint: rgba(220, 38, 38, 0.1);
}

.toast.is-leaving {
  animation: toastOut .3s ease forwards;
}

.toast-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--toast-color);
  animation: toastPop .55s .15s cubic-bezier(.2, .9, .3, 1.4) both;
}

.toast-icon svg {
  width: 22px;
  height: 22px;
}

.toast-success .toast-icon svg polyline {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  animation: toastTick .45s .4s ease forwards;
}

.toast-body {
  min-width: 0;
  flex: 1;
}

.toast-title {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .2px;
  color: var(--toast-color);
}

.toast-msg {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.toast-msg div + div {
  margin-top: 3px;
}

.toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.toast-close:hover {
  background: rgba(100, 116, 139, 0.14);
  color: var(--text);
}

.toast-close svg {
  width: 15px;
  height: 15px;
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: var(--toast-color);
  transform-origin: left center;
  animation: toastProgress var(--toast-duration, 5000ms) linear forwards;
}

.toast:hover .toast-progress {
  animation-play-state: paused;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px) scale(.94); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(60px) scale(.96); }
}

@keyframes toastPop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes toastTick {
  to { stroke-dashoffset: 0; }
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 900px) {
  .toast-host {
    top: 10px;
    right: 14px;
    left: 14px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast-icon,
  .toast-success .toast-icon svg polyline {
    animation: none;
  }
  .toast-success .toast-icon svg polyline {
    stroke-dashoffset: 0;
  }
}

/* Nice date picker -- replaces the plain native calendar with a
   consistent, larger-tap-target popup (see assets/js/nice-datepicker.js) */
.nice-datepicker-wrap {
  position: relative;
}

.nice-datepicker-display {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.nice-datepicker-display:hover {
  border-color: var(--primary-blue);
}

.nice-datepicker-display.is-empty .nice-datepicker-text {
  color: var(--muted);
}

.nice-datepicker-display svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--muted);
}

.nice-datepicker-popup {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  width: 268px;
  max-width: calc(100vw - 16px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(23, 50, 77, 0.18);
  padding: 12px;
}

.nice-datepicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.nice-datepicker-title {
  font-weight: 900;
  font-size: 14px;
  color: var(--text);
}

.nice-datepicker-nav {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.nice-datepicker-nav:hover {
  background: var(--bg);
  border-color: var(--primary-blue);
}

.nice-datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 4px;
}

.nice-datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.nice-datepicker-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nice-datepicker-day.is-blank {
  cursor: default;
}

.nice-datepicker-day:not(.is-blank):not(.is-disabled):hover {
  background: var(--bg);
}

.nice-datepicker-day.is-today {
  box-shadow: inset 0 0 0 1px var(--primary-blue);
  font-weight: 800;
}

.nice-datepicker-day.is-selected {
  background: var(--primary-blue);
  color: #fff;
  font-weight: 800;
}

.nice-datepicker-day.is-disabled {
  color: var(--border);
  cursor: not-allowed;
}

.nice-datepicker-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.nice-datepicker-link {
  border: none;
  background: none;
  color: var(--primary-blue);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
}

.nice-datepicker-link:hover {
  text-decoration: underline;
}
