:root {
  --bg: #f5f7fb;
  --card: #fff;
  --text: #172033;
  --muted: #697386;
  --line: #e5e9f2;
  --primary: #635bff;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #06b6d4;
  --radius: 18px;
  --shadow: 0 8px 30px #1b24400b;
  --shadow-lg: 0 20px 60px #1b244015;
}

.report-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}

.insight-card {
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #f8faff);
  box-shadow: var(--shadow);
}

.insight-card small,
.insight-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.insight-card strong {
  display: block;
  margin: 8px 0 2px;
  color: var(--text);
  font-size: 27px;
  letter-spacing: -0.04em;
}

.insight-bar {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8edf7;
}

.insight-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #635bff, #06b6d4);
}

@media (max-width: 800px) {
  .report-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .report-insights {
    grid-template-columns: 1fr;
  }
}

/* Modern authentication experience */
.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 8% 8%, rgba(99, 91, 255, .18), transparent 28rem),
      radial-gradient(circle at 92% 88%, rgba(6, 182, 212, .16), transparent 27rem),
      linear-gradient(135deg, #f8fbff 0%, #eef2ff 48%, #f8fafc 100%);
  }

  .auth-layout {
    position: relative;
    isolation: isolate;
    width: min(1160px, 100%);
    min-height: 690px;
    border: 1px solid rgba(255,255,255,.92);
    border-radius: 32px;
    box-shadow: 0 30px 90px rgba(30, 41, 99, .18), 0 8px 25px rgba(15, 23, 42, .06);
    background: rgba(255,255,255,.78);
  }

  .auth-layout::after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    right: -90px;
    bottom: -110px;
    z-index: -1;
    border-radius: 50%;
    background: rgba(99,91,255,.12);
    filter: blur(8px);
  }

  .auth-visual {
    position: relative;
    overflow: hidden;
    padding: clamp(34px, 5vw, 68px);
    background:
      radial-gradient(circle at 85% 18%, rgba(129,140,248,.3), transparent 13rem),
      radial-gradient(circle at 15% 90%, rgba(6,182,212,.18), transparent 17rem),
      linear-gradient(145deg, #111827 0%, #27235f 50%, #4f46e5 100%);
  }

  .auth-visual::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -130px;
    top: -120px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(255,255,255,.04), 0 0 0 58px rgba(255,255,255,.025);
  }

  .auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -.4px;
  }

  .auth-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    box-shadow: 0 8px 20px rgba(0,0,0,.16);
  }

  .auth-brand-logo {
    width: 31px;
    height: 31px;
    object-fit: contain;
    border-radius: 9px;
  }

  .auth-kicker {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid rgba(165,180,252,.24);
    border-radius: 999px;
    background: rgba(129,140,248,.12);
    font-size: 10px;
  }

  .auth-visual h2 {
    max-width: 440px;
    margin-top: 24px;
    font-size: clamp(34px, 4vw, 52px);
    text-wrap: balance;
  }

  .auth-visual p {
    color: #dbe4f4;
    line-height: 1.75;
  }

  .auth-trust span {
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: rgba(255,255,255,.07);
  }

  .auth-main {
    padding: clamp(30px, 6vw, 78px);
    background: rgba(255,255,255,.72);
  }

  .auth-card {
    width: min(390px, 100%);
  }

  .auth-heading {
    margin-bottom: 30px;
  }

  .auth-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: linear-gradient(135deg, #635bff, #06b6d4);
    box-shadow: 0 12px 25px rgba(79,70,229,.26);
  }

  .auth-heading h1 {
    font-size: clamp(28px, 4vw, 34px);
    letter-spacing: -1.4px;
  }

  .auth-heading p {
    font-size: 13px;
  }

  .auth-card label {
    margin-top: 17px;
    color: #27324a;
    font-size: 12px;
    font-weight: 750;
  }

  .auth-card .input {
    min-height: 48px;
    border: 1px solid #d9e2f1;
    border-radius: 12px;
    background: rgba(248,250,255,.9);
    box-shadow: inset 0 1px 2px rgba(15,23,42,.03);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  }

  .auth-card .input:focus {
    border-color: #635bff;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99,91,255,.12);
  }

  .auth-submit {
    min-height: 48px;
    margin-top: 22px;
    border-radius: 12px;
    background: linear-gradient(100deg, #574bdf, #635bff 55%, #4f46e5);
    box-shadow: 0 12px 24px rgba(79,70,229,.22);
  }

  .auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 28px rgba(79,70,229,.3);
  }

  .auth-note {
    margin-top: 18px;
    font-size: 11px;
  }

  .auth-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #edf0f6;
    font-size: 12px;
    line-height: 1.8;
  }

@media (max-width: 760px) {
    .login {
      display: block;
      padding: 14px;
    }

    .auth-layout {
      min-height: calc(100vh - 28px);
      border-radius: 22px;
    }

    .auth-visual {
      min-height: 245px;
      padding: 28px 24px;
    }

    .auth-visual h2 {
      margin-top: 18px;
      font-size: 32px;
    }

    .auth-main {
      padding: 34px 24px 28px;
    }
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Admin support alerts and inline reply widget. */
#support-notification-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2147483000;
  width: min(380px, calc(100vw - 36px));
}

#support-notification-stack .support-message-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
  font-size: 13px;
}

.support-message-alert-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  font-weight: 800;
}

.support-message-alert-copy {
  min-width: 0;
  flex: 1;
}

.support-message-alert-copy strong,
.support-message-alert-copy span {
  display: block;
}

.support-message-alert-copy strong {
  margin-bottom: 3px;
  color: #111827;
}

.support-message-alert-copy span {
  overflow-wrap: anywhere;
  color: #475569;
  line-height: 1.4;
}

.support-message-alert-close,
#admin-support-widget button[aria-label="Close"] {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

#admin-support-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147482999;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(390px, calc(100vw - 36px));
  max-height: min(620px, calc(100vh - 100px));
  overflow: hidden;
  border: 1px solid #dbe3ff;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .22);
}

#admin-support-widget .admin-support-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #171d35, #4338ca);
  color: #fff;
}

#admin-support-widget .admin-support-widget-head b {
  color: #fff;
  font-size: 14px;
}

#admin-support-widget .admin-support-widget-head button[aria-label="Close"] {
  background: rgba(255,255,255,.14);
  color: #fff;
}

#admin-support-widget .admin-support-widget-status {
  padding: 11px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

#admin-support-widget .admin-support-widget-messages {
  display: grid;
  gap: 9px;
  min-height: 130px;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
}

#admin-support-widget .admin-support-widget-message {
  max-width: 88%;
  padding: 9px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 12px;
}

#admin-support-widget .admin-support-widget-message.user {
  justify-self: end;
  background: #eef2ff;
}

#admin-support-widget .admin-support-widget-message b,
#admin-support-widget .admin-support-widget-message p {
  display: block;
}

#admin-support-widget .admin-support-widget-message b {
  margin-bottom: 3px;
  color: #475569;
  font-size: 10px;
  text-transform: uppercase;
}

#admin-support-widget .admin-support-widget-message p {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#admin-support-widget .admin-support-widget-message time {
  display: block;
  margin-top: 7px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.2;
}

#support-live-widget .support-live-item time {
  display: block !important;
  margin-top: 4px !important;
  color: #94a3b8 !important;
  font: 10px/1.2 Arial, sans-serif !important;
}

#admin-support-widget form {
  display: flex;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

#admin-support-widget form input {
  min-width: 0;
  margin: 0;
  padding: 10px 11px;
}

#admin-support-widget form button {
  flex: 0 0 42px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

#support-live-widget .support-live-empty {
  all: initial !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  width: 100% !important;
  min-height: 90px !important;
  margin: 0 !important;
  padding: 22px 16px !important;
  color: #64748b !important;
  background: #fff !important;
  font: 500 14px/1.4 Arial, sans-serif !important;
  text-align: center !important;
}

#support-live-widget .support-live-empty::before {
  content: "✓" !important;
  display: grid !important;
  place-items: center !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: #dcfce7 !important;
  color: #15803d !important;
  font: 700 14px/1 Arial, sans-serif !important;
}

@media (max-width: 560px) {
  #support-notification-stack {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }

  #admin-support-widget {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 90px);
  }
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  opacity: 0.8;
}

/* ===== TOP NAVIGATION ===== */
.top {
  height: 64px;
  background: linear-gradient(135deg, #111827 0%, #1a202c 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.top b {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.top nav {
  display: flex;
  gap: 24px;
  font-size: 13px;
}

.top nav a {
  color: #e5e7eb;
  opacity: 0.9;
  transition: all 0.3s ease;
  font-weight: 500;
}

.top nav a:hover {
  color: #fff;
  opacity: 1;
}

.mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 42px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}

.mobile-menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 99px;
  background: #fff;
  transition: transform .2s ease, opacity .2s ease;
}

.mobile-menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== MAIN CONTENT ===== */
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #151a2e 0%, #3a347b 100%);
  color: #fff;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  font-size: 36px;
  margin: 0 0 12px 0;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hero p {
  margin: 0;
  opacity: 0.95;
  font-size: 15px;
}

/* ===== STATS ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stats > div {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.stats > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.stats b {
  display: block;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.support-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  pointer-events: auto;
  font-family: Inter, system-ui, sans-serif;
}

.support-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #635bff, #4338ca);
  color: #fff;
  box-shadow: 0 14px 30px rgba(67, 56, 202, .3);
  cursor: pointer;
  font-weight: 800;
}

.support-chat-toggle-icon,
.support-bot-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-weight: 900;
}

.support-unread {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
}

.support-chat-panel {
  width: min(370px, calc(100vw - 30px));
  position: relative;
  z-index: 1;
  pointer-events: auto;
  overflow: hidden;
  border: 1px solid #dbe3f2;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
}

.support-chat-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  color: #fff;
}

.support-chat-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.support-chat-brand .support-bot-avatar {
  background: rgba(255,255,255,.18);
}

.support-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-radius: 50%;
  background: #86efac;
}

.support-welcome {
  padding: 10px 2px 18px;
  text-align: center;
}

.support-bot-avatar.large {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, #635bff, #4338ca);
  box-shadow: 0 10px 22px rgba(67,56,202,.25);
}

.support-welcome h3 {
  margin: 0 0 5px;
  color: #111827;
}

.support-welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.support-chat-panel header strong,
.support-chat-panel header small {
  display: block;
}

.support-chat-panel header small {
  margin-top: 2px;
  opacity: .75;
  font-size: 11px;
}

.support-chat-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 25px;
  cursor: pointer;
}

.support-chat-body {
  padding: 15px;
}

.support-chat-start p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.support-chat-start .input {
  margin-bottom: 10px;
}

.support-error {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  color: #b91c1c;
  font-size: 12px;
}

.support-faq-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.support-faq {
  padding: 6px 9px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  cursor: pointer;
  font-size: 11px;
}

.support-messages {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding: 4px 2px 10px;
}

.support-assigned-agent {
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.support-message {
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f1f5f9;
}

.support-message.user {
  justify-self: end;
  background: #eef2ff;
}

.support-message.admin {
  background: #ecfdf5;
}

.support-message.bot {
  border: 1px solid #ddd6fe;
  background: #f5f3ff;
}

.support-message span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.support-message p {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.support-message-form {
  display: flex;
  gap: 7px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.support-message-form .input {
  margin: 0;
}

.support-message-form .btn {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 13px;
  font-size: 20px;
}

.support-secure-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.support-typing {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 12px;
  background: #f5f3ff;
  color: #6d5bd0;
  font-size: 11px;
}

.support-typing span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 2px;
  border-radius: 50%;
  background: #7c3aed;
  animation: supportTyping 1s infinite ease-in-out;
}

.support-typing span:nth-child(2) { animation-delay: .15s; }
.support-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes supportTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.support-admin-thread {
  max-width: 820px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dbe3ff;
  box-shadow: 0 18px 55px rgba(30, 41, 99, .14);
}

.support-person-details {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.support-person-details-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.support-person-details-heading h2 {
  margin: 3px 0 0;
  color: #111827;
}

.support-profile-badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}

.support-person-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 9px;
}

.support-person-detail {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.support-person-detail span,
.support-person-detail b {
  display: block;
  overflow-wrap: anywhere;
}

.support-person-detail span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.support-person-detail b {
  color: #1f2937;
  font-size: 12px;
}

.support-admin-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  color: #fff;
}

.support-admin-chat-header h2 {
  margin: 0;
  color: #fff;
}

.support-admin-chat-header small {
  color: #c7d2fe;
}

.support-assignment-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.support-assignment-panel .ticket-assign-form {
  min-width: min(520px, 100%);
}

.support-assignment-panel label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.support-live-dot {
  color: #bbf7d0;
  font-size: 12px;
  font-weight: 700;
}

.support-admin-messages {
  display: grid;
  gap: 12px;
  min-height: 360px;
  max-height: 560px;
  overflow-y: auto;
  padding: 22px;
  background: radial-gradient(circle at top right, #eef2ff 0, #f8fafc 42%, #f1f5f9 100%);
}

.support-admin-messages .support-message {
  width: fit-content;
  max-width: 78%;
  padding: 13px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .06);
}

.support-admin-messages .support-message.admin {
  justify-self: end;
  background: #e0e7ff;
}

.support-admin-messages .support-message.user {
  justify-self: start;
  background: #fff;
}

.support-admin-messages .support-message.bot {
  justify-self: start;
  background: #f1f5f9;
}

.support-admin-messages .support-message span {
  color: #475569;
  font-size: 11px;
  letter-spacing: .02em;
}

.support-admin-messages .support-message p {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.55;
}

.support-message small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.support-admin-reply {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 18px 20px;
  background: rgba(255, 255, 255, .96);
}

.support-admin-reply label {
  margin: 0;
}

.support-admin-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.support-admin-composer .input {
  min-height: 54px;
  margin: 0;
  resize: vertical;
  border-radius: 14px;
  border-color: #c7d2fe;
  background: #f8faff;
}

.support-admin-composer .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, .12);
  background: #fff;
}

.support-admin-composer .btn {
  min-width: 125px;
  min-height: 54px;
  border-radius: 14px;
}

.support-close-form {
  padding: 0 20px 18px;
}

.support-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:22px; padding:30px; border-radius:24px; background:linear-gradient(135deg,#171d35,#3730a3 58%,#6366f1); color:#fff; box-shadow:0 18px 40px rgba(49,46,129,.2); }
.support-hero h1 { margin:6px 0 8px; color:#fff; }
.support-hero p { margin:0; color:#dbeafe; }
.support-hero .eyebrow { color:#c7d2fe; }
.support-stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px; }
.support-stat-grid > div { padding:18px 20px; border:1px solid #e5e7eb; border-radius:18px; background:#fff; box-shadow:0 8px 22px rgba(15,23,42,.05); }
.support-stat-grid span,.support-stat-grid small { display:block; color:var(--muted); font-size:12px; }
.support-stat-grid b { display:block; margin:5px 0; color:#111827; font-size:28px; }
.support-layout { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(290px,.75fr); gap:22px; align-items:start; }
.support-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:16px; }
.support-section-head h2 { margin:0 0 5px; }
.support-section-head p { margin:0; }
.support-filters { display:flex; gap:8px; min-width:min(420px,100%); }
.support-filters .input { margin:0; }
.support-person { display:flex; align-items:center; gap:11px; }
.support-person small { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.support-avatar { display:grid; place-items:center; width:36px; height:36px; flex:0 0 36px; border-radius:12px; background:#eef2ff; color:#4338ca; font-size:12px; font-weight:800; }
.support-conversations-table td { vertical-align:middle; }
.support-conversations-table tr[hidden] { display:none; }
.support-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#eef2ff; color:#4338ca; font-weight:800; }
.support-faq-form { display:grid; gap:10px; margin-bottom:18px; }
.support-faq-form .input { margin:0; }
.support-faq-items { display:grid; gap:9px; }
.support-faq-item { display:flex; justify-content:space-between; gap:10px; padding:12px; border:1px solid #e5e7eb; border-radius:13px; background:#f8fafc; }
.support-faq-item b { font-size:13px; }
.support-faq-item p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.45; }
.ticket-assign-form { display:flex; align-items:center; gap:8px; min-width:260px; margin:0; }
.ticket-assign-form .input { min-width:170px; margin:0; }
.support-ticket-alert { display:flex; align-items:center; gap:12px; margin:0 0 18px; padding:14px 18px; border:1px solid #fecaca; border-radius:16px; background:linear-gradient(135deg,#fff1f2,#fff); color:#991b1b; }
.support-ticket-alert b,.support-ticket-alert small { display:block; }
.support-ticket-alert small { margin-top:3px; color:#b45309; }
.support-alert-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#ef4444; color:#fff; font-weight:900; }
.ticket-needs-action { background:#fff7ed !important; box-shadow:inset 4px 0 #f97316; }
.ticket-action-badge { display:inline-block; margin-left:8px; padding:3px 7px; border-radius:999px; background:#ffedd5; color:#c2410c; font-size:10px; font-weight:800; }
.support-ticket-row[hidden] { display:none; }

@media (max-width: 900px) {
  .support-layout { grid-template-columns:1fr; }
  .support-stat-grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 640px) {
  .support-chat { right:10px; bottom:10px; left:10px; }
  .support-chat-toggle { width:100%; justify-content:center; min-height:48px; }
  .support-chat-panel { width:100%; max-height:calc(100dvh - 20px); border-radius:18px; }
  .support-chat-body { padding:12px; }
  .support-messages { max-height:42dvh; }
  .support-message-form { align-items:stretch; flex-direction:column; }
  .support-message-form .btn { width:100%; min-height:44px; }
  .support-admin-thread { width:100%; border-radius:16px; }
  .support-admin-chat-header { padding:15px; }
  .support-admin-messages { min-height:45dvh; max-height:55dvh; padding:14px; }
  .support-admin-messages .support-message { max-width:90%; padding:11px 12px; }
  .support-admin-reply { padding:14px; }
  .support-admin-composer { display:grid; gap:8px; }
  .support-admin-composer .input { width:100%; min-height:80px; }
  .support-admin-composer .btn { width:100%; min-height:46px; }
  .support-close-form { padding:0 14px 14px; }
  .support-hero { align-items:stretch; flex-direction:column; padding:22px 18px; border-radius:18px; }
  .support-hero .btn { width:100%; text-align:center; }
  .support-stat-grid { grid-template-columns:1fr 1fr; gap:9px; }
  .support-stat-grid > div { padding:13px 12px; border-radius:14px; }
  .support-stat-grid b { font-size:23px; }
  .support-layout { display:flex; flex-direction:column; gap:14px; }
  .support-section-head { align-items:stretch; flex-direction:column; gap:12px; }
  .support-filters { min-width:0; flex-direction:column; }
  .support-filters .input { width:100%; min-height:44px; }
  .support-conversations-table { min-width:0; }
  .support-conversations-table thead { display:none; }
  .support-conversations-table,
  .support-conversations-table tbody,
  .support-conversations-table tr,
  .support-conversations-table td { display:block; width:100%; }
  .support-conversations-table tr { margin-bottom:10px; padding:12px; border:1px solid #e5e7eb; border-radius:14px; background:#fff; }
  .support-conversations-table td { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 0; border:0; }
  .support-conversations-table td:nth-child(2)::before { content:"Status"; }
  .support-conversations-table td:nth-child(3)::before { content:"Replies"; }
  .support-conversations-table td:nth-child(4)::before { content:"Updated"; }
  .support-conversations-table td:nth-child(5) { justify-content:flex-end; padding-top:10px; }
  .support-conversations-table td::before { color:var(--muted); font-size:11px; font-weight:700; }
  .support-faq-card { width:100%; }
  .ticket-assign-form { min-width:0; width:100%; flex-direction:column; align-items:stretch; }
  .ticket-assign-form .input,.ticket-assign-form .btn { width:100%; }
  .support-ticket-alert { align-items:flex-start; padding:13px; }
}

/* ===== PAGE HEAD ===== */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 15px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ===== GRID & CARDS ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card h1 {
  margin: 0 0 16px 0;
  font-size: 24px;
  color: var(--text);
}

