:root {
  --ink: #20345f;
  --muted: #6f7d99;
  --panel: rgba(255, 255, 255, .72);
  --panel-solid: #ffffff;
  --stroke: rgba(36, 107, 254, .12);
  --nav: rgba(255, 255, 255, .74);
  --blue: #246bfe;
  --blue-soft: #eaf2ff;
  --violet: #7d35ff;
  --violet-soft: #f3ecff;
  --cyan: #12c7d8;
  --lime: #b9f05d;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

body.auth-mode {
  background: #fff;
}

body.app-mode {
  background:
    radial-gradient(circle at 12% 8%, rgba(36, 107, 254, .16), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(125, 53, 255, .12), transparent 24%),
    radial-gradient(circle at 72% 86%, rgba(18, 199, 216, .10), transparent 25%),
    linear-gradient(135deg, #ffffff 0%, #f7fbff 48%, #f9f6ff 100%);
}

body::before {
  animation: scanGlow 10s ease-in-out infinite alternate;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(36, 107, 254, .08) 45%, transparent 54% 100%),
    repeating-linear-gradient(90deg, rgba(36, 107, 254, .035) 0 1px, transparent 1px 84px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -2;
}

a {
  text-decoration: none;
}

.language-switcher {
  align-items: center;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(36, 107, 254, .10);
  display: flex;
  gap: 3px;
  left: 20px;
  padding: 3px;
  position: fixed;
  top: 18px;
  z-index: 30;
}

.language-switcher a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #426197;
  display: inline-flex;
  gap: 4px;
  min-height: 29px;
  padding: 4px 7px;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.language-switcher a:hover,
.language-switcher a.is-active {
  background: linear-gradient(135deg, rgba(36, 107, 254, .14), rgba(125, 53, 255, .12));
  border-color: rgba(36, 107, 254, .18);
  color: var(--blue);
  transform: translateY(-1px);
}

.language-switcher img {
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(32, 52, 95, .14);
  display: block;
  height: 15px;
  object-fit: cover;
  width: 23px;
}

.language-switcher strong {
  font-size: .66rem;
  font-weight: 950;
  letter-spacing: .04em;
}

.motion-field {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.motion-line {
  animation: lineTravel 13s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(36, 107, 254, .22), rgba(125, 53, 255, .16), transparent);
  height: 2px;
  left: -30%;
  position: absolute;
  width: 60%;
}

.line-a {
  top: 18%;
}

.line-b {
  animation-delay: -4s;
  top: 54%;
}

.line-c {
  animation-delay: -8s;
  top: 82%;
}

.app-frame {
  display: grid;
  gap: 22px;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  padding: 22px;
}

.side-nav {
  animation: navReveal .45s ease both;
  background: var(--nav);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(36, 107, 254, .12);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 44px);
  overflow: hidden;
  padding: 18px;
  position: sticky;
  top: 22px;
}

.side-nav::before {
  background:
    radial-gradient(circle at 18% 12%, rgba(36, 107, 254, .14), transparent 32%),
    radial-gradient(circle at 86% 92%, rgba(125, 53, 255, .10), transparent 30%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.side-nav::after {
  animation: sideSweep 7s ease-in-out infinite;
  background: linear-gradient(180deg, transparent, rgba(36, 107, 254, .12), transparent);
  content: "";
  height: 40%;
  left: 0;
  position: absolute;
  right: 0;
  top: -45%;
}

.side-brand {
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(36, 107, 254, .1);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(36, 107, 254, .08);
  display: block;
  padding: 14px;
  position: relative;
  z-index: 1;
}

.side-brand img {
  display: block;
  height: 76px;
  object-fit: contain;
  width: 100%;
}

.side-menu {
  display: grid;
  gap: 10px;
  margin-top: 26px;
  position: relative;
  z-index: 1;
}

.side-menu a,
.side-logout button {
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(36, 107, 254, .10);
  border-radius: 8px;
  color: #2d4f8f;
  display: block;
  font-weight: 800;
  padding: 13px 14px 13px 18px;
  position: relative;
  text-align: left;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
  width: 100%;
}

.side-menu a::before,
.side-logout button::before {
  background: linear-gradient(180deg, var(--blue), var(--violet));
  border-radius: 999px;
  content: "";
  inset: 11px auto 11px 8px;
  opacity: 0;
  position: absolute;
  transition: opacity .18s ease;
  width: 3px;
}

.side-menu a:hover,
.side-logout button:hover {
  background: linear-gradient(135deg, rgba(36, 107, 254, .11), rgba(125, 53, 255, .09));
  border-color: rgba(36, 107, 254, .24);
  color: var(--blue);
  transform: translateX(4px);
}

.side-menu a:hover::before,
.side-logout button:hover::before {
  opacity: 1;
}

.side-logout {
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.content-stage {
  animation: stageReveal .55s ease both;
  min-width: 0;
  padding: 6px 4px 28px;
}

.user-strip {
  align-items: center;
  background: rgba(255, 255, 255, .68);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(36, 107, 254, .12);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(36, 107, 254, .08);
  color: #426197;
  display: flex;
  font-weight: 900;
  justify-content: flex-end;
  margin-bottom: 18px;
  min-height: 48px;
  padding: 10px 16px;
}

.page-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.eyebrow {
  color: var(--blue);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 2.6vw, 2.9rem);
  font-weight: 950;
}

h2 {
  font-size: 1.16rem;
  font-weight: 920;
}

h3 {
  font-size: 1rem;
  font-weight: 900;
}

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

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.metric-card,
.approval-card {
  animation: cardIn .52s ease both;
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 0 22px 52px rgba(36, 107, 254, .09);
  padding: 20px;
}

.panel:hover,
.metric-card:hover,
.approval-card:hover {
  box-shadow: 0 28px 70px rgba(36, 107, 254, .14);
  transform: translateY(-2px);
  transition: transform .18s ease, box-shadow .18s ease;
}

.metric-card {
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(244, 249, 255, .74)),
    radial-gradient(circle at 100% 0%, rgba(36, 107, 254, .11), transparent 42%);
}

.metric-card::before {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.metric-card::after {
  animation: metricPulse 3.8s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(36, 107, 254, .12), transparent);
  content: "";
  inset: 0;
  position: absolute;
}

.metric-card strong {
  color: #214fc3;
  display: block;
  font-size: 2rem;
  font-weight: 950;
  position: relative;
}

.metric-card span {
  color: var(--muted);
  font-size: .88rem;
  position: relative;
}

.section {
  margin-top: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.brand-logo-uploader {
  align-items: center;
  background: linear-gradient(135deg, rgba(36, 107, 254, .08), rgba(125, 53, 255, .06));
  border: 1px solid rgba(36, 107, 254, .12);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: 118px minmax(0, 1fr);
  padding: 14px;
}

.brand-logo-preview {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid rgba(36, 107, 254, .13);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(36, 107, 254, .08);
  color: #82a0d7;
  display: flex;
  font-weight: 950;
  justify-content: center;
  overflow: hidden;
}

.brand-logo-preview img {
  display: block;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  width: 100%;
}

.plan-designer {
  display: grid;
  gap: 16px;
}

.plan-topline {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.schedule-picker,
.special-day-box,
.special-generate {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .82), rgba(244, 249, 255, .74)),
    radial-gradient(circle at 100% 0, rgba(36, 107, 254, .13), transparent 38%);
  border: 1px solid rgba(36, 107, 254, .12);
  border-radius: 8px;
  padding: 15px;
}

.schedule-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.schedule-tags {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.schedule-head strong {
  color: #23487f;
  display: block;
  font-weight: 950;
}

.schedule-head span {
  color: var(--muted);
  display: block;
  font-size: .84rem;
}

.day-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.day-chip {
  align-items: center;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  color: #426197;
  cursor: pointer;
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 74px;
  padding: 10px 6px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.day-chip input {
  display: none;
}

.day-chip span {
  font-weight: 950;
}

.day-chip i {
  align-items: center;
  background: rgba(36, 107, 254, .08);
  border-radius: 999px;
  color: transparent;
  display: flex;
  font-style: normal;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.day-chip.is-selected {
  background: linear-gradient(135deg, rgba(36, 107, 254, .13), rgba(125, 53, 255, .11));
  border-color: rgba(36, 107, 254, .34);
  box-shadow: 0 16px 34px rgba(36, 107, 254, .12);
  color: #1f62d8;
  transform: translateY(-2px);
}

.day-chip.is-selected i {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff;
}

.toggle-line {
  align-items: center;
  background: rgba(234, 242, 255, .88);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 999px;
  color: #275ec5;
  display: inline-flex;
  font-weight: 900;
  gap: 8px;
  padding: 7px 12px;
}

.special-day-entry {
  display: grid;
  gap: 10px;
  grid-template-columns: 145px minmax(0, 1fr) auto;
}

.special-time-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px);
  margin-top: 12px;
}

.special-day-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  min-height: 32px;
}

.special-chip {
  align-items: center;
  background: linear-gradient(135deg, rgba(36, 107, 254, .10), rgba(125, 53, 255, .08));
  border: 1px solid rgba(36, 107, 254, .16);
  border-radius: 999px;
  color: #2d5fbf;
  display: inline-flex;
  font-weight: 850;
  gap: 8px;
  padding: 8px 12px;
}

.special-chip span {
  color: #7d35ff;
  font-weight: 950;
}

.frame-style-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.frame-mode-form {
  background: linear-gradient(135deg, rgba(255, 255, 255, .86), rgba(239, 247, 255, .72));
  border: 1px solid rgba(36, 107, 254, .16);
  border-radius: 8px;
  margin-top: 14px;
  padding: 12px;
}

.frame-mode-segment {
  background: rgba(255, 255, 255, .84);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.frame-mode-segment button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #5f7399;
  cursor: pointer;
  font-weight: 950;
  padding: 8px 14px;
  transition: .18s ease;
}

.frame-mode-segment button.is-active {
  background: linear-gradient(135deg, #2d75ff, #7d35ff);
  box-shadow: 0 10px 22px rgba(45, 117, 255, .20);
  color: #fff;
}

.frame-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.frame-card {
  background: rgba(255, 255, 255, .76);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(36, 107, 254, .08);
  overflow: hidden;
}

.frame-card.is-active {
  border-color: rgba(36, 107, 254, .46);
  box-shadow: 0 22px 54px rgba(36, 107, 254, .16);
}

.frame-card img {
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  width: 100%;
}

.frame-card-footer {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px;
}

.frame-card-footer strong {
  color: #23487f;
  display: block;
  font-size: .9rem;
  font-weight: 950;
}

.frame-card-footer span {
  color: var(--muted);
  display: block;
  font-size: .78rem;
  font-weight: 800;
}

.template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.template-meta span {
  background: rgba(36, 107, 254, .08);
  border: 1px solid rgba(36, 107, 254, .16);
  border-radius: 999px;
  color: #2d5fbf;
  font-size: .72rem;
  font-weight: 900;
  padding: 6px 9px;
}

.form-label {
  color: #36517f;
  font-size: .82rem;
  font-weight: 850;
}

.field-help {
  color: #7182a3;
  font-size: .78rem;
  line-height: 1.35;
  margin: 6px 0 0;
}

.form-control,
.form-select {
  background: rgba(255, 255, 255, .84);
  border-color: rgba(36, 107, 254, .16);
  border-radius: 8px;
  color: #243a66;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 .2rem rgba(36, 107, 254, .12);
}

.btn {
  border-radius: 8px;
  font-weight: 850;
}

.btn-primary {
  background: linear-gradient(135deg, #1f73ff, #4d8dff 52%, #7d35ff);
  border: 0;
  box-shadow: 0 16px 32px rgba(36, 107, 254, .22);
}

.btn-primary:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
}

.status-pill {
  background: rgba(234, 242, 255, .82);
  border: 1px solid rgba(36, 107, 254, .18);
  border-radius: 999px;
  color: #275ec5;
  display: inline-flex;
  font-size: .76rem;
  font-weight: 900;
  padding: 4px 10px;
}

.post-preview {
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(36, 107, 254, .12);
  border-radius: 8px;
  padding: 14px;
}

.image-preview {
  align-items: center;
  background: linear-gradient(135deg, rgba(36, 107, 254, .08), rgba(125, 53, 255, .08));
  border: 1px solid rgba(36, 107, 254, .16);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  padding: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.image-preview img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.prompt-note {
  background: rgba(234, 242, 255, .62);
  border: 1px solid rgba(36, 107, 254, .12);
  border-radius: 8px;
  color: #49648f;
  font-size: .82rem;
  margin: 12px 0;
  padding: 10px 12px;
}

.history-post {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 180px;
}

.history-post img {
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  flex: 0 0 54px;
  height: 54px;
  object-fit: cover;
  width: 54px;
}

.ai-loading {
  display: none;
  left: 50%;
  position: fixed;
  top: 12vh;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 24px));
  z-index: 5000;
}

.ai-loading.is-visible {
  display: block;
}

.ai-loading-card {
  animation: loadingDrop .28s ease both;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(36, 107, 254, .16);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(36, 107, 254, .18);
  color: #244878;
  display: grid;
  gap: 18px 30px;
  grid-template-columns: 220px 1fr;
  max-width: 980px;
  padding: 42px;
  text-align: left;
  width: 100%;
}

.ai-loading-card img {
  grid-row: 1 / 4;
  height: 190px;
  margin: auto;
  object-fit: contain;
  width: 210px;
}

.ai-loading-card strong {
  color: #246bfe;
  font-size: 2.55rem;
  font-weight: 950;
}

.ai-loading-card span {
  color: var(--muted);
  font-size: 1.24rem;
}

.ai-progress {
  background: rgba(36, 107, 254, .10);
  border-radius: 999px;
  height: 18px;
  margin-top: 14px;
  overflow: hidden;
  width: 100%;
}

.ai-progress i {
  animation: aiProgress 1.15s ease-in-out infinite;
  background: linear-gradient(90deg, #246bfe, #7d35ff);
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 42%;
}

.table {
  color: #2d416a;
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  background: transparent;
  border-bottom-color: rgba(36, 107, 254, .10);
  color: inherit;
}

.table thead th {
  color: #315fb4;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.admin-row-form {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(170px, 1.3fr) minmax(120px, .9fr) minmax(120px, .8fr) 90px 95px 80px 80px auto;
}

.admin-check {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  margin: 0;
  min-height: 38px;
}

.admin-row-stat {
  background: rgba(234, 242, 255, .72);
  border: 1px solid rgba(36, 107, 254, .12);
  border-radius: 8px;
  color: #426197;
  display: inline-flex;
  font-size: .82rem;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  padding: 9px 10px;
}

.admin-social-settings {
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(36, 107, 254, .12);
  border-radius: 8px;
  padding: 12px 14px;
}

.admin-social-settings summary {
  color: #275ec5;
  cursor: pointer;
  font-weight: 950;
}

.admin-social-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-social-token {
  grid-column: 1 / -1;
}

.admin-ai-settings {
  background: linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(231, 243, 255, .58));
}

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

.admin-prompt-form,
.admin-sector-form,
.sector-edit-form,
.prompt-template-edit {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-prompt-form .wide,
.prompt-template-edit .wide {
  grid-column: 1 / -1;
}

.sector-management-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sector-management-card {
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sector-edit-form {
  grid-template-columns: 1fr;
}

.prompt-template-list {
  display: grid;
  gap: 12px;
}

.prompt-library-shell {
  overflow: hidden;
}

.prompt-sector-tabs {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 18px;
}

.prompt-sector-tab {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(239, 247, 255, .74)),
    radial-gradient(circle at 100% 0, rgba(36, 107, 254, .10), transparent 42%);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  color: #2d4f8f;
  cursor: pointer;
  display: grid;
  gap: 10px;
  min-height: 92px;
  padding: 14px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.prompt-sector-tab span {
  font-size: .92rem;
  font-weight: 950;
}

.prompt-sector-tab strong {
  align-items: center;
  background: rgba(36, 107, 254, .10);
  border-radius: 999px;
  color: #246bfe;
  display: inline-flex;
  font-size: .82rem;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  width: 42px;
}

.prompt-sector-tab:hover,
.prompt-sector-tab.is-active {
  background:
    linear-gradient(135deg, rgba(36, 107, 254, .14), rgba(125, 53, 255, .10)),
    rgba(255, 255, 255, .92);
  border-color: rgba(36, 107, 254, .36);
  box-shadow: 0 18px 42px rgba(36, 107, 254, .13);
  transform: translateY(-2px);
}

.prompt-sector-tab.is-active strong {
  background: linear-gradient(135deg, #246bfe, #7d35ff);
  color: #fff;
}

.prompt-sector-panel {
  display: none;
}

.prompt-sector-panel.is-active {
  animation: cardIn .28s ease both;
  display: block;
}

.prompt-sector-head {
  align-items: flex-start;
  background: rgba(234, 242, 255, .54);
  border: 1px solid rgba(36, 107, 254, .12);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 13px 14px;
}

.prompt-template-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .84), rgba(236, 246, 255, .66)),
    radial-gradient(circle at 100% 0, rgba(36, 107, 254, .10), transparent 38%);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.institution-prompt-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.institution-prompt-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(240, 247, 255, .72)),
    radial-gradient(circle at 96% 12%, rgba(125, 53, 255, .10), transparent 36%);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(36, 107, 254, .08);
  display: grid;
  gap: 14px;
  min-height: 190px;
  padding: 15px;
}

.institution-prompt-card h3 {
  color: #23487f;
  margin-top: 10px;
}

.institution-prompt-card small {
  color: #315fb4;
  display: block;
  font-weight: 900;
  margin-top: 10px;
}

.template-option {
  align-items: flex-start;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(36, 107, 254, .14);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 11px 12px;
}

.template-option input {
  margin-top: 4px;
}

.template-option strong {
  color: #214d91;
  display: block;
  font-size: .86rem;
  line-height: 1.25;
}

.template-option small {
  color: #7082a4;
  display: block;
  font-size: .72rem;
  font-weight: 900;
  margin-top: 4px;
  text-transform: uppercase;
}

.login-shell {
  align-items: center;
  display: grid;
  gap: clamp(20px, 4vw, 64px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(18px, 4vw, 54px);
  position: relative;
}

.login-shell::before {
  animation: scanGlow 10s ease-in-out infinite alternate;
  background:
    linear-gradient(90deg, transparent, rgba(125, 53, 255, .055), transparent),
    repeating-linear-gradient(0deg, rgba(91, 99, 136, .035) 0 1px, transparent 1px 76px),
    repeating-linear-gradient(90deg, rgba(91, 99, 136, .03) 0 1px, transparent 1px 76px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.login-brand,
.login-form-panel {
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

.login-brand {
  animation: navReveal .55s ease both;
  background:
    radial-gradient(circle at 24% 20%, rgba(125, 53, 255, .09), transparent 34%),
    radial-gradient(circle at 78% 72%, rgba(36, 107, 254, .075), transparent 30%),
    #fff;
  border: 1px solid rgba(91, 99, 136, .08);
  box-shadow: 0 28px 80px rgba(30, 41, 80, .08);
  color: var(--ink);
  min-height: min(720px, calc(100vh - clamp(36px, 8vw, 108px)));
  overflow: hidden;
  padding: clamp(28px, 4.2vw, 58px);
}

.login-brand::before {
  animation: sideSweep 6.5s ease-in-out infinite;
  background: linear-gradient(180deg, transparent, rgba(125, 53, 255, .08), transparent);
  content: "";
  height: 45%;
  left: 0;
  position: absolute;
  right: 0;
  top: -50%;
}

.brand-content {
  align-content: center;
  display: grid;
  height: 100%;
  justify-items: center;
  min-height: inherit;
  position: relative;
  z-index: 1;
}

.brand-logo {
  align-items: center;
  animation: logoFloat 5s ease-in-out infinite;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 58px rgba(30, 41, 80, .08);
  display: block;
  height: auto;
  max-width: min(520px, 86%);
  object-fit: contain;
  padding: 24px;
}

.login-brand h1 {
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: .95;
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.login-brand p {
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  max-width: 560px;
}

.brand-orbit {
  border: 1px solid rgba(125, 53, 255, .12);
  border-radius: 999px;
  position: absolute;
}

.orbit-a {
  animation: orbitDrift 12s ease-in-out infinite;
  height: 320px;
  right: -120px;
  top: 16%;
  width: 320px;
}

.orbit-b {
  animation: orbitDrift 10s ease-in-out infinite reverse;
  bottom: -130px;
  height: 260px;
  left: 18%;
  width: 260px;
}

.login-form-panel {
  align-self: center;
  animation: loginLift .6s ease both;
  background: #fff;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(91, 99, 136, .1);
  box-shadow: 0 28px 80px rgba(30, 41, 80, .09);
  margin-left: 0;
  padding: clamp(28px, 4vw, 46px);
  width: 100%;
}

.login-form-head {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.login-form-head h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 950;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form .form-control {
  font-size: 1.02rem;
  min-height: 54px;
}

.login-submit {
  min-height: 54px;
}

@keyframes lineTravel {
  from {
    transform: translateX(0) rotate(-8deg);
  }
  to {
    transform: translateX(230vw) rotate(-8deg);
  }
}

@keyframes scanGlow {
  from {
    opacity: .52;
    transform: translateX(-3%);
  }
  to {
    opacity: .95;
    transform: translateX(3%);
  }
}

@keyframes sideSweep {
  0%,
  100% {
    top: -45%;
  }
  50% {
    top: 105%;
  }
}

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

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

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes metricPulse {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-30%);
  }
  50% {
    opacity: 1;
    transform: translateX(35%);
  }
}

@keyframes loginLift {
  from {
    opacity: 0;
    transform: translateY(20px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes orbitDrift {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(18px, -16px) rotate(12deg);
  }
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes aiProgress {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(250%);
  }
}

@keyframes loadingDrop {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .login-brand {
    min-height: 320px;
    padding: 28px;
  }

  .brand-content {
    min-height: 264px;
  }

  .brand-logo {
    max-width: min(360px, 88%);
    padding: 18px;
  }

  .login-form-panel {
    margin-left: 0;
    margin-top: 0;
  }

  .app-frame {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .side-nav {
    min-height: auto;
    position: relative;
    top: 0;
  }

  .side-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .form-grid,
  .plan-topline,
  .special-day-entry,
  .special-time-row,
  .admin-template-grid,
  .admin-prompt-form,
  .admin-sector-form,
  .sector-management-grid,
  .prompt-template-edit,
  .institution-prompt-grid,
  .admin-social-form,
  .admin-row-form {
    grid-template-columns: 1fr;
  }

  .prompt-sector-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-logo-uploader {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .day-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .frame-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .login-shell {
    gap: 14px;
    padding: 12px;
  }

  .login-brand {
    min-height: 250px;
    padding: 20px;
  }

  .brand-content {
    min-height: 210px;
  }

  .brand-logo {
    max-width: 290px;
  }

  .login-brand h1 {
    font-size: 2.25rem;
  }

  .login-form-panel {
    padding: 22px;
  }

  .login-form-head h2 {
    font-size: 2rem;
  }

  .brand-logo-uploader,
  .schedule-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo-uploader {
    display: flex;
  }

  .brand-logo-preview {
    width: 96px;
  }

  .day-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-sector-tabs {
    grid-template-columns: 1fr;
  }

  .prompt-sector-head {
    flex-direction: column;
  }

  .ai-loading-card {
    grid-template-columns: 112px 1fr;
    padding: 22px;
  }

  .ai-loading-card img {
    height: 96px;
    width: 108px;
  }

  .ai-loading-card strong {
    font-size: 1.45rem;
  }

  .ai-loading-card span {
    font-size: .96rem;
  }

  .ai-progress {
    height: 12px;
  }
}
