:root {
  --primary: #071D7A;
  --primary-dark: #04124D;
  --accent: #E51B2B;
  --white: #FFFFFF;
  --light: #F5F7FB;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 16px 36px rgba(15, 23, 42, .07);
  --radius: 20px;
  --surface-soft: #F8FAFC;
  --surface-muted: #F1F5F9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--light);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(15, 43, 89, .80), rgba(15, 43, 89, .80)),
    url("https://images.unsplash.com/photo-1588072432836-e10032774350?auto=format&fit=crop&w=1600&q=80") center / cover no-repeat fixed;
}

.login-hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-shell {
  width: min(920px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: .88fr 1fr;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(15, 43, 89, .14);
  overflow: hidden;
  position: relative;
  animation: rise .45s ease both;
}

.login-brand-panel {
  position: relative;
  padding: 38px 34px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 90%, rgba(242, 182, 50, .18), transparent 34%),
    linear-gradient(145deg, #0f2b59 0%, #173b78 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgba(242, 182, 50, .12);
}

.brand-content,
.login-admin-note {
  position: relative;
  z-index: 1;
}

.brand-mark-large {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .18);
  margin-bottom: 22px;
}

.brand-mark-large img {
  width: 78px;
  height: auto;
  display: block;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 16px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #edf2fb;
  color: #173b78;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f2b632;
}

.eyebrow.light {
  background: rgba(255, 255, 255, .10);
  color: #f2b632;
}

.login-brand-panel h1 {
  max-width: 320px;
  margin: 0 0 12px;
  color: #fff;
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: -.04em;
}

.login-brand-panel p:not(.eyebrow) {
  max-width: 320px;
  margin: 0;
  color: rgba(255, 255, 255, .74);
  font-size: 14px;
  line-height: 1.65;
}

.login-admin-note {
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding-top: 22px;
}

.login-admin-note span {
  display: block;
  margin-bottom: 9px;
  color: #f2b632;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.login-admin-note p {
  color: rgba(255, 255, 255, .70);
  font-size: 13px;
  line-height: 1.55;
}

.login-card {
  width: 100%;
  min-height: 520px;
  background: #fff;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: none;
}

.login-mobile-logo {
  display: none;
  width: 76px;
  height: 76px;
  border-radius: 16px;
  background: #fff;
  place-items: center;
  margin: 0 auto 22px;
  box-shadow: 0 14px 32px rgba(15, 43, 89, .13);
}

.login-mobile-logo img { width: 62px; }

.login-heading {
  width: 100%;
  max-width: 370px;
  margin: 0 auto 28px;
}

.login-card h2 {
  margin: 0 0 8px;
  color: #0f2b59;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -.04em;
}

.login-card .eyebrow,
.login-subtitle { text-align: left; }

.login-subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.form-stack {
  display: grid;
}

.input-group {
  display: grid;
  gap: 8px;
}

.btn.full {
  width: 100%;
}

.login-form {
  width: 100%;
  max-width: 370px;
  margin: 0 auto;
  gap: 17px;
}

.input-group > span:first-child,
.password-label-row {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}

.password-label-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.password-label-row a {
  color: #173b78;
  font-size: 12px;
  font-weight: 800;
}

.input-shell {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 1px solid #dfe4ea;
  border-radius: 12px;
  background: #fff;
  padding: 0 14px;
  box-shadow: none;
  transition: border .2s ease, box-shadow .2s ease;
}

.input-shell:focus-within {
  border-color: #173b78;
  box-shadow: 0 0 0 4px rgba(23, 59, 120, .08);
}

.input-shell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #173b78;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .72;
}

.input-shell input {
  border: 0;
  border-radius: 0;
  padding: 0;
  min-width: 0;
  height: 46px;
  box-shadow: none;
  color: var(--text);
  font-size: 14px;
}

.input-shell input:focus { box-shadow: none; }