.card h2 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
}

.card h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
}

.card p {
  margin: 8px 0;
  line-height: 1.6;
}

.card.narrow {
  max-width: 600px;
  margin: 0 auto;
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: #eef2ff;
  color: var(--primary);
  margin-bottom: 12px;
}

.badge.published {
  background: #dcfce7;
  color: #166534;
}

.badge.draft {
  background: #fef3c7;
  color: #92400e;
}

.badge.pending {
  background: #dbeafe;
  color: #1e40af;
}

.badge.approved {
  background: #d1fae5;
  color: #065f46;
}

.badge.rejected {
  background: #fee2e2;
  color: #b91c1c;
}

/* ===== BUTTONS ===== */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  min-height: 40px;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--primary);
  background: var(--card);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: #5548e8;
  border-color: #5548e8;
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.25);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.data-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 22px 0;
  padding-bottom: 4px;
}

.data-tab {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 170px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.data-tab small {
  color: var(--muted);
}

.data-tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.data-tab.active small {
  color: rgba(255,255,255,.8);
}

.log-stack {
  max-width: 650px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
  margin-top: 8px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
}

.access-denied-card {
  max-width: 700px;
  text-align: center;
  padding: 34px 42px 38px;
  border: 1px solid rgba(99,91,255,.12);
  box-shadow: 0 24px 70px rgba(46,42,125,.12);
}

.access-page {
  width: 100%;
}

.access-denied-en-title {
  margin: -14px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.access-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto;
  max-width: 560px;
}

.access-step {
  display: grid;
  gap: 3px;
  justify-items: center;
  color: #94a3b8;
  font-size: 12px;
  min-width: 92px;
}

.access-step span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 800;
  font-size: 14px;
}

.access-step b {
  color: #475569;
  font-size: 12px;
}

.access-step small {
  color: #94a3b8;
}

.access-step.active span {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 14px rgba(79,70,229,.25);
}

.access-step.active b {
  color: var(--primary);
}

.access-step-line {
  width: 72px;
  height: 2px;
  margin: 0 8px 28px;
  background: #e2e8f0;
}

.access-denied-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(145deg,#eef2ff,#fff1f2);
  border: 1px solid #e0e7ff;
  font-size: 30px;
  box-shadow: 0 10px 24px rgba(99,91,255,.12);
}

.access-denied-card h2 {
  margin: 8px 0 20px;
  font-size: 18px;
  line-height: 1.35;
}

.access-denied-intro {
  margin: -8px auto 22px;
  max-width: 430px;
  color: var(--muted);
  line-height: 1.55;
}

.form-expiry-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 520px;
  margin: 18px auto 22px;
  padding: 12px 16px;
  text-align: center;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
}

.form-expiry-notice > span {
  font-size: 22px;
}

.form-expiry-notice div {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.form-expiry-notice b {
  font-size: 12px;
}

.form-expiry-notice strong {
  font-size: 15px;
}

.form-expiry-notice small {
  color: #a16207;
  font-size: 11px;
}

.access-denied-alert,
.access-denied-help {
  padding: 14px 16px;
  margin: 14px 0;
  border-radius: 12px;
  text-align: left;
}

.access-denied-alert {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #9f1239;
  font-size: 14px;
}

.access-denied-alert span {
  display: block;
  margin-top: 5px;
  color: #be5570;
  font-size: 12px;
}

.access-denied-help {
  border: 1px solid var(--line);
  background: #f8fafc;
}

.access-denied-alert p,
.access-denied-help p {
  margin: 5px 0 0;
}

.access-denied-alert strong {
   display: block;
   line-height: 1.45;
}

.access-denied-card form {
  margin-top: 20px;
  text-align: left;
}

.access-denied-card form .btn {
  width: 100%;
  margin-top: 12px;
}

.access-denied-card form .btn span {
   margin-left: 5px;
}

.access-denied-hint {
   display: block;
   margin-top: 10px;
   color: var(--muted);
   font-size: 12px;
}

.access-denied-footer {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}

.file-rename-form {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding: 0;
}

.file-rename-form .input,
.file-rename-form input {
  min-width: 150px;
  max-width: 220px;
  padding: 7px 9px;
  font-size: 12px;
}

.file-rename-form .btn {
  white-space: nowrap;
}

.attendance-document-manager {
  overflow: hidden;
}

.report-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.report-section-heading h3 {
  margin: 0;
}

.report-section-heading p {
  margin: 6px 0 0;
}

.attendance-document-table {
  min-width: 1220px !important;
  table-layout: fixed;
}

.attendance-document-table th:nth-child(1),
.attendance-document-table td:nth-child(1) {
  width: 25%;
}

.attendance-document-table th:nth-child(2),
.attendance-document-table td:nth-child(2) {
  width: 15%;
}

.attendance-document-table th:nth-child(3),
.attendance-document-table td:nth-child(3) {
  width: 17%;
}

.attendance-document-table th:nth-child(4),
.attendance-document-table td:nth-child(4) {
  width: 17%;
}

.attendance-document-table th:nth-child(5),
.attendance-document-table td:nth-child(5) {
  width: 14%;
}

.attendance-document-table th:nth-child(6),
.attendance-document-table td:nth-child(6) {
  width: 20%;
}

.document-file-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-person {
  display: grid;
  gap: 4px;
}

.attendance-month-value {
  display: block;
  color: var(--text);
}

.attendance-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.attendance-document-actions form {
  display: contents;
}

.attendance-document-actions .btn {
  flex: 0 1 auto;
}

/* The report filter form has a grid layout; keep row-level forms independent. */
.report-page .attendance-document-manager .file-rename-form {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 10px 0 0;
  padding: 0;
}

.report-page .uploaded-file-cell {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.report-page .uploaded-file-cell .file-rename-form {
  display: flex !important;
  margin: 0;
}

.report-page .uploaded-file-cell .file-rename-form input {
  min-width: 150px;
}

.report-page .attendance-document-manager .file-rename-form input {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
}

.report-page .attendance-document-manager .file-rename-form .btn {
  flex: 0 0 auto;
}

.report-page .attendance-document-manager .attendance-document-actions form {
  display: contents !important;
  padding: 0;
}

@media (max-width: 900px) {
  .report-section-heading {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .access-denied-card {
    padding: 26px 18px 30px;
  }

  .access-steps {
    margin: 20px -8px;
  }

  .access-step {
    min-width: 72px;
    font-size: 11px;
  }

  .access-step b {
    font-size: 11px;
  }

  .access-step-line {
    width: 24px;
    margin-left: 2px;
    margin-right: 2px;
  }
}

/* Final form builder layout overrides must come after legacy admin responsive rules. */
@media (min-width: 901px) {
  body.admin-shell .builder {
    display: grid !important;
    grid-template-columns: 260px minmax(0, 1fr) 290px !important;
    flex-direction: initial !important;
    min-height: calc(100vh - 130px) !important;
    height: auto !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  body.admin-shell .builder > .library,
  body.admin-shell .builder > .props {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
  }

  body.admin-shell .builder > .canvas {
    display: block !important;
    width: auto !important;
  }
}

@media (max-width: 900px) {
  body.admin-shell .builder {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 12px !important;
    gap: 12px !important;
  }

  body.admin-shell .builder > .library,
  body.admin-shell .builder > .canvas,
  body.admin-shell .builder > .props {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn.sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: auto;
}

.btn:disabled,
button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== ADVANCED ATTENDANCE PORTAL ===== */
.attendance-shell {
  padding: 26px 28px 22px;
  border: 2px solid rgba(103, 98, 255, 0.55);
  border-radius: 26px;
  background: rgba(255,255,255,0.5);
  box-shadow: 0 12px 30px rgba(99,91,255,0.08);
}

.attendance-shell .public-head {
  margin-bottom: 18px;
}

.attendance-shell .dynamic-form-logo {
  display: block !important;
  width: 30px !important;
  height: 30px !important;
  max-width: 30px !important;
  margin: 0 auto 10px !important;
  object-fit: contain !important;
}

.attendance-shell .public-head > .logo {
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0 auto 10px;
  place-items: center;
  font-size: 22px;
}

.attendance-shell .public-brand {
  display: block !important;
  margin: 0 0 8px;
  text-align: center;
}

.attendance-shell .stats {
  margin-top: 8px;
}

.attendance-inline-form,
.attendance-mark-form,
.attendance-upload-form {
  border: 1.5px solid rgba(103, 98, 255, 0.38);
  border-radius: 24px;
  background: rgba(255,255,255,0.8);
  box-shadow: none;
}

.attendance-inline-form {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 22px 20px;
  margin: 18px 0 22px;
}

.attendance-inline-form label,
.attendance-upload-form .attendance-label {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.required-label {
  display: inline-block;
  margin-left: 6px;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 500;
}

.field-with-icon {
  position: relative;
  flex: 1;
}

.field-with-icon .input {
  padding-right: 46px;
  min-height: 58px;
  border-radius: 16px;
  border-color: rgba(103, 98, 255, 0.38);
  margin: 0;
  background: rgba(255,255,255,0.9);
}

.field-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  opacity: 0.8;
  pointer-events: none;
}

.attendance-mark-form {
  margin-bottom: 22px;
}

.attendance-upload-form {
  max-width: 760px;
  margin: 22px auto 0;
  padding: 28px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.upload-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 18px;
}

.upload-section-heading + .attendance-label {
  margin-top: 0;
}

.upload-section-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.upload-section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.upload-step {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--primary);
  font-weight: 800;
}

.attendance-history {
  margin-top: 22px;
}

.attendance-month-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 14px;
  margin: 22px auto 0;
  padding: 18px 20px;
  border: 1px solid #c7d2fe;
  border-radius: 18px;
  background: linear-gradient(135deg, #eef2ff, #ffffff);
}

.summary-kicker {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.attendance-month-summary h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.attendance-month-summary p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-count {
  min-width: 112px;
  padding: 10px 14px;
  border-radius: 14px;
  text-align: center;
}

.summary-count strong,
.summary-count span {
  display: block;
}

.summary-count-input {
  display: block;
  width: 78px;
  margin: 4px auto 0;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.summary-count-input:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.summary-count strong {
  font-size: 25px;
  line-height: 1.1;
}

.summary-count span {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
}

.summary-count.present {
  color: #166534;
  background: #dcfce7;
}

.summary-count.absent {
  color: #b91c1c;
  background: #fee2e2;
}

.summary-count.joining {
  color: #3730a3;
  background: #e0e7ff;
}

.summary-date-input {
  display: block;
  width: 168px;
  margin: 5px auto 0;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(67, 56, 202, .22);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  color: inherit;
  font: 700 14px inherit;
  cursor: pointer;
  color-scheme: light;
}

.summary-date-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 5px;
}

.summary-date-picker .summary-date-input {
  margin: 0;
}

.summary-calendar-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(67, 56, 202, .22);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  cursor: pointer;
  font-size: 18px;
}

.summary-calendar-button:hover,
.summary-calendar-button:focus-visible {
  background: #eef2ff;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.summary-calendar-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.summary-date-input::-webkit-calendar-picker-indicator {
  width: 22px;
  height: 22px;
  margin-left: 5px;
  padding: 2px;
  cursor: pointer;
  opacity: .85;
}

.summary-date-input:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.summary-date-input[readonly] {
  cursor: not-allowed;
  opacity: .8;
}

.summary-count small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  opacity: .78;
}

.uploaded-months {
  margin: 20px 0 0;
  border-color: rgba(16, 185, 129, 0.28);
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

@media (max-width: 560px) {
  .attendance-month-summary {
    grid-template-columns: 1fr 1fr;
  }

  .attendance-month-summary > div:first-child {
    grid-column: 1 / -1;
  }

  .summary-count.joining {
    grid-column: 1 / -1;
  }

  .summary-date-input {
    width: min(100%, 210px);
  }

  .summary-date-picker { width: 100%; }
  .summary-date-picker .summary-date-input { flex: 1; width: auto; }
}

.uploaded-months-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.uploaded-months-heading h3 {
  margin: 0;
}

.uploaded-months-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.uploaded-check {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
}

.uploaded-months ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.uploaded-months li {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
}

.uploaded-months li strong {
  color: #166534;
}

.uploaded-months li span {
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
}

.uploaded-months li small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.upload-progress {
  margin-top: 18px;
}

.upload-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8edf7;
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--info));
  transition: width 180ms ease;
}

.upload-progress p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-open {
  overflow: hidden;
}

.attendance-modal[hidden] {
  display: none;
}

.attendance-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.attendance-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
}

