:root {
  --se-bg: #eaf5ff;
  --se-bg-soft: #f5faff;
  --se-surface: rgba(255, 255, 255, 0.96);
  --se-surface-strong: #ffffff;
  --se-primary: #0f5f9a;
  --se-primary-soft: #2f7eb7;
  --se-accent: #35a8ff;
  --se-accent-soft: rgba(53, 168, 255, 0.16);
  --se-success: #17603a;
  --se-danger: #a93f4f;
  --se-warning: #1c6da8;
  --se-info: #1f76bf;
  --se-border: rgba(24, 97, 153, 0.16);
  --se-grid-line: rgba(26, 102, 160, 0.28);
  --se-grid-line-soft: rgba(26, 102, 160, 0.16);
  --se-text: #15344d;
  --se-muted: #577a99;
  --se-display-font: "Noto Serif Thai", "Times New Roman", serif;
  --se-body-font: "Prompt", "Noto Sans Thai", "Leelawadee UI", "Tahoma", sans-serif;
  --se-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.09);
  --se-shadow-lg: 0 26px 54px rgba(15, 23, 42, 0.15);
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 992px) {
  html {
    font-size: 16px;
  }
}

body.school-body {
  margin: 0;
  min-height: 100vh;
  color: var(--se-text);
  font-family: var(--se-body-font);
  line-height: 1.55;
  background:
    radial-gradient(circle at 10% 8%, rgba(23, 50, 77, 0.08), transparent 24%),
    radial-gradient(circle at 96% 6%, rgba(53, 168, 255, 0.16), transparent 20%),
    linear-gradient(160deg, #f4f9ff 0%, #edf6ff 45%, #fbfeff 100%);
}

body.school-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 48%),
    radial-gradient(circle at 82% 80%, rgba(53, 168, 255, 0.08), transparent 24%);
}

a {
  color: var(--se-primary);
}

.school-body-auth .container,
.school-body-auth .container-fluid {
  max-width: none;
}

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

.app-sidebar {
  width: 300px;
  color: var(--se-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(240, 248, 255, 0.94) 100%);
  border-right: 1px solid var(--se-border);
  display: flex;
  flex-direction: column;
}

.app-sidebar .offcanvas-header {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--se-border) !important;
}

.app-sidebar .offcanvas-body {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.sidebar-brand {
  border-bottom: 1px solid var(--se-border);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--se-primary);
  text-decoration: none;
}

.brand-link:hover {
  color: var(--se-primary);
}

.brand-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(53, 168, 255, 0.2), rgba(255, 255, 255, 0.92));
  color: var(--se-accent);
  font-size: 1.3rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.brand-title {
  font-family: var(--se-display-font);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-subtitle {
  color: var(--se-muted);
}

.sidebar-section-title {
  color: var(--se-muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.45rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--se-primary-soft);
  border-radius: 1rem;
  margin: 0.18rem 0.28rem;
  padding: 0.74rem 0.88rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(47, 76, 104, 0.24);
  border-radius: 999px;
}

.sidebar-nav .nav-link i {
  width: 1.25rem;
  text-align: center;
  color: var(--se-accent);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 95, 154, 0.96), rgba(47, 126, 183, 0.9));
  box-shadow: 0 12px 24px rgba(15, 95, 154, 0.22);
  transform: translateX(2px);
}

.sidebar-nav .nav-link:hover i,
.sidebar-nav .nav-link.active i {
  color: #d8efff;
}

.sidebar-footer {
  border-top: 1px solid var(--se-border);
  background: rgba(255, 255, 255, 0.62);
}

.sidebar-user {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 95, 154, 0.14);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sidebar-user-label,
.sidebar-user-role {
  color: var(--se-muted);
}

.sidebar-user-version {
  color: #4c7aa3;
}

.sidebar-user-name {
  color: var(--se-primary);
}

.user-status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
  background: #34c759;
  box-shadow: 0 0 0 5px rgba(52, 199, 89, 0.12);
}

.app-content {
  min-width: 0;
}