.password-toggle {
  border: 0;
  background: #edf2fb;
  color: #173b78;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 5px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.remember-row input { accent-color: #173b78; }

.btn.primary.login-submit {
  min-height: 50px;
  border-radius: 12px;
  margin-top: 0;
  gap: 10px;
  background: #173b78;
  font-weight: 800;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.btn.primary.login-submit:hover {
  background: #0f2b59;
  transform: translateY(-1px);
}

.login-footnote {
  width: 100%;
  max-width: 370px;
  margin: 20px auto 0;
  padding: 16px;
  display: grid;
  gap: 4px;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  background: #f3f5f8;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-footnote strong {
  color: var(--text);
  font-size: 13px;
}

.login-footnote span { color: var(--muted); font-size: 13px; }

.login-footnote a {
  color: #173b78;
  font-weight: 800;
}

.login-support {
  width: 100%;
  max-width: 370px;
  margin: 18px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.login-support a {
  color: #173b78;
  font-weight: 700;
}

.login-logo-wrap { display: none; }

.alert {
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 18px;
  font-weight: 700;
}


.login-card .alert {
  width: 100%;
  max-width: 370px;
  margin-left: auto;
  margin-right: auto;
}

.alert.success { background: #eafaf1; color: #146c43; }
.alert.error,
.field-error {
  background: #fff1f2;
  color: #b4232f;
  border: 1px solid #ffd4d9;
}

.field-error {
  border-radius: 14px;
  padding: 12px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Professional administration refinements: flatter surfaces, compact typography and consistent controls. */
.app-shell {
  background: #f6f8fb;
  font-size: 13px;
}

.app-shell .eyebrow {
  padding: 6px 9px;
  font-size: 10px;
  letter-spacing: .075em;
  background: #eef2f7;
}

.app-shell input,
.app-shell select,
.app-shell textarea {
  font-size: 13px;
}

.app-shell strong {
  font-weight: 650;
}

.sidebar {
  width: 292px;
  background: #fff;
  color: var(--text);
  border-right: 1px solid rgba(226, 232, 240, .92);
  box-shadow: 12px 0 32px rgba(15, 23, 42, .035);
  padding: 20px 16px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.sidebar-head {
  padding: 6px 6px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, .86);
}

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

.brand-logo-wrap {
  width: 86px;
  height: 48px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(7, 29, 122, .08);
  flex: 0 0 auto;
}

.brand-logo {
  width: 74px;
  height: auto;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: var(--primary-dark);
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 4px;
  padding: 22px 0;
}

.nav-section {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  margin: 16px 12px 7px;
  text-transform: uppercase;
}

.nav-section:first-child { margin-top: 0; }

.nav-link {
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 12px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.nav-link:hover {
  background: #f8fafc;
  color: var(--primary);
  transform: translateX(2px);
}

.nav-link.is-active {
  background: #eef2ff;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(7, 29, 122, .08);
}

.nav-link.is-active::before {
  content: "";
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, .9);
  color: #64748b;
  font-size: 13px;
  flex: 0 0 auto;
}


.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group summary {
  list-style: none;
  cursor: pointer;
}

.nav-group summary::-webkit-details-marker { display: none; }

.nav-summary em {
  margin-left: auto;
  color: #94a3b8;
  font-style: normal;
  font-size: 14px;
  transition: transform .18s ease;
}

.nav-group[open] .nav-summary em { transform: rotate(180deg); }

.nav-submenu {
  display: grid;
  gap: 4px;
  margin: 0 0 6px 46px;
  padding-left: 12px;
  border-left: 1px solid rgba(226, 232, 240, .95);
}

.nav-sublink {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease;
}

.nav-sublink:hover,
.nav-sublink.is-active {
  background: var(--surface-soft);
  color: var(--primary);
}

.nav-link:hover .nav-icon,
.nav-link.is-active .nav-icon {
  background: #fff;
  border-color: rgba(7, 29, 122, .14);
  color: var(--accent);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(226, 232, 240, .86);
}

.public-page-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .95);
  color: var(--primary-dark);
}

.public-page-link strong,
.logout-link span {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.public-page-link small,
.logout-link small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.public-page-link em {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-style: normal;
}

.logout-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  color: #b4232f;
  border: 1px solid #ffe0e4;
  padding: 13px 14px;
  border-radius: 16px;
  font-weight: 600;
}

.logout-link:hover,
.public-page-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}

.main-panel {
  margin-left: 292px;
  min-height: 100vh;
  width: calc(100% - 292px);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--primary-dark);
}

.icon-button {
  display: none;
  border: 0;
  background: #fff;
  border-radius: 14px;
  padding: 10px 13px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
}

.user-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 9px 14px;
}