.attendance-modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 30px 28px 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  text-align: center;
  animation: attendance-modal-in 180ms ease-out;
}

.attendance-modal-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #fff4e5;
  color: #c2410c;
  font-size: 28px;
  font-weight: 800;
}

.attendance-modal-card h2 {
  margin: 0 0 10px;
  color: #172554;
  font-size: 24px;
}

.attendance-modal-card p {
  margin: 0 auto 22px;
  max-width: 350px;
  color: #64748b;
  line-height: 1.6;
}

@keyframes attendance-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.file-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 62px;
  margin-top: 8px;
  margin-bottom: 18px;
  padding: 8px 14px;
  border: 1.5px solid rgba(103, 98, 255, 0.42);
  border-radius: 18px;
  background: rgba(245,247,255,0.8);
  cursor: pointer;
}

.file-picker input {
  display: none;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(103, 98, 255, 0.38);
  border-radius: 12px;
  background: #e5e7fb;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
}

.file-name {
  color: #475569;
  font-size: 15px;
  font-weight: 500;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  width: 100%;
}

.file-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(103, 98, 255, 0.25);
  background: #fff;
}

.file-preview .pdf-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 64px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid rgba(185, 28, 28, 0.2);
}

.file-preview-meta {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.file-size-warning {
  color: #b45309;
}

.attendance-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.attendance-actions .muted {
  font-size: 16px;
}

.attendance-submit {
  min-width: 260px;
  min-height: 50px;
  border-radius: 14px;
  font-size: 17px;
}

/* ===== INPUTS & FORMS ===== */
label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  text-transform: none;
}

label:first-of-type {
  margin-top: 0;
}

.input,
input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.3s ease;
  margin: 6px 0 14px 0;
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
  background: var(--card);
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'Monaco', 'Courier New', monospace;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: 8px;
  cursor: pointer;
}

/* ===== CHECKBOX LABEL ===== */
.check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.check input {
  width: auto !important;
  margin: 0 !important;
  cursor: pointer;
}

.check label {
  margin: 0 !important;
  display: inline;
  font-weight: 500;
}

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
}

.imported-data-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.imported-data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13px;
}

.imported-data-table th,
.imported-data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  line-height: 1.35;
  white-space: nowrap;
}

.imported-data-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
}

.imported-data-table td:first-child,
.imported-data-table th:first-child {
  width: 44px;
  min-width: 44px;
  padding-inline: 12px;
  text-align: center;
}

.imported-data-table tbody tr:hover {
  background: #f8faff;
}

.imported-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.imported-data-table td:last-child,
.imported-data-table th:last-child {
  min-width: 150px;
}

.imported-data-table td:last-child .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 8px;
}

.imported-data-table td:last-child .btn {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .imported-data-table th,
  .imported-data-table td {
    padding: 10px 12px;
  }
}
}

.settings-menu-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.settings-menu-head h1 { margin: 6px 0 4px; }
.settings-menu-head p { max-width: 680px; margin: 0; color: var(--muted); }

.menu-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.menu-help-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid #dfe5f2;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #f8faff);
}

.menu-help-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.menu-help-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.settings-menu-panel { margin-bottom: 18px; padding: 22px; }

.settings-menu-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-menu-section-head h2 { margin: 0 0 4px; }
.settings-menu-section-head p { margin: 0; color: var(--muted); font-size: 13px; }

.menu-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.menu-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.menu-role-table-wrap,
.menu-member-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
}

.menu-role-table,
.menu-member-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.menu-role-table th,
.menu-role-table td,
.menu-member-table th,
.menu-member-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.menu-role-table th,
.menu-member-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.menu-role-table th:not(:first-child),
.menu-role-table td:not(:first-child) {
  width: 130px;
  text-align: center;
}

.menu-role-table th:first-child,
.menu-role-table td:first-child,
.menu-member-table th:first-child,
.menu-member-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 220px;
  background: #fff;
  box-shadow: 8px 0 12px -12px rgba(15, 23, 42, .35);
}

.menu-role-table th:first-child,
.menu-member-table th:first-child {
  z-index: 2;
  background: #f8fafc;
}

.menu-role-table td:first-child small,
.menu-member-table td:first-child small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.menu-role-heading,
.menu-role-table th small { display: block; }
.menu-role-table th small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.menu-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.menu-toggle-ui {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: #cbd5e1;
  transition: background .2s ease;
}

.menu-toggle-ui::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  content: "";
  transition: transform .2s ease;
}

.menu-toggle input:checked + .menu-toggle-ui { background: var(--primary); }
.menu-toggle input:checked + .menu-toggle-ui::after { transform: translateX(16px); }
.menu-toggle input:focus-visible + .menu-toggle-ui { outline: 3px solid rgba(99, 91, 255, .22); outline-offset: 2px; }

.menu-override-select {
  min-width: 125px;
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
}

.menu-empty-state {
  padding: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  text-align: center;
}

.menu-empty-state p { margin: 4px 0 14px; color: var(--muted); font-size: 13px; }

.settings-menu-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px 20px;
}

@media (max-width: 800px) {
  .settings-menu-head { align-items: stretch; flex-direction: column; }
  .menu-help-grid { grid-template-columns: 1fr; }
  .settings-menu-panel { padding: 16px; }
  .settings-menu-section-head,
  .settings-menu-actions { align-items: stretch; flex-direction: column; }
}

/* Final responsive admin shell */
body:not(.public-no-nav) {
min-width: 0;
overflow-x: hidden;
}

