:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #38bdf8;
  --border: #374151;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: radial-gradient(circle at top, #1e293b, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.wide-container {
  width: min(1500px, calc(100% - 32px));
}

.app-navbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  position: sticky;
  margin: 0 0 12px;
  top: 12px;
  z-index: 20;
  min-height: 68px;
  padding: 10px 12px;
  /* border: 1px solid rgba(55, 65, 81, 0.9); */
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  /* box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24); */
  /* backdrop-filter: blur(16px); */
  margin-bottom: 24px;
}

.app-navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.app-navbar-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #2563eb, #38bdf8);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.app-navbar-brand-copy {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}

.app-navbar-brand-copy strong {
  font-size: 14px;
}

.app-navbar-brand-copy small {
  color: var(--muted);
  font-size: 11px;
}

.app-navbar-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 4px;
}

.app-navbar-link,
.app-navbar-action {
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.app-navbar-link {
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 650;
}

.app-navbar-link:hover,
.app-navbar-link-active {
  background: rgba(56, 189, 248, 0.12);
  color: var(--text);
}

.app-navbar-link-active {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.app-navbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.app-navbar-action {
  padding: 8px 9px;
  font-size: 12px;
  font-weight: 600;
}

.app-navbar-password-button {
  border: 0;
  background: transparent;
  font-family: inherit;
}

.app-navbar-action:hover {
  color: var(--blue);
}

.app-navbar-password-button:hover {
  background: transparent;
}

.logout-form {
  margin: 0;
}

.app-navbar-logout {
  padding: 8px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.app-navbar-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 0 2px;
}

.title h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-context {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.page-context span {
  padding: 5px 8px;
  border: 1px solid rgba(55, 65, 81, 0.8);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.65);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

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

.card {
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.card-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.card-value-small {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.dashboard-actions {
  justify-content: space-between;
}

.dashboard-action-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.service-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.service-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.service-toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #4b5563;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}

.service-toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #f8fafc;
  transition: transform 0.16s ease;
}

.service-toggle input:checked + .service-toggle-switch {
  border-color: #22c55e;
  background: #16a34a;
}

.service-toggle input:checked + .service-toggle-switch::after {
  transform: translateX(20px);
}

.service-toggle input:focus-visible + .service-toggle-switch {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.service-toggle-disabled {
  color: #fca5a5;
}

.service-toggle-loading {
  cursor: wait;
  opacity: 0.7;
}

.action-info {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  font-size: 13px;
  font-weight: 600;
}

button {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: #374151;
}

button:disabled,
button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.62;
}

button.button-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-loader {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid rgba(248, 250, 252, 0.35);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

button.primary {
  background: #2563eb;
  border-color: #2563eb;
}

button.primary:disabled,
button.primary:disabled:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

#runSyncButton {
  min-width: 150px;
}

#processSmsButton {
  min-width: 132px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='date'],
input[type='time'],
input[type='number'],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
}

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

input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus,
input[type='date']:focus,
input[type='time']:focus,
input[type='number']:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(56, 189, 248, 0.35);
  outline-offset: 2px;
}

input[readonly] {
  color: var(--muted);
}

#openRetryFailedSmsModalButton {
  min-width: 174px;
}

.retry-sms-modal-panel {
  width: min(820px, 100%);
}

.retry-sms-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.retry-sms-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.retry-sms-form input,
.retry-sms-form select {
  width: 100%;
}

.retry-sms-preview {
  min-height: 46px;
}

.retry-sms-preview p {
  margin: 0;
}

.retry-sms-preview-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.retry-sms-preview-box div {
  display: grid;
  gap: 2px;
}

.retry-sms-preview-box strong {
  font-size: 24px;
  line-height: 1;
}

.retry-sms-preview-box span,
.retry-sms-preview-box p {
  color: var(--muted);
  font-size: 13px;
}

.retry-sms-preview-ok {
  border-color: rgba(34, 197, 94, 0.42);
}

.retry-sms-preview-blocked {
  border-color: rgba(248, 113, 113, 0.45);
}

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

.retry-sms-preview-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.64);
}