.user-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.avatar.big {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  font-size: 30px;
}

.content-wrap {
  padding: 26px;
  flex: 1;
  font-size: 14px;
}

.hero-card,
.panel-card,
.table-card,
.filters-card,
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.hero-card {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 38%;
  background: #f3f6fb;
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%);
}

.hero-card h2 {
  font-size: 26px;
  font-weight: 600;
  margin: 0;
  color: var(--primary);
}

.hero-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 640px;
}

.hero-card img {
  width: 120px;
  z-index: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 22px 0;
}

.stat-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  background: rgba(7, 29, 122, .08);
  border-radius: 22px;
  right: -14px;
  top: -14px;
  transform: rotate(18deg);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.stat-card strong {
  display: block;
  color: var(--primary);
  font-size: 24px;
  font-weight: 600;
  margin: 8px 0;
}

.stat-card em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
  font-size: 11px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 22px;
}

.panel-card { padding: 20px; }

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

.section-head h2,
.section-head h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 17px;
  font-weight: 600;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.quick-actions {
  display: grid;
  gap: 12px;
}

.quick-actions a {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.activity-list {
  display: grid;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 12px;
}

.activity-item > span {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 6px;
  box-shadow: 0 0 0 5px #ffe5e8;
}

.activity-item p {
  margin: 4px 0;
  color: var(--muted);
}

.activity-item small,
.muted-text { color: var(--muted); }

.filters-card {
  padding: 18px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 18px;
}

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

.modern-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--surface-soft);
}

.modern-table th,
.modern-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.modern-table td span:not(.badge) {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 600;
}

.badge.ok { background: #eafaf1; color: #137248; }
.badge.off { background: #f3f4f6; color: #64748b; }
.badge.role { background: #eef2ff; color: var(--primary); }

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions form { display: inline; }

.actions a,
.actions button {
  border: 0;
  background: var(--surface-muted);
  color: var(--primary);
  border-radius: 12px;
  padding: 9px 11px;
  font-weight: 600;
  cursor: pointer;
}


.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(7, 29, 122, .18);
}

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

.actions .danger,
.danger {
  background: #fff1f2 !important;
  color: #c01627 !important;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 34px !important;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 600;
}

.form-grid label small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.form-grid textarea {
  resize: vertical;
  min-height: 180px;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: rgba(7, 29, 122, .35);
  box-shadow: 0 0 0 4px rgba(7, 29, 122, .08);
}
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; }


.email-template-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .75fr);
  gap: 18px;
  align-items: start;
}

.email-template-workspace .panel-card {
  box-shadow: none;
  border-color: rgba(226, 232, 240, .92);
}

.email-template-head,
.email-preview-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.email-template-head p,
.email-preview-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.code-editor-label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 650;
}

.form-grid textarea.code-editor-textarea,
.code-editor-textarea {
  min-height: 740px;
  padding: 16px 18px 16px 62px;
  border: 1px solid #b6c3d1;
  border-radius: 16px;
  background:
    linear-gradient(90deg, #f1f5f9 0 46px, #dbe4ee 46px 47px, transparent 47px),
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(7, 29, 122, .07) 27px 28px),
    #ffffff;
  color: #0f172a;
  caret-color: var(--primary);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14px;
  line-height: 28px;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(226, 232, 240, .55);
}