body:not(.public-no-nav) .top {
color: #e2e8f0;
background: linear-gradient(180deg, #111827 0%, #1e1b4b 100%);
}

body:not(.public-no-nav) .top b {
overflow: hidden;
color: #fff;
text-overflow: ellipsis;
white-space: nowrap;
}

body:not(.public-no-nav) .top nav a {
position: relative;
color: #cbd5e1;
font-weight: 650;
transition: background .2s ease, color .2s ease, transform .2s ease;
}

body:not(.public-no-nav) .top nav a:hover {
color: #fff;
background: rgba(129,140,248,.16);
transform: translateX(2px);
}

body:not(.public-no-nav) .top nav a[href$="/logout"] {
margin-top: 10px;
color: #fecaca;
border-top: 1px solid rgba(255,255,255,.1);
border-radius: 0 0 10px 10px;
}

body:not(.public-no-nav) main {
box-sizing: border-box;
max-width: 1600px;
margin-inline: auto;
}

@media (min-width: 901px) {
body:not(.public-no-nav) .top {
  width: 256px;
  padding: 28px 14px;
}

body:not(.public-no-nav) .top b {
  padding: 0 12px 24px;
  font-size: 18px;
}

body:not(.public-no-nav) .top nav {
  gap: 5px;
}

body:not(.public-no-nav) .top nav a {
  padding: 12px 14px;
}
}

@media (max-width: 900px) {
body:not(.public-no-nav) .top {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 64px;
  padding: 0 18px;
}

body:not(.public-no-nav) .top b {
  max-width: calc(100% - 58px);
  padding: 0;
}

body:not(.public-no-nav) .mobile-menu-toggle {
  display: block;
  flex: 0 0 auto;
}

body:not(.public-no-nav) .top nav,
body:not(.public-no-nav) .top nav.mobile-menu-open {
  position: absolute;
  top: calc(100% + 8px);
  right: 12px;
  left: 12px;
  z-index: 110;
  display: none;
  max-height: calc(100dvh - 84px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(15,23,42,.98);
  box-shadow: 0 20px 45px rgba(15,23,42,.3);
}

body:not(.public-no-nav) .top nav.mobile-menu-open {
  display: grid;
}

body:not(.public-no-nav) .top nav a {
  padding: 13px 14px;
  border-radius: 10px;
}

body:not(.public-no-nav) .top nav a[href$="/logout"] {
  margin-top: 6px;
}

body:not(.public-no-nav) main {
  width: 100%;
  padding: 22px 18px;
}
}

@media (max-width: 600px) {
body:not(.public-no-nav) .top {
  height: 60px;
  padding: 0 12px;
}

body:not(.public-no-nav) .top nav,
body:not(.public-no-nav) .top nav.mobile-menu-open {
  right: 8px;
  left: 8px;
}

body:not(.public-no-nav) main {
  padding: 16px 12px;
}

body:not(.public-no-nav) .page-head,
body:not(.public-no-nav) .dashboard-head,
body:not(.public-no-nav) .report-card-head,
body:not(.public-no-nav) .support-section-head {
  align-items: stretch;
  flex-direction: column;
}

body:not(.public-no-nav) .actions,
body:not(.public-no-nav) .page-head .actions,
body:not(.public-no-nav) .dashboard-head .actions {
  width: 100%;
}

body:not(.public-no-nav) .actions .btn {
  flex: 1 1 140px;
  min-width: 0;
}

body:not(.public-no-nav):not(.public) .form-grid,
body:not(.public-no-nav):not(.public) .form-layout,
body:not(.public-no-nav) .two-col,
body:not(.public-no-nav) .grid,
body:not(.public-no-nav) .template-grid,
body:not(.public-no-nav) .support-layout,
body:not(.public-no-nav) .support-admin-layout {
  grid-template-columns: 1fr !important;
}

body:not(.public-no-nav) .table-wrap {
  margin-inline: -4px;
  width: calc(100% + 8px);
}
}

/* Deterministic admin shell layout */
.admin-shell {
min-width: 0;
overflow-x: hidden;
}

.admin-shell > .top {
background: linear-gradient(180deg, #111827 0%, #1e1b4b 100%);
}

.admin-shell > main {
box-sizing: border-box;
width: 100%;
min-width: 0;
margin: 0;
}

@media (min-width: 901px) {
.admin-shell {
  padding-left: 260px !important;
}

.admin-shell > .top {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  z-index: 1000;
  display: block !important;
  width: 260px !important;
  height: 100dvh !important;
  padding: 28px 14px !important;
  overflow-x: hidden;
  overflow-y: auto;
}

.admin-shell > .top b {
  display: block !important;
  width: 100%;
  padding: 0 12px 26px !important;
  font-size: 18px;
}

.admin-shell > .top nav {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}

.admin-shell > .top nav a {
  display: block !important;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  white-space: normal;
}

.admin-shell > .mobile-menu-toggle {
  display: none !important;
}
}

@media (max-width: 900px) {
.admin-shell {
  padding-left: 0 !important;
}

.admin-shell > .top {
  position: sticky !important;
  top: 0;
  z-index: 1000;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100% !important;
  height: 64px !important;
  padding: 0 18px !important;
}

.admin-shell > .top b {
  display: block !important;
  max-width: calc(100% - 58px);
  padding: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-shell > .mobile-menu-toggle {
  display: block !important;
  flex: 0 0 auto;
}

.admin-shell > .top nav {
  position: absolute !important;
  top: calc(100% + 8px);
  right: 12px;
  left: 12px;
  z-index: 1001;
  display: none !important;
  max-height: calc(100dvh - 84px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: #0f172a;
  box-shadow: 0 18px 45px rgba(15,23,42,.35);
}

.admin-shell > .top nav.mobile-menu-open {
  display: grid !important;
  gap: 3px;
}

.admin-shell > .top nav a {
  display: block !important;
  padding: 13px 14px;
  border-radius: 10px;
}

.admin-shell > main {
  width: 100%;
  padding: 22px 18px !important;
}
}

@media (max-width: 600px) {
.admin-shell > .top {
  height: 60px !important;
  padding: 0 12px !important;
}

.admin-shell > .top nav {
  right: 8px;
  left: 8px;
}

.admin-shell > main {
  padding: 16px 12px !important;
}

.admin-shell .page-head,
.admin-shell .dashboard-head,
.admin-shell .report-card-head,
.admin-shell .support-section-head {
  align-items: stretch;
  flex-direction: column;
}

.admin-shell .actions {
  width: 100%;
  flex-wrap: wrap;
}

.admin-shell .actions .btn {
  flex: 1 1 140px;
  min-width: 0;
}

.admin-shell .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.admin-shell .table-wrap table {
  min-width: 680px;
}
}

/* Final content sizing for reports and all admin data tables */
.admin-shell > main > * {
min-width: 0;
max-width: 100%;
}

.admin-shell .attendance-filter-card {
  max-width: 1120px;
  padding: 0;
}

.admin-shell .attendance-filter-form {
  display: grid;
  grid-template-columns: minmax(360px, 1.5fr) minmax(180px, .75fr) minmax(240px, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 22px 26px;
}

.admin-shell .attendance-filter-form > div {
  min-width: 0;
}

.admin-shell .attendance-filter-form label {
  display: block;
  margin-bottom: 8px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.admin-shell .attendance-filter-form .input {
  width: 100%;
  box-sizing: border-box;
}

.admin-shell .attendance-filter-form > .btn {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .admin-shell .attendance-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell .attendance-filter-form > .btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .admin-shell .attendance-filter-card {
    width: 100%;
  }

  .admin-shell .attendance-filter-form {
    grid-template-columns: 1fr;
    padding: 18px;
  }
}

.admin-shell .card {
min-width: 0;
max-width: 100%;
}

.admin-shell .table-wrap {
display: block;
width: 100% !important;
max-width: 100% !important;
overflow-x: auto !important;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
}

.admin-shell .table-wrap table {
display: table;
width: 100% !important;
min-width: 900px !important;
table-layout: auto;
border-collapse: collapse;
}

.admin-shell .table-wrap th,
.admin-shell .table-wrap td {
box-sizing: border-box;
padding: 12px 14px !important;
vertical-align: middle;
}

.admin-shell .table-wrap th {
white-space: nowrap;
}

.admin-shell .table-wrap td {
white-space: normal;
overflow-wrap: anywhere;
}

.admin-shell .table-wrap th:first-child,
.admin-shell .table-wrap td:first-child {
min-width: 260px;
}

#reportFilters {
min-width: 0;
}

@media (max-width: 1200px) {
#reportFilters {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
}

@media (max-width: 700px) {
#reportFilters {
  grid-template-columns: 1fr !important;
}

.admin-shell .table-wrap {
  margin-inline: 0;
}

.admin-shell .table-wrap table {
  min-width: 760px !important;
}

.admin-shell .table-wrap th,
.admin-shell .table-wrap td {
  padding: 10px !important;
}
}

/* Unified modern workspace theme */
.admin-shell {
color: #172033;
background:
  radial-gradient(circle at 92% 0%, rgba(99, 91, 255, .08), transparent 28rem),
  #f5f7fb;
}

.admin-shell > main {
min-height: 100dvh;
padding-top: 34px !important;
padding-bottom: 48px !important;
}

.admin-shell > .top {
box-shadow: 10px 0 35px rgba(15, 23, 42, .12);
}

.admin-shell > .top b {
letter-spacing: -.025em;
}

.admin-shell h1,
.admin-shell h2,
.admin-shell h3 {
color: #172033;
letter-spacing: -.035em;
}

.admin-shell h1 {
font-size: clamp(26px, 3vw, 36px);
line-height: 1.1;
}

.admin-shell .page-head,
.admin-shell .dashboard-head {
margin-bottom: 24px;
}

.admin-shell .page-head p,
.admin-shell .dashboard-head p {
color: #697386;
line-height: 1.6;
}

.admin-shell .card,
.admin-shell .report-card,
.admin-shell .report-widget,
.admin-shell .table-wrap {
border: 1px solid rgba(226, 232, 240, .92);
border-radius: 18px;
background: rgba(255, 255, 255, .94);
box-shadow: 0 12px 35px rgba(30, 41, 99, .07);
}

.admin-shell .card,
.admin-shell .report-card {
padding: 22px;
}

.admin-shell .card:hover,
.admin-shell .report-card:hover,
.admin-shell .report-widget:hover {
border-color: rgba(99, 91, 255, .26);
box-shadow: 0 16px 40px rgba(30, 41, 99, .1);
}

.admin-shell .stats > div {
border: 1px solid rgba(226, 232, 240, .92);
border-radius: 18px;
background: rgba(255, 255, 255, .94);
box-shadow: 0 10px 28px rgba(30, 41, 99, .06);
}

.admin-shell .btn {
min-height: 42px;
border: 1px solid #dbe2ef;
border-radius: 11px;
box-shadow: 0 5px 14px rgba(30, 41, 99, .06);
font-weight: 700;
transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.admin-shell .btn:hover {
transform: translateY(-1px);
box-shadow: 0 9px 20px rgba(30, 41, 99, .12);
}

.admin-shell .btn.primary {
border-color: transparent;
background: linear-gradient(135deg, #635bff, #5146e5);
}

.admin-shell .input,
.admin-shell input,
.admin-shell textarea,
.admin-shell select {
min-height: 44px;
border: 1px solid #dbe2ef;
border-radius: 11px;
background: #fff;
color: #172033;
box-shadow: 0 2px 5px rgba(30, 41, 99, .03);
}

.admin-shell .input:focus,
.admin-shell input:focus,
.admin-shell textarea:focus,
.admin-shell select:focus {
border-color: #635bff;
outline: 3px solid rgba(99, 91, 255, .13);
box-shadow: none;
}

.admin-shell .table-wrap {
overflow-x: auto !important;
overflow-y: hidden;
}

.admin-shell .table-wrap > table {
background: #fff;
}

.admin-shell .table-wrap thead {
background: #f8faff;
}

.admin-shell .table-wrap th {
color: #526078;
font-size: 11px;
letter-spacing: .07em;
}

.admin-shell .table-wrap td {
color: #25324a;
border-bottom-color: #edf0f6;
}

.admin-shell .table-wrap tbody tr:hover {
background: #fafbff;
}

.admin-shell .badge {
border-radius: 999px;
font-weight: 700;
}

.admin-shell .table-pagination {
padding: 12px 2px 0;
}

@media (max-width: 700px) {
.admin-shell > main {
  padding-top: 22px !important;
  padding-bottom: 30px !important;
}

.admin-shell .card,
.admin-shell .report-card {
  padding: 16px;
  border-radius: 15px;
}

.admin-shell .stats {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px;
}

.admin-shell .stats > div {
  padding: 16px;
}
}

@media (max-width: 420px) {
.admin-shell .stats {
  grid-template-columns: 1fr !important;
}

.admin-shell .actions .btn {
  width: 100%;
  flex-basis: 100%;
}
}

/* Keep the authentication shell centered at every viewport size. */
.login {
display: grid !important;
place-items: center !important;
width: 100%;
height: 100dvh;
min-width: 0;
margin: 0;
padding: clamp(12px, 3vw, 42px);
overflow: hidden;
}

.auth-layout {
display: grid !important;
grid-template-columns: minmax(0, 1fr) minmax(390px, 1fr);
margin-inline: auto;
transform: none;
}

.auth-visual {
display: flex !important;
flex-direction: column;
justify-content: space-between;
color: #fff;
}

.auth-visual h2,
.auth-visual p,
.auth-visual .auth-kicker,
.auth-visual .auth-trust {
color: inherit;
}

.auth-visual h2 em {
color: #a5b4fc;
}

.auth-main {
display: grid !important;
place-items: center !important;
min-width: 0;
background: rgba(255,255,255,.86);
}

.auth-card {
margin-inline: auto;
}

@media (min-width: 761px) {
body.login > .auth-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 1fr) !important;
}
}

@media (max-width: 760px) {
.login {
  display: block !important;
  height: auto;
  min-height: 100dvh;
  padding: 12px;
  overflow-y: auto;
}

.auth-layout {
  display: block !important;
  grid-template-columns: none;
  width: min(100%, 560px);
  margin-inline: auto;
}

.auth-main {
  display: grid !important;
  justify-items: center;
  padding: 0 clamp(18px, 6vw, 30px) !important;
}

.auth-visual {
  min-height: 230px !important;
  padding: 22px !important;
}

.auth-visual-copy {
  padding: 20px 0 10px !important;
}

.auth-visual h2 {
  margin: 12px 0 8px !important;
  font-size: 28px !important;
}

.auth-visual p {
  line-height: 1.45;
}

.auth-preview {
  margin-top: 12px !important;
}

.auth-preview,
.auth-trust {
  display: none !important;
}

.auth-card {
  width: min(100%, 410px);
}
}

@media (max-width: 900px) {
.login {
  display: grid !important;
  min-height: 100dvh;
  height: auto;
  padding: 20px 16px !important;
  overflow-y: auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(99,102,241,.16), transparent 22rem),
    linear-gradient(145deg, #f8fbff, #eef2ff 52%, #f8fafc);
}

.auth-layout {
  display: block !important;
  width: min(100%, 520px);
  min-height: auto;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 28px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 24px 70px rgba(30,41,99,.15);
  backdrop-filter: blur(18px);
}

.auth-visual {
  display: none !important;
}

.auth-main {
  min-height: 0;
  padding: clamp(28px, 7vw, 52px) clamp(22px, 7vw, 54px) 28px !important;
  background: rgba(255,255,255,.92);
}

.auth-card {
  width: min(100%, 410px);
}

.auth-heading {
  margin-bottom: 26px;
}

.auth-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 16px;
}

.auth-heading h1 {
  font-size: clamp(29px, 6vw, 36px);
}

.auth-heading p {
  font-size: 14px;
}

.auth-card label {
  display: block;
  margin: 18px 0 8px;
}

.input-wrap > span {
  top: 15px;
  left: 16px;
}

.input-wrap .input {
  min-height: 52px;
  padding-left: 42px;
  border-radius: 14px;
  background: #f8faff;
}

.label-row {
  margin-top: 2px;
}

.label-row label {
  margin-top: 18px;
}

.auth-submit {
  min-height: 52px;
  margin-top: 24px;
  border-radius: 14px;
}

.auth-footer {
  margin-top: 22px;
  padding-top: 18px;
}
}
.table-pagination {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 4px;
}
.table-pagination .actions {
  display:flex;
  align-items:center;
  gap:8px;
}
.table-pagination button:disabled {
  opacity:.45;
  cursor:not-allowed;
}
@media print {
  body { background:#fff; }
  .top, .report-actions, .card form, .uploaded-months, .table-pagination, .report-insights, .btn, .file-rename-form { display:none !important; }
  main { max-width:none; padding:0; }
  .card { border:0; box-shadow:none; padding:0; }
  table { font-size:10px; }
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

thead {
  background: linear-gradient(135deg, #fafbfe 0%, #f3f4f6 100%);
  border-bottom: 2px solid var(--line);
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: #fafbfe;
}

tbody tr:last-child td {
  border-bottom: none;
}

.data-preview {
  max-width: 430px;
  line-height: 1.6;
  word-wrap: break-word;
}

/* ===== FORM-SPECIFIC ===== */
.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.field label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.field label span {
  color: var(--danger);
  margin-left: 4px;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.field {
  grid-column: span var(--w, 12);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.options label {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  font-weight: 500;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
}

.options label:hover {
  border-color: var(--primary);
  background: #f3f4f6;
}

.options input {
  width: auto;
  margin-right: 8px;
  margin-bottom: 0;
}

/* ===== STEP ACTIONS ===== */
.step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.acceptance-check {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 360px;
  width: auto;
  max-width: 680px;
  margin: 0 0 0 auto;
  color: var(--text);
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 650;
  line-height: 1.5;
}

.acceptance-check input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 4px 0 0;
}

@media (max-width: 650px) {
  .acceptance-check {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }

  .step-actions > .btn {
    flex: 1 1 auto;
  }
}

/* ===== FILE UPLOAD ===== */
.file-preview {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-preview > div {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.file-preview img {
  display: block;
  width: 150px;
  height: 100px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.uploaded-file-card {
  min-width: 0;
  overflow: hidden;
}

.uploaded-file-card .uploaded-file-preview {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  margin: 0 0 14px;
}

/* ===== SIGNATURE ===== */
.signature {
  width: 100%;
  height: 150px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: #f8fafc;
  cursor: crosshair;
}

/* ===== FORM SECTIONS ===== */
.form-section {
  grid-column: 1 / -1;
  padding: 16px 0;
  border-bottom: 2px solid var(--line);
  margin: 12px 0 24px 0;
}

.form-section h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
}

.form-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ===== PUBLIC FORM ===== */
.public {
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
  min-height: 100vh;
  padding: 40px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.public-card {
  width: min(100%, 900px);
  box-sizing: border-box;
  max-width: 900px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 28px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

/* Keep the published form centered on wide desktop screens. */
body.public {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  justify-content: center !important;
}

body.public > .public-card,
body.public > .access-page,
body.public > main.access-page {
  flex: 0 1 900px;
  width: min(100%, 900px) !important;
  max-width: 900px !important;
  margin-inline: auto !important;
}

body.public > main.access-page > .public-card {
  width: 100% !important;
  max-width: 900px !important;
  margin-inline: auto !important;
  box-sizing: border-box;
}

@media (min-width: 901px) {
  body.public {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 40px 24px !important;
  }

  body.public > main.access-page {
    display: block !important;
    width: min(700px, calc(100vw - 48px)) !important;
    max-width: 700px !important;
    margin-inline: auto !important;
  }

  body.public > main.access-page > .public-card {
    width: 100% !important;
    max-width: 700px !important;
    margin-inline: auto !important;
  }
}

.public > .access-page {
  width: min(100%, 900px);
  margin: 0 auto;
}

.verified-form-details {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid #c7d2fe;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
}

.verified-form-details > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.verified-form-details > div > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 10px;
  color: #fff;
  background: #4f46e5;
  font-weight: 800;
}

.verified-form-details h2 {
  margin: 0;
  color: #27346a;
  font-size: 17px;
}

.verified-form-details > p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.verified-form-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.verified-form-details dl > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(199, 210, 254, .7);
  border-radius: 10px;
  background: rgba(255, 255, 255, .8);
}

.verified-form-details dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.verified-form-details dd {
  margin: 3px 0 0;
  color: #172033;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .verified-form-details {
    padding: 14px;
  }

  .verified-form-details dl {
    grid-template-columns: 1fr;
  }
}

.public-head {
  text-align: center;
  margin-bottom: 32px;
}

.public-head .logo {
  font-size: 40px;
  margin-bottom: 16px;
}

.dynamic-form-logo {
 display: inline-block;
 width: 30px;
 height: 30px;
 margin-bottom: 10px;
 object-fit: contain;
 border-radius: 10px;
 box-shadow: 0 5px 14px rgba(79,70,229,.16);
}

.access-form-logo {
 display: block;
 width: 30px !important;
 height: 30px !important;
 margin: 0 auto 10px;
 padding: 0;
 object-fit: contain;
 object-position: center;
 border-radius: 6px;
 background: transparent;
 box-shadow: none;
}

.form-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-name-row .input {
  flex: 1;
}

.form-name-icon,
.form-name-icon-placeholder {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.form-list-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.form-list-title h2 {
  margin: 0;
}

.form-list-icon,
.form-list-icon-placeholder {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.form-list-icon-placeholder {
  display: grid;
  place-items: center;
  color: var(--primary);
}

.form-name-icon-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 22px;
}

.builder-logo-preview {
 display: block;
 width: 96px;
 height: 96px;
 margin: 8px 0 12px;
 object-fit: contain;
 border-radius: 18px;
 border: 1px solid var(--line);
 background: #f8fafc;
}

.public-head h1 {
  font-size: 32px;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.public-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* ===== FORM STEPS ===== */
.form-step {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== BUILDER INTERFACE ===== */
.builder-shell {
  margin: -28px;
  background: #f5f7fb;
}

.builder-head {
  height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.builder-head h1 {
  margin: 2px 0 0 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.builder-head a {
  font-size: 12px;
  color: var(--muted);
}

.builder-head .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.builder-head .actions .btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.builder {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 290px;
  min-height: calc(100vh - 130px);
  gap: 0;
}

.library,
.props {
  background: #f8fafc;
  padding: 14px 12px 18px;
  overflow-y: auto;
  border: 1px solid var(--line);
}

.library {
  border-right: 1px solid var(--line);
}

.props {
  border-left: 1px solid var(--line);
}

.library h3,
.props h3 {
  margin: 0 0 10px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.canvas {
  padding: 18px 18px 26px;
  overflow-y: auto;
  background: #f3f4f6;
}

.canvas-meta {
  background: #fff;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
}

.library-item {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 6px 0;
  cursor: grab;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
  color: #334155;
}

.library-item:hover {
  border-color: rgba(99, 91, 255, 0.7);
  background: #f8faff;
}

.library-item:active {
  cursor: grabbing;
}

.step-box {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 14px;
  padding: 12px 12px 10px;
  margin-bottom: 12px;
  min-height: 90px;
  box-shadow: none;
}

.step-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.step-title b {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.step-title .actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.drop-zone {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  min-height: 86px;
  padding: 8px;
  border: 1px dashed rgba(148, 163, 184, 0.65);
  border-radius: 10px;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.drop-zone.drag-over {
  border-color: var(--primary);
  background: #eef2ff;
}

.builder-field {
  grid-column: span var(--w, 12);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.builder-field:hover {
  border-color: rgba(99, 91, 255, 0.7);
}

.builder-field.selected {
  border: 1.5px solid var(--primary);
  background: #f8faff;
  box-shadow: 0 0 0 2px rgba(99, 91, 255, 0.08);
}

.builder-field.dragging {
  opacity: 0.45;
}

.builder-field.drop-target {
  border-color: var(--primary);
  border-style: dashed;
  background: #eef2ff;
}

.builder-field b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #1f2937;
}

.builder-field .muted {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.field-actions {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.builder-field:hover .field-actions {
  opacity: 1;
}

.icon-btn {
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #fff;
  border-radius: 7px;
  padding: 5px 7px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.props label {
  font-size: 12px;
  font-weight: 700;
  display: block;
  margin-top: 12px;
  color: var(--text);
}

#props {
  display: grid;
  gap: 14px;
}

#props h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

#props p,
#props small,
#props .muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

#props .input,
#props textarea,
#props select,
#props input[type="file"] {
  margin: 0;
  border-radius: 10px;
  border-color: rgba(148, 163, 184, 0.35);
  background: #fff;
}

#props textarea {
  min-height: 88px;
}

#props .btn {
  width: 100%;
  justify-content: center;
}

#props .check {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: #f8fafc;
}

#props hr {
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.builder-logo-preview {
  display: block;
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 1100px) {
  .builder {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .library,
  .props {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    margin: 0 18px 18px;
  }

  .canvas {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .builder-shell {
    margin: -12px;
  }

  .builder-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .builder-head .actions {
    width: 100%;
  }

  .builder-head .actions .btn {
    flex: 1 1 0;
    justify-content: center;
  }

  .library,
  .props,
  .canvas {
    padding: 14px;
  }

  .step-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .drop-zone {
    gap: 10px;
    padding: 10px;
  }
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chip {
  padding: 6px 10px;
  background: #eef2ff;
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===== LOGIN PAGE ===== */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 92vw);
  background: var(--card);
  padding: 36px;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.login-card h1 {
  margin: 0 0 8px 0;
  font-size: 32px;
  font-weight: 700;
}

.login-card p {
  margin: 0 0 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.login-card small {
  display: block;
  color: var(--muted);
  margin-top: 12px;
  font-size: 12px;
  text-align: center;
}

.login-card small a {
  color: var(--primary);
  text-decoration: underline;
}

.alert-card {
  text-align: center;
  width: min(460px, 92vw);
}

.alert-card p {
  line-height: 1.7;
}

.alert-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 28px;
  font-weight: 700;
}

.alert-card .btn {
  display: inline-flex;
  margin-top: 8px;
}

.workspace-logo-preview {
  display: block;
  width: min(220px, 100%);
  max-height: 90px;
  object-fit: contain;
  object-position: left center;
  padding: 12px;
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.public-brand {
  display: block;
  margin: 8px 0 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workspace-nav-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}

/* Keep the workspace logo compact inside the fixed admin sidebar. */
body.admin-shell > .top #workspaceBrand .workspace-nav-logo {
  display: inline-block !important;
  width: 96px !important;
  height: 54px !important;
  min-width: 96px !important;
  min-height: 54px !important;
  max-width: 96px !important;
  max-height: 54px !important;
  margin: 0 auto 12px !important;
  object-fit: contain !important;
  vertical-align: middle !important;
}

body.admin-shell > .top #workspaceBrand {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  min-height: 54px !important;
  max-height: 86px !important;
  overflow: hidden !important;
  line-height: 1.2 !important;
}

@media (min-width: 901px) {
  body.admin-shell > .top #workspaceBrand {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    height: 86px !important;
    padding: 0 8px 14px !important;
  }

  body.admin-shell > .top #workspaceBrand .workspace-nav-logo {
    flex: 0 0 54px !important;
    margin: 0 !important;
  }
}

@media (max-width: 900px) {
  body.admin-shell > .top #workspaceBrand .workspace-nav-logo {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    margin: 0 8px 0 0 !important;
  }
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 18px;
  background: #1f2937;
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: slideIn 0.3s ease-out;
  font-weight: 500;
  font-size: 13px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
  color: #fff;
}

.toast.info {
  background: var(--info);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== CARDS WITH STATES ===== */
.card.success {
  border-left: 4px solid var(--success);
  background: #f0fdf4;
}

.card.success h3 {
  color: #15803d;
  margin: 0 0 12px 0;
}

.card.success p {
  color: #166534;
  margin: 6px 0;
}

.card.error {
  border-left: 4px solid var(--danger);
  background: #fef2f2;
}

.card.error h3 {
  color: #991b1b;
  margin: 0 0 12px 0;
}

.card.error p {
  color: #7f1d1d;
  margin: 6px 0;
}

.card.warning {
  border-left: 4px solid var(--warning);
  background: #fffbeb;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .builder {
    grid-template-columns: 240px 1fr 280px;
  }
  
  .library h3 {
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .builder {
    grid-template-columns: 210px 1fr;
  }
  
  .props {
    display: none;
  }
  
  .builder-shell {
    margin: -28px;
  }
  
  .field,
  .builder-field {
    grid-column: 1 / -1 !important;
  }
  
  .top nav {
    gap: 12px;
  }
  
  .top {
    padding: 0 14px;
  }
  
  .top nav a:nth-child(4) {
    display: none;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  main {
    padding: 16px;
  }
  
  .top b {
    font-size: 16px;
  }
  
  .top nav {
    font-size: 11px;
    gap: 8px;
  }
  
  .builder {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .library {
    display: none;
  }
  
  .canvas {
    padding: 12px;
  }
  
  .public-card {
    padding: 20px;
    border-radius: 16px;
  }
  
  .stats {
    grid-template-columns: 1fr;
  }
  
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hero {
    padding: 24px;
  }
  
  .hero h1 {
    font-size: 24px;
  }
  
  .card {
    padding: 18px;
  }
  
  .login-card {
    padding: 24px;
  }
  
  .table-wrap {
    font-size: 12px;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 12px;
  }
}

/* ===== AUTH EXPERIENCE ===== */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 42px);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(99,102,241,.2), transparent 34rem),
    radial-gradient(circle at 100% 100%, rgba(6,182,212,.16), transparent 32rem),
    #f7f9fd;
}

.auth-layout {
  width: min(1120px, 100%);
  min-height: 680px;
  grid-template-columns: minmax(0, .95fr) minmax(390px, 1.05fr);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 32px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 30px 90px rgba(30,41,99,.16), 0 8px 25px rgba(15,23,42,.05);
}

.auth-visual {
  position: relative;
  isolation: isolate;
  padding: clamp(30px, 5vw, 64px);
  background:
    radial-gradient(circle at 85% 12%, rgba(129,140,248,.32), transparent 15rem),
    radial-gradient(circle at 10% 85%, rgba(6,182,212,.2), transparent 18rem),
    linear-gradient(145deg, #111827, #27235f 55%, #4f46e5);
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 24px;
  z-index: -1;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  pointer-events: none;
}

.auth-visual::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -120px;
  top: -110px;
  z-index: -1;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,.04), 0 0 0 58px rgba(255,255,255,.025);
}

.auth-visual-copy {
  margin: auto 0;
  padding: 70px 0 46px;
}

.auth-visual h2 {
  max-width: 430px;
  margin: 20px 0 16px;
  font-size: clamp(34px, 4.3vw, 54px);
  line-height: 1.04;
  letter-spacing: -2.6px;
}

.auth-visual p {
  max-width: 410px;
  margin: 0;
  color: #dbe4f4;
  line-height: 1.75;
}

.auth-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(330px, 100%);
  margin-top: 34px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(15,23,42,.22);
  backdrop-filter: blur(10px);
}

.auth-preview-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 0 5px rgba(103,232,249,.12);
}

.auth-preview strong,
.auth-preview small {
  display: block;
}

.auth-preview strong {
  color: #fff;
  font-size: 12px;
}

.auth-preview small {
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 11px;
}

.auth-preview-arrow {
  margin-left: auto;
  color: #a5b4fc;
  font-size: 18px;
}

.auth-main {
  padding: clamp(32px, 6vw, 76px);
  background: rgba(255,255,255,.78);
}

.auth-card {
  width: min(410px, 100%);
}

.auth-heading h1 {
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -1.6px;
}

.auth-card label {
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

.auth-card .input {
  min-height: 50px;
  border: 1px solid #dbe3ef;
  border-radius: 13px;
  background: rgba(248,250,255,.9);
}

.auth-card .input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.13);
}

.auth-submit {
  min-height: 50px;
  border-radius: 13px;
  background: linear-gradient(105deg, #4f46e5, #6366f1 55%, #06b6d4);
  box-shadow: 0 13px 25px rgba(79,70,229,.24);
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(79,70,229,.3);
}

@media (max-width: 760px) {
  .login {
    display: block;
    padding: 14px;
  }

  .auth-layout {
    display: block;
    min-height: auto;
    border-radius: 24px;
  }

  .auth-visual {
    min-height: 360px;
    padding: 26px;
  }

  .auth-visual::before {
    inset: 14px;
  }

  .auth-visual-copy {
    padding: 46px 0 28px;
  }

  .auth-visual h2 {
    margin-top: 14px;
    font-size: 34px;
  }

  .auth-preview {
    margin-top: 22px;
  }

  .auth-main {
    padding: 38px 24px 30px;
  }
}

/* ===== MODERN UI POLISH ===== */
:root {
    --bg: #f6f8fc;
    --card: rgba(255,255,255,.94);
    --text: #111827;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #4f46e5;
    --shadow: 0 10px 30px rgba(15,23,42,.06);
    --shadow-lg: 0 24px 70px rgba(15,23,42,.12);
}

body {
    background:
      radial-gradient(circle at 5% -10%, rgba(99,102,241,.12), transparent 30rem),
      radial-gradient(circle at 100% 0%, rgba(14,165,233,.10), transparent 28rem),
      var(--bg);
}

  .top {
    height: 70px;
    padding: 0 clamp(16px, 4vw, 48px);
    background: rgba(15,23,42,.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .top b {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    letter-spacing: -.6px;
  }

  .top nav {
    gap: 6px;
    align-items: center;
  }

  .top nav a {
    padding: 9px 11px;
    border-radius: 9px;
    color: #cbd5e1;
  }

  .top nav a:hover {
    opacity: 1;
    color: #fff;
    background: rgba(255,255,255,.1);
  }

  main {
    width: min(1500px, 100%);
    padding: clamp(20px, 4vw, 42px);
  }

  .hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(120deg, #111827 0%, #312e81 52%, #4338ca 100%);
  }

  .hero:after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -80px;
    top: -130px;
    border-radius: 50%;
    background: rgba(129,140,248,.25);
    filter: blur(4px);
  }

  .card, .stats > div, .table-wrap, .public-card, .login-card {
    border-color: rgba(226,232,240,.9);
    box-shadow: var(--shadow);
  }

  .card:hover, .stats > div:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
  }

  .btn {
    border-radius: 11px;
    min-height: 42px;
    box-shadow: 0 1px 1px rgba(15,23,42,.04);
  }

  .btn.primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 8px 18px rgba(79,70,229,.2);
  }

  .input, input, textarea, select {
    border-radius: 11px;
    border-color: #dbe3ef;
    background: rgba(255,255,255,.88);
  }

  .input:hover, input:hover, textarea:hover, select:hover {
    border-color: #a5b4fc;
  }

  .table-wrap {
    overflow: auto;
  }

  thead {
    background: #f8fafc;
  }

  tbody tr:hover {
    background: #f8faff;
  }

  .public {
    padding: clamp(20px, 5vw, 64px) 16px;
    background:
      radial-gradient(circle at 20% 0%, rgba(99,102,241,.16), transparent 25rem),
      radial-gradient(circle at 100% 20%, rgba(14,165,233,.13), transparent 24rem),
      #f8fafc;
  }

  .public-card {
    border: 1px solid rgba(255,255,255,.8);
    backdrop-filter: blur(12px);
  }

  .public-head .logo {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    box-shadow: 0 12px 30px rgba(79,70,229,.22);
  }

  .login {
    background:
      radial-gradient(circle at 15% 10%, rgba(99,102,241,.2), transparent 25rem),
      radial-gradient(circle at 90% 90%, rgba(14,165,233,.16), transparent 25rem),
      #f8fafc;
  }

  .login-card {
    position: relative;
    border: 1px solid rgba(255,255,255,.85);
  }

  .login-card:before {
    content: "⚡ FormOS";
    display: block;
    margin-bottom: 22px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .auth-layout {
    width: min(1180px, 100%);
    min-height: min(760px, 100vh);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    background: rgba(255,255,255,.68);
    backdrop-filter: blur(18px);
  }

  .auth-visual {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(32px, 5vw, 68px);
    color: #fff;
    background: linear-gradient(145deg, #111827 0%, #312e81 58%, #4f46e5 100%);
  }

  .auth-brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.5px;
  }

  .auth-kicker {
    color: #a5b4fc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
  }

  .auth-visual h2 {
    margin: 18px 0 14px;
    font-size: clamp(30px, 4vw, 50px);
    line-height: 1.08;
    letter-spacing: -1.8px;
  }

  .auth-visual h2 em {
    color: #a5b4fc;
    font-style: normal;
  }

  .auth-visual p {
    max-width: 390px;
    color: #cbd5e1;
    font-size: 15px;
  }

  .auth-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: #cbd5e1;
    font-size: 12px;
  }

  .auth-main {
    display: grid;
    place-items: center;
    padding: clamp(20px, 5vw, 68px);
  }

  .auth-card {
    width: min(410px, 100%);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .auth-card:before {
    display: none;
  }

  .auth-heading {
    margin-bottom: 28px;
  }

  .auth-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    box-shadow: 0 10px 22px rgba(79,70,229,.2);
  }

  .auth-heading h1 {
    margin: 0 0 8px;
    font-size: 30px;
    letter-spacing: -1px;
  }

  .auth-heading p {
    margin: 0;
    color: var(--muted);
  }

  .input-wrap {
    position: relative;
  }

  .input-wrap > span {
    position: absolute;
    left: 14px;
    top: 17px;
    z-index: 1;
    color: #94a3b8;
    font-size: 13px;
  }

  .input-wrap .input {
    padding-left: 40px;
  }

  .label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .label-row a {
    font-size: 12px;
  }

  .auth-submit {
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
    padding: 12px 16px;
  }

  .auth-submit span {
    font-size: 18px;
  }

  .auth-note {
    margin-top: 16px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
  }

  .auth-footer {
    margin-top: 24px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
  }

  .dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
  }

  .dashboard-head h1 {
    margin: 5px 0;
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -1.2px;
  }

  .eyebrow {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
  }

  .eyebrow.light {
    color: #c7d2fe;
  }

  .dashboard-hero {
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }

  .dashboard-hero h2 {
    margin: 12px 0 4px;
    font-size: clamp(22px, 3vw, 30px);
  }

  .hero-orb {
    display: grid;
    place-items: center;
    width: 115px;
    height: 115px;
    margin-right: 5%;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 35px;
    color: #c7d2fe;
    font-size: 48px;
    background: rgba(255,255,255,.1);
    transform: rotate(8deg);
  }

  .report-stats {
    position: relative;
    z-index: 2;
    margin-top: -42px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  .report-widget {
    cursor: grab;
  }

  .report-widget:active {
    cursor: grabbing;
  }

  .report-widget.dragging {
    opacity: .45;
    transform: scale(.98);
  }

  .report-stats > .report-widget {
    position: relative;
    min-height: 214px;
    padding: 24px 22px 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 26px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(6px);
  }

  .report-stats .report-widget b {
    display: block;
    margin-top: 18px;
    font-size: clamp(2.7rem, 3vw, 4.5rem);
    line-height: 0.95;
    letter-spacing: -0.08em;
    color: #4f46e5;
  }

  .report-stats .report-widget span {
    display: block;
    margin-top: 18px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6475;
  }

  .report-stats .report-widget small {
    display: block;
    margin-top: 10px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
  }

  .stat-icon {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 24px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
  }

  .stat-icon.purple { color: #4f46e5; background: #e5ebff; }
  .stat-icon.blue { color: #0284c7; background: #dff4ff; }
  .stat-icon.green { color: #059669; background: #dffaf0; }
  .stat-icon.orange { color: #d97706; background: #fff0d6; }

  .report-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 20px;
    margin-top: 22px;
  }

  .report-card {
    min-height: 300px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
  }

  .report-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
  }

  .report-card-head h3 {
    margin: 0;
    font-size: 16px;
  }

  .report-card-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
  }

  .report-menu {
    color: var(--muted);
    font-size: 22px;
  }

  .mini-chart {
    height: 190px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
    padding-top: 25px;
    border-bottom: 1px solid var(--line);
  }

  .chart-col {
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
  }

  .chart-bar {
    position: relative;
    width: min(30px, 70%);
    min-height: 8px;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, #818cf8, #4f46e5);
  }

  .chart-bar span {
    position: absolute;
    top: -20px;
    left: 50%;
    color: var(--muted);
    font-size: 10px;
    transform: translateX(-50%);
  }

  .chart-col small {
    color: var(--muted);
    font-size: 10px;
  }

  .report-form-row, .activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
  }

  .report-form-row:last-child, .activity-row:last-child {
    border-bottom: 0;
  }

  .report-form-row b, .activity-row b {
    display: block;
    font-size: 13px;
  }

  .report-form-row small, .activity-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
  }

  .report-form-row strong {
    color: var(--primary);
    font-size: 20px;
  }

  .activity-row > a {
    white-space: nowrap;
    font-size: 11px;
  }

  .activity-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px #d1fae5;
  }

  .import-dropzone {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 170px;
    margin: 10px 0 16px !important;
    padding: 24px;
    border: 2px dashed #c7d2fe;
    border-radius: 16px;
    color: var(--text);
    text-align: center;
    cursor: pointer;
    background: linear-gradient(135deg, #f8faff, #eef2ff);
    transition: .2s ease;
  }

  .import-dropzone:hover, .import-dropzone.drag-over, .import-dropzone.has-file {
    border-color: var(--primary);
    background: #eef2ff;
    transform: translateY(-1px);
  }

  .import-dropzone input {
    display: none;
  }

  .import-dropzone small {
    color: var(--muted);
    font-weight: 400;
  }

  .import-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #4f46e5;
    background: #e0e7ff;
    font-size: 28px;
  }

  .import-file-meta, .import-preview {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0 16px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
  }

  .import-file-meta span, .import-preview small, .import-preview p {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
  }

  .import-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
  }

  .create-form-page {
    max-width: 1080px;
    margin: 0 auto;
  }

  .create-form-wizard {
    display: grid;
    gap: 18px;
  }

  .wizard-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .wizard-step > span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 10px;
    color: #4f46e5;
    background: #eef2ff;
    font-size: 11px;
    font-weight: 800;
  }

  .wizard-step h3 {
    margin: 3px 0 2px;
  }

  .wizard-step p {
    margin: 0;
  }

  .template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .template-card {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 0 !important;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    background: #fff;
    transition: .2s ease;
  }

  .template-card:hover, .template-card.selected, .template-card:has(input:checked) {
    border-color: var(--primary);
    background: #f8faff;
    box-shadow: 0 0 0 3px rgba(79,70,229,.08);
  }

  .template-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .template-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #4f46e5;
    background: #eef2ff;
    font-size: 20px;
  }

  .template-card small {
    color: var(--muted);
    font-size: 11px;
  }

  .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }

  .color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
  }

  .color-row input[type="color"] {
    width: 48px;
    height: 40px;
    padding: 3px;
    margin: 0;
    cursor: pointer;
  }

  .create-form-submit {
    width: 100%;
    justify-content: space-between;
    margin-top: 20px;
  }

  .auto-form-generator {
    max-width: 1000px;
    margin: 0 auto;
  }

  .auto-fields-input {
    min-height: 220px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  }

  .auto-field-preview {
    min-height: 92px;
    margin-top: 14px;
    padding: 14px;
    border: 1px dashed #c7d2fe;
    border-radius: 12px;
    background: #f8faff;
  }

  .auto-field-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
  }

  .auto-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
  }

  @media (max-width: 760px) {
    .template-grid, .two-col {
      grid-template-columns: 1fr 1fr;
    }
  }

  @media (max-width: 480px) {
    .template-grid, .two-col {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 900px) {
    .dashboard-head { align-items: flex-start; flex-direction: column; }
    .report-grid { grid-template-columns: 1fr 1fr; }
    .report-grid .report-card:first-child { grid-column: 1 / -1; }
  }

  @media (max-width: 600px) {
    .dashboard-hero { min-height: 170px; }
    .hero-orb { display: none; }
    .report-stats { margin-top: -24px; }
    .report-grid { grid-template-columns: 1fr; }
    .report-grid .report-card:first-child { grid-column: auto; }
  }

  @media (max-width: 760px) {
    .top {
        height: 64px;
      min-height: 64px;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
        padding-top: 0;
        padding-bottom: 0;
      }

      .mobile-menu-toggle {
        display: block;
      }

      .top nav {
        display: none;
        position: absolute;
        top: 64px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 78px);
        overflow-y: auto;
        padding: 8px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 16px;
        background: rgba(15,23,42,.98);
        box-shadow: 0 18px 40px rgba(15,23,42,.3);
      }

      .top nav.mobile-menu-open {
        display: grid;
        gap: 3px;
      }

      .top nav a {
        display: block;
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 14px;
      }

      @media (max-width: 760px) {
      .auth-layout {
        display: block;
        min-height: auto;
        border-radius: 20px;
      }
      .auth-visual {
        min-height: 220px;
        padding: 26px;
      }
      .auth-visual h2 {
        font-size: 30px;
        margin: 12px 0 8px;
      }
      .auth-visual p {
        margin: 0;
        font-size: 13px;
      }
      .auth-trust {
        display: none;
      }
      .auth-main {
        padding: 30px 22px;
      }
    }
    .page-head h1 {
      font-size: 24px;
    }
  }

@media (max-width: 480px) {
  
  .hero {
    padding: 16px;
    border-radius: 12px;
  }
  
  .hero h1 {
    font-size: 20px;
  }
  
  .card {
    padding: 16px;
    border-radius: 14px;
  }
  
  .stats > div {
    padding: 16px;
  }
  
  .stats b {
    font-size: 24px;
  }
  
  .top {
    height: 56px;
    padding: 0 12px;
  }

  .top nav {
    top: 56px;
  }
  
  .public-card {
    padding: 16px;
    border-radius: 12px;
  }
  
  .form-grid {
    gap: 12px;
  }
}

/* ===== UTILITIES ===== */
pre {
  background: #f3f4f6;
  padding: 14px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
}

code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
  .btn,
  .card,
  .badge,
  a,
  input,
  textarea,
  select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}