.app-mobile-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--se-border);
  backdrop-filter: blur(18px);
}

.app-main,
.app-guest {
  position: relative;
  z-index: 1;
}

.app-page-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.65rem;
  border-radius: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    radial-gradient(circle at top right, rgba(53, 168, 255, 0.2), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(242, 250, 255, 0.93));
  box-shadow: var(--se-shadow-lg);
  animation: rise-fade 0.45s ease both;
}

.page-hero-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.page-hero-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.45rem;
  color: var(--se-primary);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(53, 168, 255, 0.2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 16px 28px rgba(15, 95, 154, 0.16);
}

.page-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  background: var(--se-accent-soft);
  color: #1f6da8;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.page-hero-title {
  margin: 0.35rem 0 0.3rem;
  font-family: var(--se-display-font);
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  color: var(--se-primary);
  line-height: 1.15;
}

.page-hero-subtitle {
  margin: 0;
  max-width: 52rem;
  color: var(--se-muted);
}

.page-hero-meta {
  display: grid;
  gap: 0.2rem;
  min-width: 14rem;
  padding: 1rem 1.15rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 95, 154, 0.12);
  text-align: right;
}

.page-meta-label {
  color: var(--se-muted);
  font-size: 0.85rem;
}

.page-meta-value {
  color: var(--se-primary);
  font-size: 1rem;
}

.page-meta-subvalue {
  color: var(--se-accent);
  font-size: 0.9rem;
}

.card,
.auth-story,
.auth-card,
.access-card,
.home-hero {
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--se-surface);
  box-shadow: var(--se-shadow-sm);
  backdrop-filter: blur(18px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(36, 50, 69, 0.08);
  background: transparent !important;
  color: var(--se-primary);
  font-weight: 600;
}

.card-body {
  padding: 1.35rem;
}

.table {
  color: var(--se-text);
}

.table > :not(caption) > * > * {
  padding: 0.95rem 1rem;
  border-bottom-color: var(--se-grid-line-soft);
}