.retry-sms-preview-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.retry-sms-preview-grid strong {
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.retry-sms-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.section {
  margin-top: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-header h2 {
  margin: 0;
  font-size: 18px;
}

.section-tools {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.88);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.templates-table {
  min-width: 1120px;
}

.reference-notes-table {
  min-width: 1420px;
}

.commission-snapshots-table {
  min-width: 1900px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(31, 41, 55, 0.85);
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-PENDING {
  background: rgba(234, 179, 8, 0.16);
  color: var(--yellow);
}

.status-SENT,
.status-SUCCESS {
  background: rgba(34, 197, 94, 0.16);
  color: var(--green);
}

.status-FAILED {
  background: rgba(239, 68, 68, 0.16);
  color: var(--red);
}

.status-PROCESSING {
  background: rgba(56, 189, 248, 0.16);
  color: var(--blue);
}

.status-RUNNING {
  background: rgba(56, 189, 248, 0.16);
  color: var(--blue);
}

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

.sync-running {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--blue);
}

.sync-loader {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

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

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

.message {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-note {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-notes-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.reference-notes-toolbar input {
  width: 100%;
}

.commission-filter-toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.commission-filter-toolbar input,
.commission-filter-toolbar select {
  width: 100%;
}

.outbox-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(160px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.outbox-filter-toolbar input,
.outbox-filter-toolbar select {
  width: 100%;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.table-state,
.table-error,
.table-empty {
  color: var(--muted);
  font-size: 13px;
}

.table-state {
  display: none;
  margin: 0 0 10px;
}

.table-error {
  display: none;
  margin: 0 0 10px;
  color: #fecaca;
}

.table-empty {
  text-align: center;
}

.skeleton {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.16);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(248, 250, 252, 0.12),
    transparent
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-value {
  width: min(100%, 92px);
  height: 1em;
}

.skeleton-text {
  width: 100%;
  height: 13px;
}

tbody.is-loading td {
  height: 46px;
}

tbody.is-loading td:nth-child(odd) .skeleton-text {
  width: 72%;
}

tbody.is-loading td:nth-child(even) .skeleton-text {
  width: 88%;
}

.value-loading {
  min-height: 1em;
}

@keyframes skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

.template-create {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.schedule-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.88);
}

.schedule-date-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(180px, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.88);
}

.schedule-date-form-title {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
}

.schedule-date-form-title strong {
  font-size: 15px;
}

.schedule-date-form-title span {
  color: var(--muted);
  font-size: 13px;
}

.schedule-date-active {
  min-height: 38px;
  align-items: center;
}

.schedule-date-actions {
  display: flex;
  justify-content: flex-end;
}

.schedule-field {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.schedule-field input,
.schedule-field textarea {
  width: 100%;
}

.schedule-field legend {
  margin-bottom: 8px;
  padding: 0;
}

.schedule-field-wide,
.schedule-actions {
  grid-column: 1 / -1;
}

.schedule-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.schedule-actions {
  display: flex;
  justify-content: flex-end;
}

.schedule-modal-panel {
  width: min(920px, 100%);
}

.schedule-modal-content {
  overflow-y: auto;
  padding: 2px;
}

.template-create:has(.template-create-preview:not(:empty)) {
  justify-content: space-between;
}

.template-create-form {
  display: grid;
  flex: 0 1 620px;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
  width: 100%;
}

.template-create-fields {
  display: grid;
  grid-template-columns: minmax(140px, 0.85fr) minmax(180px, 1fr);
  gap: 10px;
}

.template-create textarea {
  width: 100%;
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  resize: none;
}

.template-create-meta,
.template-create-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.template-input,
.template-select,
.template-message-input {
  width: 100%;
}

.table-wrap input,
.table-wrap select {
  width: 100%;
  min-width: 120px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 10px;
}

.template-status {
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}

.template-actions {
  white-space: nowrap;
}

.template-actions button {
  margin: 0 6px 6px 0;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.char-count {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(156, 163, 175, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.char-count-warning {
  background: rgba(234, 179, 8, 0.16);
  color: var(--yellow);
}

.template-preview {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.template-create-preview {
  display: block;
  flex: 0 1 280px;
  min-height: 180px;
  max-width: 280px;
  min-width: 0;
  margin-top: 0;
  padding: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.template-preview-message {
  white-space: pre-wrap;
}

.template-preview-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.template-preview-metadata.is-multipart {
  color: var(--yellow);
}

.template-create-preview:empty {
  display: none;
}

body.modal-active {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.72);
}

.modal-backdrop.modal-open {
  display: grid;
}

.modal-panel {
  width: min(1120px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-header p {
  margin: 5px 0 0;
  font-size: 13px;
}

.modal-scroll {
  flex: 1;
  min-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.88);
}

.logs-modal-table {
  min-width: 980px;
}

.user-modal-panel {
  width: min(520px, 100%);
}

.user-create-form {
  display: grid;
  gap: 14px;
}

.user-create-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.user-create-form input,
.user-create-form select {
  width: 100%;
}

.user-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.password-modal-panel {
  width: min(520px, 100%);
}

.password-modal-form {
  display: grid;
  gap: 14px;
}

.password-modal-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.password-modal-form input {
  width: 100%;
}

.password-modal-error {
  display: none;
  margin-top: 0;
}

.password-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.modal-state {
  margin: 0;
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #111827;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text);
  display: none;
  max-width: 420px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  background: #0b1120;
}

.login-visual {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0) 72%, #0b1120 100%),
    url('/assets/sms-login.png') center / cover no-repeat;
}

.password-shell {
  grid-template-columns: minmax(420px, 0.92fr) minmax(0, 1.08fr);
}

.password-visual {
  min-height: 100vh;
  background-color: #0b1120;
  background-image:
    linear-gradient(270deg, rgba(11, 17, 32, 0) 70%, #0b1120 100%),
    radial-gradient(
      circle at center,
      rgba(56, 189, 248, 0.12),
      transparent 58%
    ),
    url('/assets/change-passport.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size:
    auto,
    auto,
    min(72%, 620px) auto;
}

.login-panel {
  display: grid;
  align-content: center;
  width: min(440px, 100%);
  min-height: 100vh;
  justify-self: center;
  padding: 48px 32px;
  background: transparent;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(31, 41, 55, 0.7);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
}

.login-form input:focus {
  outline: 2px solid rgba(56, 189, 248, 0.35);
  outline-offset: 2px;
}

.login-error {
  margin-top: 18px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.login-footnote {
  margin: 16px 0 0;
  font-size: 13px;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    place-items: center;
    padding: 24px;
  }

  .login-visual {
    display: none;
  }

  .password-visual {
    display: none;
  }

  .login-panel {
    min-height: auto;
    padding: 32px 0;
  }

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

  .app-navbar {
    align-items: stretch;
  }

  .app-navbar-brand {
    flex: 1;
  }

  .app-navbar-links {
    order: 3;
    flex: 0 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-top: 4px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-context {
    justify-content: flex-start;
  }

  .template-create {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
  }

  .schedule-settings {
    grid-template-columns: 1fr;
  }

  .schedule-date-form {
    grid-template-columns: 1fr;
  }

  .template-create:has(.template-create-preview:not(:empty)) {
    justify-content: flex-start;
  }

  .template-create-form {
    flex: 1 1 auto;
    margin-left: 0;
    max-width: none;
  }

  .template-create-preview {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }

  .template-create-fields {
    grid-template-columns: 1fr;
  }

  .reference-notes-toolbar {
    grid-template-columns: 1fr;
  }

  .commission-filter-toolbar {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .outbox-filter-toolbar {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-tools {
    width: 100%;
    justify-content: space-between;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .retry-sms-form,
  .retry-sms-preview-grid {
    grid-template-columns: 1fr;
  }

  .retry-sms-preview-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .retry-sms-actions {
    justify-content: stretch;
  }

  .retry-sms-actions button {
    flex: 1 1 auto;
  }
}

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

  .login-panel {
    width: 100%;
    padding: 24px 0;
  }

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

  .app-navbar {
    position: static;
  }

  .app-navbar-brand,
  .app-navbar-actions {
    width: 100%;
  }

  .app-navbar-actions {
    justify-content: space-between;
    padding-top: 4px;
    border-top: 1px solid rgba(55, 65, 81, 0.7);
  }

  .app-navbar-links {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .app-navbar-link {
    flex: 1 1 calc(50% - 4px);
    text-align: center;
  }

  .commission-filter-toolbar {
    grid-template-columns: 1fr;
  }

  .outbox-filter-toolbar {
    grid-template-columns: 1fr;
  }
}