.form-grid textarea.code-editor-textarea:focus,
.code-editor-textarea:focus {
  border-color: rgba(7, 29, 122, .62);
  box-shadow: 0 0 0 4px rgba(7, 29, 122, .10), inset 0 0 0 1px rgba(7, 29, 122, .08);
}

.email-preview-panel {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 108px);
  background: #f8faff;
  overflow: hidden;
}

.email-subject-preview-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.email-subject-preview-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.email-subject-preview-card strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
}

.email-preview-frame-card {
  display: grid;
  min-height: 0;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.email-preview-frame-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
}

.email-preview-frame-card iframe {
  display: block;
  width: 100%;
  min-height: 560px;
  height: calc(100vh - 330px);
  border: 0;
  background: #fff;
}

.permissions-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.permission-group {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
}

.permission-group h3 {
  margin: 0 0 12px;
  color: var(--primary);
}

.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  padding: 10px;
  border-radius: 14px;
}

.check-row:hover { background: #fff; }

.check-row small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 500;
}

.detail-card {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.detail-card dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  margin: 0;
}

.detail-card dt {
  font-weight: 600;
  color: var(--muted);
}

.footer {
  padding: 20px 34px;
  color: var(--muted);
  font-size: 13px;
}


.btn.secondary {
  background: var(--surface-soft);
  color: var(--primary);
  border: 1px solid var(--border);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.compact-hero { gap: 18px; }
.compact-panel { margin-top: 22px; }
.compact-head { margin-bottom: 14px; }
.table-responsive { overflow-x: auto; }

.compact-table {
  min-width: 920px;
  font-size: 13px;
}

.compact-table th {
  font-size: 11px;
  font-weight: 600;
}

.compact-table td strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.compact-table td span:not(.badge) {
  font-size: 12px;
}

.message-cell {
  color: var(--muted);
  max-width: 260px;
  white-space: normal;
}

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

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2,
  .filters-card { grid-template-columns: 1fr; }
  .email-template-workspace { grid-template-columns: 1fr; }
  .email-preview-panel {
    position: static;
    max-height: none;
  }
  .email-preview-frame-card iframe { height: 560px; }
  .permissions-board { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-105%);
    transition: .25s ease;
  }

  .sidebar.open { transform: none; }

  .sidebar-backdrop.open {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .35);
    z-index: 15;
  }

  .main-panel {
    margin-left: 0;
    width: 100%;
  }

  .icon-button { display: block; }
  .topbar { padding: 0 18px; }
  .user-chip { display: none; }
  .content-wrap { padding: 20px; }

  .form-grid,
  .stats-grid { grid-template-columns: 1fr; }

  .span-2 { grid-column: span 1; }
  .hero-card img { display: none; }

  .login-hero { padding: 18px; }

  .login-shell {
    grid-template-columns: 1fr;
    width: min(460px, 100%);
    min-height: auto;
    border-radius: 18px;
  }

  .login-brand-panel { display: none; }

  .login-card {
    min-height: auto;
    padding: 34px 26px 30px;
    border-radius: 18px;
  }

  .login-mobile-logo { display: grid; }

  .login-heading,
  .login-form,
  .login-footnote,
  .login-support {
    max-width: 100%;
  }

  .login-card .eyebrow {
    margin-left: auto;
    margin-right: auto;
  }

  .login-card .eyebrow,
  .login-subtitle,
  .login-card h2 { text-align: center; }
}

.nav-icon svg,
.public-page-link em svg,
.logout-link em svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-link em {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff1f2;
  color: #b4232f;
  font-style: normal;
  flex: 0 0 auto;
}