.table thead th {
  color: var(--se-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(238, 247, 255, 0.9);
  border-bottom-color: var(--se-grid-line);
}

.table tbody tr:hover {
  background: rgba(53, 168, 255, 0.09);
}

.list-group-item {
  border-color: rgba(36, 50, 69, 0.08);
  background: transparent;
  padding: 1rem 1.2rem;
}

.table-responsive {
  border-radius: 0 0 1.5rem 1.5rem;
}

.table-grid-strong {
  border: 1px solid var(--se-grid-line);
}

.table-grid-strong > :not(caption) > * > * {
  border: 1px solid var(--se-grid-line-soft);
}

.table-grid-strong thead th {
  border-bottom-color: var(--se-grid-line) !important;
}

.badge {
  padding: 0.5rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.badge.bg-success {
  background: rgba(23, 96, 58, 0.12) !important;
  color: var(--se-success) !important;
}

.badge.bg-danger {
  background: rgba(169, 63, 79, 0.12) !important;
  color: var(--se-danger) !important;
}

.badge.bg-secondary {
  background: rgba(100, 116, 139, 0.14) !important;
  color: #475569 !important;
}

.badge.bg-warning,
.badge.bg-warning.text-dark {
  background: rgba(53, 168, 255, 0.16) !important;
  color: var(--se-warning) !important;
}

.badge.bg-info,
.badge.bg-info.text-dark {
  background: rgba(39, 87, 126, 0.12) !important;
  color: var(--se-info) !important;
}

.btn,
input,
select,
textarea {
  font-family: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 999px;
  font-weight: 500;
  box-shadow: none;
}

.btn-primary,
.btn-dark {
  background:
    linear-gradient(135deg, #1d7cc2 0%, #1568a8 100%);
  border-color: #1568a8;
  color: #fff;
}

.btn-primary:hover,
.btn-dark:hover {
  background:
    linear-gradient(135deg, #176cae 0%, #125c93 100%);
  border-color: #125c93;
  color: #fff;
}

.btn-outline-primary,
.btn-outline-dark,
.btn-outline-secondary,
.btn-outline-danger,
.btn-light {
  border-width: 1px;
  background: rgba(255, 255, 255, 0.72);
}

.btn-outline-primary {
  border-color: rgba(15, 95, 154, 0.25);
  color: var(--se-primary);
}

.btn-outline-primary:hover,
.btn-outline-dark:hover,
.btn-outline-secondary:hover {
  background: rgba(15, 95, 154, 0.94);
  border-color: rgba(15, 95, 154, 0.94);
  color: #fff;
}

.btn-outline-secondary {
  border-color: rgba(100, 116, 139, 0.2);
  color: #46576d;
}

.btn-outline-dark {
  border-color: rgba(15, 95, 154, 0.25);
  color: var(--se-primary);
}

.btn-outline-danger {
  border-color: rgba(169, 63, 79, 0.22);
  color: var(--se-danger);
}

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

.btn-light {
  border-color: rgba(36, 50, 69, 0.08);
  color: var(--se-primary-soft);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.22rem rgba(53, 168, 255, 0.24);
}

.form-control,
.form-select,
.input-group-text {
  min-height: 3rem;
  border-radius: 1rem;
  border-color: rgba(36, 50, 69, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

.input-group > .form-control,
.input-group > .form-select {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group-text {
  color: var(--se-accent);
  background: rgba(53, 168, 255, 0.14);
}

.form-check-input {
  border-color: rgba(36, 50, 69, 0.2);
}

.form-check-input:checked {
  background-color: var(--se-primary);
  border-color: var(--se-primary);
}

.alert {
  border: 0;
  border-radius: 1.1rem;
  box-shadow: var(--se-shadow-sm);
}

.auth-shell {
  max-width: 1160px;
  margin-inline: auto;
}

.auth-story,
.auth-card,
.access-card,
.home-hero {
  padding: 2rem;
}

.auth-story {
  background:
    radial-gradient(circle at top right, rgba(53, 168, 255, 0.2), transparent 25%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(237, 247, 255, 0.92));
}

.auth-display,
.home-title,
.access-title,
.dashboard-title {
  margin: 0.75rem 0 0.85rem;
  font-family: var(--se-display-font);
  color: var(--se-primary);
  line-height: 1.14;
}

.auth-display {
  font-size: clamp(2rem, 4vw, 3.15rem);
}

.auth-description,
.home-description,
.access-description {
  color: var(--se-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.auth-badge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.auth-badge-card {
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(36, 50, 69, 0.08);
}

.auth-badge-card i,
.auth-feature-icon,
.dashboard-metric-icon,
.section-icon,
.access-icon,
.home-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-badge-card i,
.dashboard-metric-icon,
.section-icon,
.access-icon,
.home-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 1rem;
  background: var(--se-accent-soft);
  color: var(--se-accent);
  font-size: 1.2rem;
}

.auth-badge-card strong,
.metric-value {
  display: block;
  margin-top: 0.8rem;
  color: var(--se-primary);
  font-size: 1.35rem;
  line-height: 1;
}

.auth-badge-card span,
.metric-meta {
  color: var(--se-muted);
  font-size: 0.9rem;
}

.auth-feature-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.auth-feature {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.05rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 50, 69, 0.08);
}

.auth-feature-icon {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
  color: var(--se-primary);
  background: rgba(15, 95, 154, 0.11);
  font-size: 1rem;
}

.auth-card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.auth-card-icon {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--se-primary);
  background: linear-gradient(145deg, rgba(53, 168, 255, 0.2), rgba(255, 255, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 1.35rem;
}

.auth-form-title {
  margin: 0.55rem 0 0.4rem;
  color: var(--se-primary);
  font-family: var(--se-display-font);
  font-size: 1.9rem;
}

.auth-footnote {
  margin-top: 1rem;
  color: var(--se-muted);
  font-size: 0.9rem;
}

.dashboard-hero {
  margin-bottom: 1.5rem;
  padding: 1.75rem;
  border-radius: 1.7rem;
  background:
    radial-gradient(circle at top right, rgba(53, 168, 255, 0.2), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 255, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--se-shadow-lg);
  animation: rise-fade 0.5s ease both;
}

.dashboard-hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.2rem;
}

.dashboard-copy {
  max-width: 42rem;
}

.dashboard-title {
  font-size: clamp(1.7rem, 2.9vw, 2.5rem);
}

.dashboard-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dashboard-metric-card {
  height: 100%;
  padding: 1.25rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--se-shadow-sm);
}

.dashboard-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.dashboard-metric-label {
  color: var(--se-muted);
  font-size: 0.95rem;
}

.metric-value {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 2.65rem);
}

.dashboard-card-header {
  align-items: center;
}

.dashboard-card-header-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.dashboard-section-title {
  margin: 0;
  color: var(--se-primary);
  font-weight: 700;
}

.dashboard-section-subtitle {
  margin: 0.2rem 0 0;
  color: var(--se-muted);
  font-size: 0.9rem;
}

.dashboard-list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
}

.dashboard-list-item + .dashboard-list-item {
  border-top: 1px solid rgba(36, 50, 69, 0.08);
}

.dashboard-empty {
  padding: 1.4rem;
  color: var(--se-muted);
}

.wizard-hero {
  background:
    radial-gradient(circle at top right, rgba(39, 87, 126, 0.15), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(242, 247, 252, 0.96));
}

.wizard-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.wizard-version-badge {
  min-width: 190px;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--se-grid-line-soft);
  background: rgba(255, 255, 255, 0.86);
  text-align: right;
}

.role-wizard-nav {
  gap: 0.45rem;
}

.role-wizard-nav .nav-link {
  border-radius: 999px;
  border: 1px solid rgba(36, 50, 69, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--se-primary-soft);
  font-weight: 500;
}

.role-wizard-nav .nav-link.active {
  border-color: #1568a8;
  background: linear-gradient(135deg, #1d7cc2, #2f7eb7);
  color: #fff;
}

.wizard-role-summary {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--se-grid-line-soft);
}

.wizard-accent-saraban {
  background: rgba(24, 82, 130, 0.08);
}

.wizard-accent-staff {
  background: rgba(53, 168, 255, 0.09);
}

.wizard-accent-executive {
  background: rgba(47, 126, 183, 0.11);
}

.wizard-accent-head {
  background: rgba(15, 95, 154, 0.1);
}

.wizard-step-table tbody td {
  vertical-align: top;
}

.wizard-step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #1e6fab;
  color: #fff;
  font-weight: 600;
}

.section-icon {
  flex: 0 0 auto;
}

.access-shell,
.home-shell {
  max-width: 880px;
  margin-inline: auto;
}

.access-card,
.home-hero {
  text-align: center;
}

.access-icon,
.home-icon {
  margin-inline: auto;
  margin-bottom: 1rem;
  width: 4rem;
  height: 4rem;
  border-radius: 1.35rem;
  font-size: 1.5rem;
}

.access-title,
.home-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.home-actions,
.access-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.filter-panel {
  border: 1px solid var(--se-grid-line-soft);
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.95), rgba(246, 250, 255, 0.8));
}