/* Workspace navigation is a persistent vertical sidebar on admin pages. */
@media (min-width: 901px) {
  body:not(.public-no-nav) {
    padding-left: 248px;
  }

  body:not(.public-no-nav) .top {
    width: 248px;
    height: 100vh;
    box-sizing: border-box;
    padding: 28px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    display: block;
    overflow-y: auto;
  }

  body:not(.public-no-nav) .top b {
    display: block;
    padding: 0 12px 28px;
  }

  body:not(.public-no-nav) .top nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
  }

  body:not(.public-no-nav) .top nav a {
    display: block;
    padding: 11px 12px;
    border-radius: 10px;
  }

  body:not(.public-no-nav) .top nav a:hover {
    background: rgba(255, 255, 255, .1);
  }

  body:not(.public-no-nav) .mobile-menu-toggle {
    display: none;
  }
}

@media (max-width: 900px) {
  body:not(.public-no-nav) {
    padding-left: 0;
  }
}

/* Final admin responsive overrides */
body:not(.public-no-nav) main {
  width: 100%;
  min-width: 0;
}

.support-message-alert {
  position: fixed;
  right: 24px;
  top: 24px;
  bottom: auto;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(430px, calc(100vw - 32px));
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #312e81);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15,23,42,.3);
  animation: supportAlertIn .25s ease-out;
}