.status-dot {
  width: 11px;
  height: 11px;
  display: inline-block;
  border-radius: 999px;
  background: var(--status-color, #94a3b8);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .18);
  margin-right: 8px;
  vertical-align: middle;
}

.status-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
}

.status-form select {
  min-width: 150px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  outline: none;
}

.status-form select:focus {
  border-color: rgba(7, 29, 122, .35);
  box-shadow: 0 0 0 4px rgba(7, 29, 122, .08);
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.check-row input {
  width: auto;
}

.admissions-table { min-width: 1080px; }

.logout-link { justify-content: flex-start; gap: 12px; }

/* Admin visual pass: compact, flat and consistent across dashboard modules. */
.content-wrap {
  font-size: 13px;
}

.hero-card,
.panel-card,
.table-card,
.filters-card,
.stat-card {
  box-shadow: var(--shadow);
}

.table-card {
  overflow: hidden;
}

.topbar {
  height: 68px;
  background: rgba(255, 255, 255, .94);
}

.topbar h1 {
  font-size: 18px;
  letter-spacing: -.02em;
}

.user-chip {
  border-radius: 14px;
  padding: 7px 12px;
}

.user-chip strong {
  font-size: 13px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 13px;
}

.nav-link {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 11px;
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 9px;
}

.nav-sublink {
  padding: 7px 10px;
  font-size: 12px;
}

.public-page-link,
.logout-link {
  border-radius: 14px;
  padding: 12px;
}

.hero-card {
  padding: 22px;
}

.hero-card::before {
  width: 32%;
  background: #f7f9fc;
}

.hero-card h2 {
  font-size: 23px;
  letter-spacing: -.02em;
}

.hero-card p {
  font-size: 13px;
}

.stat-card {
  padding: 16px;
}

.stat-card::after {
  background: #f4f7fb;
}

.stat-card span {
  font-size: 12px;
}

.stat-card strong {
  font-size: 22px;
}

.section-head h2,
.section-head h3 {
  font-size: 16px;
}

.section-head p,
.activity-item p,
.message-cell,
.form-grid label small {
  font-size: 12px;
  line-height: 1.5;
}

.quick-actions a {
  padding: 13px 14px;
  border-radius: 14px;
  font-size: 13px;
  background: #fff;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.quick-actions a:hover {
  background: var(--surface-soft);
  border-color: rgba(7, 29, 122, .18);
  color: var(--primary);
  transform: translateY(-1px);
}

.filters-card {
  padding: 14px;
  border-radius: 18px;
}

.filters-card input,
.filters-card select,
.status-form select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 38px;
  border-radius: 11px;
  font-size: 13px;
}

.filters-card input,
.filters-card select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 9px 11px;
}

.filters-card input:focus,
.filters-card select:focus {
  border-color: rgba(7, 29, 122, .32);
  box-shadow: 0 0 0 3px rgba(7, 29, 122, .07);
}

.modern-table th {
  font-size: 11px;
  font-weight: 650;
}

.modern-table th,
.modern-table td {
  padding: 11px 12px;
}

.modern-table td,
.modern-table td strong {
  font-size: 13px;
}

.modern-table td span:not(.badge) {
  font-size: 12px;
}

.badge {
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 650;
}

.btn,
.actions a,
.actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

.btn.secondary,
.actions a,
.actions button {
  background: #fff;
  border-color: var(--border);
  color: var(--primary-dark);
}

.btn:hover,
.actions a:hover,
.actions button:hover {
  transform: translateY(-1px);
}

.btn.secondary:hover,
.actions a:hover,
.actions button:hover {
  background: var(--surface-soft);
  border-color: rgba(7, 29, 122, .2);
  color: var(--primary);
}

.actions .danger,
.danger {
  border-color: #ffd4d9 !important;
}

.permission-group,
.check-row {
  background: #fff;
}

.permission-group h3 {
  font-size: 15px;
}

.footer {
  font-size: 12px;
}