.filter-section-title {
  margin: 0 0 0.85rem;
  color: var(--se-primary);
  font-weight: 600;
}

.filter-grid {
  align-items: stretch;
}

.filter-group {
  padding: 0.82rem;
  border: 1px solid rgba(36, 50, 69, 0.13);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.82);
}

.filter-group .form-label {
  margin-bottom: 0.45rem;
  color: #1e5f91;
  font-weight: 600;
}

.filter-group .form-control,
.filter-group .form-select {
  border-color: rgba(36, 50, 69, 0.18);
  background: #fff;
}

.filter-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.95rem;
}

.filter-actions .btn {
  min-height: 2.85rem;
}

.document-create-form {
  gap: 0.35rem;
}

.document-create-section {
  padding: 1.05rem;
  border: 1px solid var(--se-grid-line-soft);
  border-radius: 1.2rem;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 255, 0.78));
}

.document-create-section-header {
  margin-bottom: 0.95rem;
}

.document-create-section-title {
  margin: 0;
  font-family: var(--se-display-font);
  color: var(--se-primary);
  font-size: 1.18rem;
}

.document-create-section-subtitle {
  margin: 0.35rem 0 0;
  color: var(--se-muted);
  font-size: 0.9rem;
}

.document-create-field {
  padding: 0.9rem;
  border: 1px solid rgba(36, 50, 69, 0.13);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
}