#support-notification-stack {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 2147483647;
  display: flex;
  width: min(430px, calc(100vw - 32px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

#support-live-widget {
  all: initial !important;
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  z-index: 2147483645 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  color: #0f172a !important;
  font-family: Arial, sans-serif !important;
}

body.admin-shell #support-live-widget {
  all: initial !important;
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  z-index: 2147483647 !important;
  display: block !important;
  visibility: visible !important;
  font-family: Arial, sans-serif !important;
}

body.admin-shell #support-live-widget > .support-live-bubble {
  all: initial !important;
  display: grid !important;
  place-items: center !important;
  position: relative !important;
  width: 58px !important;
  height: 58px !important;
  padding: 0 !important;
  color: #fff !important;
  background: #1769df !important;
  border: 0 !important;
  border-radius: 50% !important;
  box-shadow: 0 12px 28px rgba(23,105,223,.4) !important;
  cursor: pointer !important;
  font: 25px/1 Arial, sans-serif !important;
}

body.admin-shell #support-live-widget > .support-live-panel {
  position: absolute !important;
  right: 0 !important;
  bottom: 70px !important;
  width: 360px !important;
  max-width: calc(100vw - 28px) !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 22px 55px rgba(15,23,42,.25) !important;
}

body.admin-shell #support-live-widget > .support-live-panel[hidden] {
  display: none !important;
}

body.admin-shell #support-live-widget .support-live-panel > header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 !important;
  padding: 18px !important;
  color: #fff !important;
  background: linear-gradient(135deg,#1677f0,#1769df) !important;
}

body.admin-shell #support-live-widget .support-live-panel .support-live-list {
  display: block !important;
  width: 100% !important;
  max-height: 360px !important;
  overflow-y: auto !important;
}

body.admin-shell #support-live-widget .support-live-panel .support-live-item {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 14px 16px !important;
  color: #1e293b !important;
  background: #fff !important;
  border-bottom: 1px solid #edf2f7 !important;
  text-decoration: none !important;
}

.support-live-bubble {
  position: relative;
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(135deg,#1677f0,#1769df);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 14px 30px rgba(37,99,235,.35);
  cursor: pointer;
  font-size: 24px !important;
  line-height: 1 !important;
}

.support-live-bubble b {
  position: absolute;
  top: -5px;
  right: -3px;
  min-width: 21px;
  padding: 3px 6px;
  color: #fff;
  background: #ef1d2f;
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 11px;
}

.support-live-panel {
  position: absolute !important;
  right: 0 !important;
  bottom: 70px !important;
  width: 360px !important;
  max-width: calc(100vw - 28px) !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid #e2e8f0;
  border-radius: 16px !important;
  box-shadow: 0 22px 55px rgba(15,23,42,.25);
}

.support-live-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px !important;
  margin: 0 !important;
  color: #fff;
  background: linear-gradient(135deg,#1578f2,#1466dc);
}

.support-live-panel header strong,
.support-live-panel header small {
  display: block;
}

.support-live-panel header small {
  margin-top: 3px;
  color: #dbeafe;
  font-size: 12px;
}

.support-live-panel header button {
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 24px;
}

.support-live-list {
  display: block !important;
  width: 100% !important;
  max-height: 360px;
  overflow-y: auto;
}

.support-live-item {
  display: flex !important;
  align-items: center;
  gap: 11px;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 14px 16px !important;
  color: #1e293b;
  border-bottom: 1px solid #edf2f7;
  text-decoration: none;
}

.support-live-item:hover {
  background: #f8fbff;
}

.support-live-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #166534;
  background: #bbf7d0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.support-live-item > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.support-live-item b,
.support-live-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-live-item b {
  font-size: 14px;
}

.support-live-item small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.support-live-item i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  background: #ef1d2f;
  border-radius: 50%;
}

.support-live-empty {
  padding: 20px;
  color: #64748b;
  text-align: center;
  font-size: 13px;
}

.support-live-all {
  display: block;
  padding: 14px;
  color: #1769df;
  background: #f8fbff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

#support-notification-stack .support-message-alert {
  position: relative;
  inset: auto;
  width: 100%;
  pointer-events: auto;
}

.support-message-alert-icon {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #312e81;
  background: #fbbf24;
  border-radius: 50%;
  font-weight: 800;
}

.support-message-alert-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.support-message-alert-copy strong {
  font-size: 13px;
}

.support-message-alert-copy span {
  overflow: hidden;
  color: #dbeafe;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-message-alert-link {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #fff;
  background: rgba(255,255,255,.14);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.support-message-alert-close {
  flex: 0 0 auto;
  padding: 0 2px;
  color: #cbd5e1;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

#admin-support-widget {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 2147483646;
  width: min(560px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 108px));
  overflow: hidden;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15,23,42,.32);
}

.admin-support-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
  color: #fff;
  background: #111827;
}

.admin-support-widget-head button {
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 24px;
}

#admin-support-widget .admin-support-widget-status {
  margin: 18px;
  padding: 16px;
  color: #3730a3;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  font-weight: 700;
}

#admin-support-widget .admin-support-widget-messages {
  height: calc(100% - 178px);
  padding: 4px 18px 14px;
  overflow-y: auto;
}

.admin-support-widget-message {
  max-width: 86%;
  margin: 10px 0;
  padding: 11px 13px;
  color: #1f2937;
  background: #f3f0ff;
  border: 1px solid #ddd6fe;
  border-radius: 14px;
}