.document-create-field .form-label {
  margin-bottom: 0.5rem;
  color: #1e5f91;
  font-weight: 600;
}

.document-create-field .form-control,
.document-create-field .form-select,
.document-create-field textarea {
  border-color: rgba(36, 50, 69, 0.18);
  background: #fff;
}

.document-create-recipient-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid rgba(36, 50, 69, 0.17);
  border-radius: 0.95rem;
  background: #fff;
  padding: 0.7rem 0.8rem;
}

.document-create-actions .btn {
  min-height: 2.9rem;
}

.signature-owner-item,
.recipient-option {
  padding: 0.45rem 0.2rem;
  border-bottom: 1px dashed rgba(36, 50, 69, 0.08);
}

.signature-owner-item:last-child,
.recipient-option:last-child {
  border-bottom: 0;
}

#signaturePad {
  border: 1px solid rgba(36, 50, 69, 0.14) !important;
  border-radius: 1rem !important;
  background: #fff !important;
}

.app-main > h3.mb-3:first-child,
.app-main > .d-flex.justify-content-between.align-items-center.mb-3:first-child h3 {
  margin-bottom: 0 !important;
  color: var(--se-primary);
  font-family: var(--se-display-font);
  font-size: clamp(1.45rem, 2vw, 1.9rem);
}

.app-main > .d-flex.justify-content-between.align-items-center.mb-3:first-child {
  margin-bottom: 1.2rem !important;
}

.app-main .card,
.app-guest .card,
.dashboard-metric-card,
.auth-story,
.auth-card,
.access-card,
.home-hero {
  animation: rise-fade 0.4s ease both;
}

@keyframes rise-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 992px) {
  .app-shell {
    display: flex;
    gap: 1.4rem;
    padding: 1.25rem;
  }

  .app-sidebar {
    position: sticky;
    top: 1.25rem;
    height: calc(100vh - 2.5rem);
    transform: none !important;
    visibility: visible !important;
    border-radius: 1.75rem;
    box-shadow: var(--se-shadow-lg);
    overflow: hidden;
  }

  .app-content {
    flex: 1 1 auto;
    padding-right: 0.5rem;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    max-width: 320px;
  }

  .app-page-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .page-hero-meta {
    min-width: 0;
    text-align: left;
  }

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

  .dashboard-hero-panel {
    flex-direction: column;
  }

  .wizard-version-badge {
    text-align: left;
  }
}

@media (max-width: 767.98px) {
  .app-main,
  .app-guest {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .page-hero-main {
    align-items: flex-start;
  }

  .page-hero-icon {
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 1.1rem;
  }

  .auth-story,
  .auth-card,
  .access-card,
  .home-hero,
  .dashboard-hero {
    padding: 1.4rem;
  }

  .auth-badge-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-table thead {
    display: none;
  }

  .dashboard-table tbody tr {
    display: block;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(36, 50, 69, 0.08);
  }

  .dashboard-table tbody td {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    padding: 0.38rem 1rem;
    font-size: 0.93rem;
  }

  .dashboard-table tbody td::before {
    color: var(--se-muted);
    font-weight: 600;
    content: attr(data-label);
  }

  .filter-group {
    padding: 0.72rem;
  }

  .filter-actions .btn {
    width: 100%;
  }

  .document-create-section {
    padding: 0.85rem;
  }

  .document-create-field {
    padding: 0.75rem;
  }

  .document-create-actions .btn {
    width: 100%;
  }
}