.admin-support-widget-message.user {
  margin-left: auto;
  color: #1e293b;
  background: #eef2ff;
  border-color: #dbeafe;
}

.admin-support-widget-message b {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 12px;
}

.admin-support-widget-message p {
  margin: 0;
  line-height: 1.45;
}

#admin-support-widget form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
}

#admin-support-widget form input {
  min-width: 0;
  flex: 1;
  padding: 13px;
  border: 2px solid #6366f1;
  border-radius: 12px;
  font-size: 15px;
}

#admin-support-widget form button {
  width: 52px;
  color: #fff;
  background: #635bff;
  border: 0;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
}

.support-chat-clear {
  margin-right: 6px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
}

#support-chat-widget .support-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 78px;
  height: 34px;
  padding: 0 12px;
  color: #fff;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
  cursor: pointer;
  font: 700 12px/1 Arial, sans-serif;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

#support-chat-widget .support-clear span:first-child {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #fff;
  font-size: 15px;
  line-height: 1;
}

#support-chat-widget .support-clear:hover {
  background: rgba(255,255,255,.24);
  border-color: rgba(255,255,255,.45);
  transform: translateY(-1px);
}

#support-chat-widget .support-clear:active {
  transform: translateY(0);
}

#support-chat-widget .support-clear:disabled {
  cursor: wait;
  opacity: .65;
}

@keyframes supportAlertIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  #support-notification-stack {
    right: 12px;
    top: 12px;
    width: calc(100vw - 24px);
  }
  #support-live-widget {
    right: 14px;
    bottom: 14px;
  }
  .support-live-panel {
    right: -2px;
    width: min(360px, calc(100vw - 28px));
  }
}

/* Keep the live notification widget independent from dashboard component styles. */
body.admin-shell #support-live-widget {
  position: fixed !important;
  inset: auto 24px 24px auto !important;
  display: block !important;
  width: 58px !important;
  height: 58px !important;
  min-width: 58px !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.admin-shell #support-live-widget .support-live-bubble {
  box-sizing: border-box !important;
  display: grid !important;
  place-items: center !important;
  width: 58px !important;
  height: 58px !important;
  min-width: 58px !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

body.admin-shell #support-live-widget .support-live-bubble b {
  display: block !important;
  box-sizing: border-box !important;
  width: auto !important;
  height: auto !important;
  min-width: 22px !important;
  min-height: 20px !important;
  margin: 0 !important;
  line-height: 15px !important;
}

body.admin-shell #support-live-widget .support-live-panel {
  box-sizing: border-box !important;
  position: absolute !important;
  inset: auto 0 70px auto !important;
  display: block !important;
  width: 360px !important;
  min-width: 360px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.35 !important;
}

body.admin-shell #support-live-widget .support-live-panel[hidden] {
  display: none !important;
}

body.admin-shell #support-live-widget .support-live-panel > header {
  box-sizing: border-box !important;
  display: flex !important;
  width: 100% !important;
  height: 68px !important;
  min-height: 68px !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  gap: 12px !important;
  line-height: 1.2 !important;
}

body.admin-shell #support-live-widget .support-live-panel > header > div {
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.admin-shell #support-live-widget .support-live-panel > header strong,
body.admin-shell #support-live-widget .support-live-panel > header small {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

body.admin-shell #support-live-widget .support-live-panel > header strong {
  color: #fff !important;
  font-size: 17px !important;
  font-weight: 800 !important;
}

body.admin-shell #support-live-widget .support-live-panel > header small {
  margin-top: 4px !important;
  color: #dbeafe !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

body.admin-shell #support-live-widget .support-live-panel > header button {
  display: grid !important;
  place-items: center !important;
  width: 28px !important;
  height: 28px !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  color: #fff !important;
  background: transparent !important;
  border: 0 !important;
  font: 24px/1 Arial, sans-serif !important;
}

body.admin-shell #support-live-widget .support-live-list {
  display: block !important;
  width: 100% !important;
  max-height: 360px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-y: auto !important;
}

body.admin-shell #support-live-widget .support-live-item {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  width: 100% !important;
  min-height: 68px !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  line-height: 1.25 !important;
}

body.admin-shell #support-live-widget .support-live-item > span {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.admin-shell #support-live-widget .support-live-item .support-live-avatar {
  display: grid !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 !important;
  place-items: center !important;
}

body.admin-shell #support-live-widget .support-live-item > span:nth-child(2) {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

body.admin-shell #support-live-widget .support-live-item b,
body.admin-shell #support-live-widget .support-live-item small {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.admin-shell #support-live-widget .support-live-item small {
  margin-top: 4px !important;
}

body.admin-shell #support-live-widget .support-live-item > i {
  display: block !important;
  width: 9px !important;
  height: 9px !important;
  min-width: 9px !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.admin-shell #support-live-widget .support-live-all {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

@media (max-width: 640px) {
  body.admin-shell #support-live-widget {
    right: 14px !important;
    bottom: 14px !important;
  }

  body.admin-shell #support-live-widget .support-live-panel {
    width: min(360px, calc(100vw - 28px)) !important;
    min-width: min(360px, calc(100vw - 28px)) !important;
  }
}

/* Fallback scope for layouts that provide the widget without admin-shell. */
#support-live-widget {
  position: fixed !important;
  inset: auto 24px 24px auto !important;
  display: block !important;
  width: 58px !important;
  height: 58px !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 2147483647 !important;
}

#support-live-widget > .support-live-bubble {
  box-sizing: border-box !important;
  display: grid !important;
  place-items: center !important;
  width: 58px !important;
  height: 58px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

#support-live-widget > .support-live-panel {
  box-sizing: border-box !important;
  position: absolute !important;
  inset: auto 0 70px auto !important;
  display: block !important;
  width: 360px !important;
  min-width: 360px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  line-height: 1.35 !important;
}

#support-live-widget > .support-live-panel[hidden] {
  display: none !important;
}

#support-live-widget > .support-live-panel > header {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 68px !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  line-height: 1.2 !important;
}

#support-live-widget > .support-live-panel > header strong,
#support-live-widget > .support-live-panel > header small {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

#support-live-widget > .support-live-panel .support-live-list {
  display: block !important;
  width: 100% !important;
  max-height: 360px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-y: auto !important;
}

#support-live-widget > .support-live-panel .support-live-item {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  width: 100% !important;
  min-height: 68px !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  line-height: 1.25 !important;
}

#support-live-widget > .support-live-panel .support-live-item > span {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

#support-live-widget > .support-live-panel .support-live-item > span:nth-child(2) {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

#support-live-widget > .support-live-panel .support-live-item b,
#support-live-widget > .support-live-panel .support-live-item small {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#support-live-widget > .support-live-panel .support-live-all {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  text-align: center !important;
}

@media (max-width: 640px) {
  #support-live-widget {
    right: 14px !important;
    bottom: 14px !important;
  }

  #support-live-widget > .support-live-panel {
    width: calc(100vw - 28px) !important;
    min-width: 0 !important;
  }
}

/* Mobile navigation must stay closed until the menu button is pressed. */
@media (max-width: 900px) {
  body.admin-shell > .top {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    box-sizing: border-box !important;
    padding: 0 14px !important;
    overflow: visible !important;
  }

  body.admin-shell > .top nav,
  body.admin-shell > .top nav:not(.mobile-menu-open) {
    display: none !important;
  }

  body.admin-shell > .top nav.mobile-menu-open {
    position: absolute !important;
    top: 68px !important;
    right: 8px !important;
    left: auto !important;
    display: grid !important;
    width: min(360px, calc(100vw - 16px)) !important;
    max-height: calc(100dvh - 84px) !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    padding: 8px !important;
    border-radius: 14px !important;
  }

  body.admin-shell > .top nav.mobile-menu-open a {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 11px 12px !important;
  }
}

body:not(.public-no-nav) img,
body:not(.public-no-nav) iframe,
body:not(.public-no-nav) video {
  max-width: 100%;
}

body:not(.public-no-nav) .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body:not(.public-no-nav) table {
  min-width: 640px;
}

body:not(.public-no-nav) .table-wrap table {
  margin: 0;
}

body:not(.public-no-nav) .page-head,
body:not(.public-no-nav) .dashboard-head,
body:not(.public-no-nav) .report-card-head {
  min-width: 0;
  gap: 16px;
}

body:not(.public-no-nav) .page-head > *,
body:not(.public-no-nav) .dashboard-head > * {
  min-width: 0;
}

body:not(.public-no-nav) .actions {
  max-width: 100%;
  flex-wrap: wrap;
}

body:not(.public-no-nav) .actions .btn {
  white-space: normal;
}

body:not(.public-no-nav) .input,
body:not(.public-no-nav) input,
body:not(.public-no-nav) textarea,
body:not(.public-no-nav) select {
  max-width: 100%;
}

/* Keep dashboard report widgets horizontal on desktop layouts. */
.admin-shell > main .report-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: stretch;
  width: 100%;
}

.admin-shell > main .report-card {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.admin-shell > main .mini-chart {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  justify-content: space-around !important;
  width: 100%;
  box-sizing: border-box;
}

.admin-shell > main .chart-col {
  display: flex !important;
  flex: 1 1 0 !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-width: 0;
}

@media (max-width: 900px) {
  body:not(.public-no-nav) main {
    padding: 22px 18px;
  }

  .admin-shell > main .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .admin-shell > main .report-grid .report-card:first-child {
    grid-column: 1 / -1;
  }

  body:not(.public-no-nav) .top {
    position: sticky;
    inset: auto;
    width: 100%;
    height: 64px;
    padding: 0 18px;
    display: flex;
    overflow: visible;
  }

  body:not(.public-no-nav) .top b {
    padding: 0;
  }

  body:not(.public-no-nav) .mobile-menu-toggle {
    display: block;
  }

  body:not(.public-no-nav) .top nav {
    display: none;
  }

  body:not(.public-no-nav) .top nav.mobile-menu-open {
    display: grid;
  }
}

@media (max-width: 640px) {
  body:not(.public-no-nav) main {
    padding: 16px 12px;
  }

  .admin-shell > main .report-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-shell > main .report-grid .report-card:first-child {
    grid-column: auto;
  }

  body:not(.public-no-nav) .top {
    height: 58px;
    padding: 0 12px;
  }

  body:not(.public-no-nav) .top nav {
    top: 58px;
    left: 8px;
    right: 8px;
  }

  body:not(.public-no-nav) .page-head,
  body:not(.public-no-nav) .dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }

  body:not(.public-no-nav) .page-head h1,
  body:not(.public-no-nav) .dashboard-head h1 {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  body:not(.public-no-nav) .page-head .actions,
  body:not(.public-no-nav) .dashboard-head .actions,
  body:not(.public-no-nav) .actions {
    width: 100%;
  }

  body:not(.public-no-nav) .actions .btn {
    flex: 1 1 150px;
    text-align: center;
  }

  body:not(.public-no-nav) .card {
    padding: 16px;
    border-radius: 14px;
  }

  body:not(.public-no-nav) .two-col,
  body:not(.public-no-nav) .grid,
  body:not(.public-no-nav) .template-grid {
    grid-template-columns: 1fr;
  }

  body:not(.public-no-nav) .hero {
    padding: 22px 18px;
  }

  body:not(.public-no-nav) .hero h1,
  body:not(.public-no-nav) .hero h2 {
    font-size: 24px;
  }

  body:not(.public-no-nav) .table-wrap {
    margin-left: -4px;
    width: calc(100% + 8px);
  }

  body:not(.public-no-nav) .table-wrap table {
    min-width: 700px;
  }

  body:not(.public-no-nav) .table-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  body:not(.public-no-nav) .table-pagination .actions {
    width: 100%;
  }
}

@media (max-width: 380px) {
  body:not(.public-no-nav) main {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* Final admin dashboard visual system. */
.admin-shell > main:has(> .dashboard-head) {
  max-width: 1480px;
  margin: 0 auto;
  padding: 34px clamp(20px, 3vw, 48px) 56px !important;
}

.admin-shell > main > .dashboard-head {
  align-items: center;
  margin-bottom: 26px;
}

.admin-shell > main > .dashboard-head h1 {
  margin: 6px 0 8px;
  color: #172033;
  font-size: clamp(30px, 3.2vw, 44px);
  letter-spacing: -.055em;
}

.admin-shell > main > .dashboard-head .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-shell > main > .dashboard-hero {
  min-height: 178px;
  padding: 34px 38px;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 20%, rgba(129,140,248,.42), transparent 26%),
    linear-gradient(120deg, #312e81, #4f46e5 58%, #2563eb);
  box-shadow: 0 20px 45px rgba(49,46,129,.2);
}

.admin-shell > main > .dashboard-hero h2 {
  color: #fff;
  letter-spacing: -.045em;
}

.admin-shell > main > .dashboard-hero p {
  max-width: 580px;
  color: #dbeafe;
}

.admin-shell > main > .dashboard-hero .hero-orb {
  flex: 0 0 auto;
  margin-right: 4%;
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
}

.admin-shell > main > .report-stats {
  margin-top: -32px;
  gap: 16px;
}

.admin-shell > main > .report-stats > .report-widget {
  min-height: 164px;
  padding: 20px;
  border: 1px solid rgba(226,232,240,.95);
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 12px 30px rgba(30,41,99,.09);
}

.admin-shell > main > .report-stats .report-widget b {
  margin-top: 14px;
  color: #312e81;
  font-size: clamp(2.2rem, 3vw, 3.4rem);
}

.admin-shell > main > .report-stats .report-widget span {
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: .08em;
}

.admin-shell > main > .report-grid {
  margin-top: 24px;
  gap: 16px;
}

.admin-shell > main > .report-grid > .report-card {
  min-height: 292px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(30,41,99,.06);
}

.admin-shell > main > .report-grid .report-card-head {
  margin-bottom: 18px;
}

.admin-shell > main > .report-grid .report-card-head h3 {
  font-size: 17px;
}

.admin-shell > main .dashboard-reports {
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) !important;
}

.admin-shell > main .dashboard-trend-chart {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-end !important;
  justify-content: space-around !important;
  min-height: 190px;
  width: 100%;
}

.admin-shell > main .dashboard-trend-chart .chart-col {
  display: flex !important;
  flex: 1 1 0 !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  height: 100% !important;
  min-width: 0;
}

@media (max-width: 900px) {
  .admin-shell > main .dashboard-reports {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .admin-shell > main .dashboard-reports > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .admin-shell > main .dashboard-reports {
    grid-template-columns: 1fr !important;
  }

  .admin-shell > main .dashboard-reports > :first-child {
    grid-column: auto;
  }
}

/* Dashboard final layout: keep report cards and chart columns usable after legacy overrides. */
@media (min-width: 901px) {
  .admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }

  .admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats + .report-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
  }
}

.admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats + .report-grid > .report-card {
  min-width: 0 !important;
  width: auto !important;
  overflow: hidden;
}

.admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats + .report-grid .mini-chart {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  justify-content: space-around !important;
  min-height: 190px;
}

.admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats + .report-grid .chart-col {
  display: flex !important;
  flex: 1 1 0 !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  height: 100% !important;
}

@media (max-width: 900px) {
  .admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats + .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats + .report-grid > .report-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats + .report-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-shell > main > .dashboard-head + .dashboard-hero + .report-stats + .report-grid > .report-card:first-child {
    grid-column: auto;
  }

  body:not(.public-no-nav) .top b {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.public-no-nav) .btn {
    width: 100%;
  }
}

/* Stable dashboard reports: grid prevents chart items from collapsing into a column. */
.admin-shell > main .dashboard-reports {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 18px !important;
  width: 100% !important;
  margin-inline: auto !important;
}

.admin-shell > main .dashboard-reports > .report-card {
  min-height: 280px !important;
  height: auto !important;
}

.admin-shell > main .dashboard-trend-chart {
  display: flex !important;
  flex-direction: row !important;
  align-items: end !important;
  gap: 8px !important;
  height: 190px !important;
  min-height: 0 !important;
  padding: 24px 4px 0 !important;
  overflow: visible !important;
}

.admin-shell > main .dashboard-trend-chart .chart-col {
  display: flex !important;
  flex: 1 1 0 !important;
  flex-direction: column !important;
  align-items: end !important;
  justify-content: flex-end !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  gap: 7px !important;
}

.admin-shell > main .dashboard-trend-chart .chart-bar {
  flex: 0 0 auto !important;
  width: min(30px, 70%) !important;
  min-height: 8px !important;
  border-radius: 8px 8px 3px 3px !important;
  background: linear-gradient(180deg, #818cf8, #4f46e5) !important;
}

@media (max-width: 900px) and (min-width: 601px) {
  .admin-shell > main .dashboard-reports {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .admin-shell > main .dashboard-reports > .report-card:first-child {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 600px) {
  .admin-shell > main .dashboard-reports {
    grid-template-columns: 1fr !important;
  }

  .admin-shell > main .dashboard-reports > .report-card:first-child {
    grid-column: auto !important;
  }
}

@media (max-width: 900px) {
  body:not(.public-no-nav) .builder {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  body:not(.public-no-nav) .builder .library,
  body:not(.public-no-nav) .builder .props {
    display: none;
  }

  body:not(.public-no-nav) .builder .canvas {
    width: 100%;
    min-width: 0;
  }

  body:not(.public-no-nav) .support-layout,
  body:not(.public-no-nav) .support-admin-layout {
    grid-template-columns: 1fr !important;
  }

  body:not(.public-no-nav) .support-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  body:not(.public-no-nav) .support-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.public-no-nav) #reportFilters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.public-no-nav):not(.public) .form-grid,
  body:not(.public-no-nav):not(.public) .form-layout,
  body.public .access-steps {
    grid-template-columns: 1fr !important;
  }

  body:not(.public-no-nav) .access-step-line {
    display: none;
  }
}

@media (max-width: 560px) {
  body:not(.public-no-nav) .support-stat-grid,
  body:not(.public-no-nav) #reportFilters,
  body:not(.public-no-nav) .report-insights {
    grid-template-columns: 1fr !important;
  }

  body:not(.public-no-nav) .support-section-head,
  body:not(.public-no-nav) .report-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  body:not(.public-no-nav) .support-filters,
  body:not(.public-no-nav) .ticket-assign-form {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  body:not(.public-no-nav) .support-filters .input,
  body:not(.public-no-nav) .ticket-assign-form .input,
  body:not(.public-no-nav) .ticket-assign-form .btn {
    width: 100%;
    min-width: 0;
  }

  body:not(.public-no-nav) .report-insights {
    gap: 10px;
  }

  body:not(.public-no-nav) .field[style*="--w"] {
    grid-column: 1 / -1 !important;
  }
}

/* Form builder responsive layout: keep all controls available on tablet and mobile. */
@media (max-width: 900px) {
  body:not(.public-no-nav) .builder {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 12px !important;
    padding: 12px !important;
  }

  body:not(.public-no-nav) .builder .library,
  body:not(.public-no-nav) .builder .props {
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
  }

  body:not(.public-no-nav) .builder .library {
    order: 1;
  }

  body:not(.public-no-nav) .builder .canvas {
    order: 2;
    width: 100% !important;
    min-width: 0 !important;
    padding: 12px 0 !important;
    overflow: visible !important;
  }

  body:not(.public-no-nav) .builder .props {
    order: 3;
  }

  body:not(.public-no-nav) .builder .library #library {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body:not(.public-no-nav) .builder .library .library-item {
    margin: 0;
    min-height: 38px;
  }

  body:not(.public-no-nav) .builder .drop-zone {
    grid-template-columns: 1fr !important;
  }

  body:not(.public-no-nav) .builder .builder-field {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 560px) {
  body:not(.public-no-nav) .builder-head {
    margin: 0;
  }

  body:not(.public-no-nav) .builder-head .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  body:not(.public-no-nav) .builder-head .actions .btn,
  body:not(.public-no-nav) .builder-head .actions a {
    width: 100%;
    text-align: center;
  }

  body:not(.public-no-nav) .builder .library #library {
    grid-template-columns: 1fr;
  }
}

/* Keep the workspace navigation usable at every viewport size. */
@media (min-width: 901px) {
  body.admin-shell {
    padding-left: 260px !important;
  }

  body.admin-shell > .top {
    width: 260px !important;
    height: 100dvh !important;
    box-sizing: border-box;
    padding: 22px 12px !important;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.admin-shell > .top b {
    padding: 0 12px 18px !important;
    font-size: 18px;
  }

  body.admin-shell > .top nav {
    gap: 2px;
  }

  body.admin-shell > .top nav a {
    padding: 10px 12px;
    line-height: 1.25;
  }
}

@media (max-width: 900px) {
  body.admin-shell {
    padding-left: 0 !important;
  }

  body.admin-shell > .top {
    position: sticky !important;
    inset: 0 0 auto;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px;
    padding: 0 14px !important;
    overflow: visible !important;
  }

  body.admin-shell > .top nav,
  body.admin-shell > .top nav.mobile-menu-open {
    position: absolute !important;
    top: calc(100% + 8px);
    right: 8px !important;
    left: auto !important;
    width: min(360px, calc(100vw - 16px));
    max-height: calc(100dvh - 76px);
    box-sizing: border-box;
    overflow-y: auto;
    padding: 8px;
    gap: 2px;
  }

  body.admin-shell > .top nav a {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.25;
  }

  body.admin-shell > .top nav a[href$="/logout"] {
    margin-top: 4px;
  }
}

/* Final support widget polish */
.support-chat-panel header {
  min-height: 72px;
  padding: 16px 18px;
}

.support-chat-panel header strong {
  font-size: 15px;
  letter-spacing: -.2px;
}

.support-chat-clear,
.support-chat-close {
  display: inline-grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.support-chat-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font: 700 12px/1 Arial,sans-serif;
  letter-spacing: .01em;
  gap: 7px;
  transition: background .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease;
}

.support-chat-clear:hover {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.58);
  box-shadow: 0 5px 14px rgba(15,23,42,.18);
  transform: translateY(-1px);
}

.support-chat-clear:active {
  transform: translateY(0);
  box-shadow: none;
}

.support-chat-clear:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.support-chat-clear-icon {
  all: unset;
  display: inline-flex;
  width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
  flex: 0 0 15px;
}

.support-chat-clear-icon svg {
  display: block;
  width: 15px;
  height: 15px;
  max-width: 15px;
  max-height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-chat-close {
  width: 34px;
  height: 34px;
  margin-left: 5px;
  background: transparent;
  color: #fff;
  font-size: 29px;
  line-height: 1;
}

.support-chat-panel header > div:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-chat-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.support-chat-body {
  padding: 14px;
}

.support-assigned-agent {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
}

.support-messages {
  gap: 10px;
  max-height: min(300px, 38dvh);
  padding: 4px 2px 12px;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
}

.support-message {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px;
}

.support-message.user {
  border-bottom-right-radius: 6px;
}

.support-message.admin,
.support-message.bot {
  border-bottom-left-radius: 6px;
}

.support-message p {
  font-size: 14px;
  line-height: 1.45;
}

.support-message-form {
  gap: 9px;
  padding-top: 12px;
}

.support-message-form .input {
  min-height: 48px;
  border-radius: 14px;
}

.support-message-form .btn {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
}

.attendance-completion-page {
  min-height: 100vh;
  background: #f5f7fc;
  color: #172033;
}

.attendance-completion {
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
  padding: 44px 0 56px;
}

.attendance-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.attendance-report-heading {
  min-width: 0;
}

.attendance-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  color: #56647b;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.attendance-eyebrow i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #929db0;
}

.attendance-report-heading h1 {
  margin: 0;
  color: #182238;
  font-size: clamp(25px, 3.2vw, 36px);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.attendance-report-heading h1 span {
  color: #58647a;
  font-weight: 600;
}

.attendance-report-heading p {
  margin: 10px 0 0;
  color: #68758a;
  font-size: 14px;
}

.attendance-back-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #dce3ef;
  border-radius: 12px;
  background: #fff;
  color: #344158;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.attendance-back-link:hover {
  transform: translateY(-1px);
  border-color: #aeb9d1;
  box-shadow: 0 6px 16px rgba(23, 32, 51, .07);
}

.attendance-month-filter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 24px;
}

.attendance-month-filter label {
  color: #48566d;
  font-size: 12px;
  font-weight: 750;
}

.attendance-month-filter > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attendance-month-filter input {
  width: 210px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #dce3ef;
  border-radius: 11px;
  background: #fff;
  color: #253149;
  font: inherit;
}

.attendance-month-filter input:focus {
  outline: 3px solid rgba(99, 91, 255, .15);
  border-color: #7067ff;
}

.attendance-month-filter .btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  font-weight: 750;
}

.attendance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}

.attendance-summary-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-items: center;
  column-gap: 13px;
  min-width: 0;
  padding: 20px;
  border: 1px solid #e1e6f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(26, 39, 66, .035);
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.attendance-summary-card:hover {
  transform: translateY(-2px);
  border-color: #b9b8ff;
  box-shadow: 0 12px 26px rgba(44, 50, 100, .08);
}

.attendance-summary-icon {
  display: grid;
  grid-row: 1 / 4;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 19px;
  font-weight: 800;
}

.attendance-summary-icon.people-icon {
  background: #eeefff;
  color: #5c55e8;
}

.attendance-summary-icon.uploaded-icon {
  background: #e8f8f0;
  color: #13845b;
}

.attendance-summary-icon.pending-icon {
  background: #fff4e5;
  color: #bd710b;
}

.attendance-summary-value {
  color: #1c2740;
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -.04em;
  line-height: 1.1;
}

.attendance-summary-label {
  margin-top: 5px;
  color: #35425a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.attendance-summary-note {
  margin-top: 4px;
  color: #7a8699;
  font-size: 11px;
  line-height: 1.4;
}

.attendance-results {
  overflow: hidden;
  border: 1px solid #e0e5ef;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(26, 39, 66, .045);
}

.attendance-results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #edf0f5;
}

.attendance-results-head h2 {
  margin: 0;
  color: #202b41;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.attendance-results-head p {
  margin: 5px 0 0;
  color: #758196;
  font-size: 12px;
}

.attendance-filter-tabs {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.attendance-filter-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #58657a;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.attendance-filter-tabs a span {
  color: #8993a4;
  font-variant-numeric: tabular-nums;
}

.attendance-filter-tabs a:hover {
  background: #f7f8fc;
  color: #4248b8;
}

.attendance-filter-tabs a.is-active {
  border-color: #d9d8ff;
  background: #f2f2ff;
  color: #4c46ca;
}

.attendance-filter-tabs a.is-active span {
  color: #615be0;
}

.attendance-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.attendance-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  color: #344158;
  font-size: 13px;
}

.attendance-table th,
.attendance-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #eef1f6;
  text-align: left;
  vertical-align: middle;
}

.attendance-table thead th {
  background: #f8f9fc;
  color: #68758a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .065em;
  text-transform: uppercase;
  white-space: nowrap;
}

.attendance-table tbody tr:last-child td {
  border-bottom: 0;
}

.attendance-table tbody tr:hover {
  background: #fafbff;
}

.attendance-table .attendance-row-number {
  width: 56px;
  color: #8a95a7;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.attendance-table .attendance-person-name {
  min-width: 190px;
  color: #202b41;
}

.attendance-table .attendance-person-name b {
  font-weight: 720;
}

.attendance-table .attendance-id,
.attendance-table .attendance-mobile {
  color: #56647a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.attendance-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.attendance-status.is-uploaded {
  background: #e8f8f0;
  color: #13784f;
}

.attendance-status.is-pending {
  background: #fff4e5;
  color: #a45e05;
}

.attendance-table .attendance-file {
  max-width: 230px;
  overflow: hidden;
  color: #69768a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-table .attendance-empty {
  padding: 42px 20px;
  color: #758196;
  text-align: center;
}

.attendance-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 22px;
  border-top: 1px solid #edf0f5;
  color: #758196;
  font-size: 12px;
}

.attendance-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attendance-pagination a {
  padding: 8px 11px;
  border: 1px solid #e0e5ef;
  border-radius: 9px;
  background: #fff;
  color: #46536a;
  font-weight: 700;
  text-decoration: none;
}

.attendance-pagination a:hover {
  border-color: #b9b8ff;
  color: #4c46ca;
}

.attendance-page-number {
  white-space: nowrap;
}

.attendance-report-footnote {
  margin: 13px 2px 0;
  color: #8792a4;
  font-size: 11px;
}

@media (max-width: 640px) {
  .support-chat-panel {
    max-height: min(640px, calc(100dvh - 24px));
  }

  .support-chat-body {
    padding: 12px;
  }

  .support-messages {
    max-height: min(280px, 36dvh);
  }

  .support-message-form {
    align-items: center;
    flex-direction: row;
  }

  .support-message-form .btn {
    width: 48px;
  }
}

@media (max-width: 760px) {
  .attendance-completion {
    width: min(100% - 32px, 620px);
    padding: 28px 0 38px;
  }

  .attendance-report-head {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
  }

  .attendance-back-link {
    align-self: flex-start;
  }

  .attendance-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .attendance-summary-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 3px 12px;
    padding: 15px;
  }

  .attendance-summary-icon {
    grid-row: 1 / 3;
    width: 40px;
    height: 40px;
  }

  .attendance-summary-value {
    grid-column: 2;
    grid-row: 1;
    font-size: 24px;
  }

  .attendance-summary-label {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0;
  }

  .attendance-summary-note {
    grid-column: 3;
    grid-row: 1 / 3;
    max-width: 120px;
    margin: 0;
    text-align: right;
  }

  .attendance-results-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 16px 14px;
  }

  .attendance-filter-tabs {
    width: 100%;
  }

  .attendance-filter-tabs a {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 8px;
  }

  .attendance-pagination {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }
}

@media (max-width: 420px) {
  .attendance-completion {
    width: calc(100% - 24px);
  }

  .attendance-month-filter,
  .attendance-month-filter > div {
    width: 100%;
  }

  .attendance-month-filter > div {
    align-items: stretch;
    flex-direction: column;
  }

  .attendance-month-filter input,
  .attendance-month-filter .btn {
    width: 100%;
  }

  .attendance-summary-note {
    max-width: 95px;
    font-size: 10px;
  }
}
