.template1-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
  padding: 14px;
  border-radius: 22px;
  color: #0f172a;
  background: linear-gradient(180deg, #f8fafc 0%, #f4f7fe 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.template1-app__topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 0;
  backdrop-filter: blur(6px);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(248, 250, 252, 0.75) 100%);
}

.template1-app__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.template1-app__badge {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0c4a9e;
  background: #dbeafe;
  border: 1px solid rgba(37, 99, 235, 0.16);
  cursor: pointer;
  border: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.template1-app__badge:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.template1-app__badge:hover {
  box-shadow: 0 1px 8px rgba(37, 99, 235, 0.2);
}

.template1-app__badge:active {
  transform: scale(0.98);
}

.template1-app__badge .anticon {
  font-size: 18px;
}

.template1-app__brand h1 {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
}

.template1-app__brand p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.template1-app__topbar-action {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: #0c4a9e;
  background: #dbeafe;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.template1-app__topbar-action:hover {
  box-shadow: 0 1px 8px rgba(37, 99, 235, 0.2);
}

.template1-app__topbar-action:active {
  transform: scale(0.98);
}

.template1-app__topbar-action .anticon {
  font-size: 16px;
}

.template1-app__settings-dropdown {
  position: absolute;
  top: 58px;
  right: 14px;
  z-index: 30;
  min-width: 208px;
  width: min(248px, calc(100% - 28px));
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: grid;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.template1-app__main {
  min-height: 0;
  display: flex;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.template1-app__scroll-area {
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding-right: 2px;
  overscroll-behavior: contain;
  scroll-behavior: auto;
}

.template1-app__screen-transition {
  display: grid;
  gap: 10px;
  min-height: 100%;
}

.template1-app__section-head h2 {
  margin: 0;
  font-size: 20px;
}

.template1-app__section-head p {
  margin: 4px 0 0;
  color: #64748b;
}

.template1-app__chips-text {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.template1-app__section-description {
  margin: 4px 0 12px;
  color: #64748b;
  font-size: 12px;
}

.template1-app__section-head--detail {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.template1-app__section-head--detail small {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
}

.template1-app__home-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.template1-app__home-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 96px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.88) 100%);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.template1-app__home-item div {
  display: grid;
  gap: 4px;
}

.template1-app__home-item strong {
  font-size: 16px;
}

.template1-app__home-item span,
.template1-app__home-item small {
  color: #475569;
}

.template1-app__home-item small {
  font-size: 11px;
  color: #94a3b8;
}

.template1-app__detail-shell {
  display: grid;
  min-height: 0;
  height: 100%;
  align-content: start;
}

.template1-app__cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 0;
  align-content: start;
}

.template1-app__settings-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  align-content: start;
}

.template1-app__settings-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #dbe4f2;
  color: inherit;
  text-align: left;
  background: #ffffff;
  cursor: pointer;
}

.template1-app__settings-item--danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff1f2 0%, #fff 100%);
}

.template1-app__settings-item-content {
  display: grid;
  gap: 4px;
}

.template1-app__settings-item-content strong {
  display: block;
  font-size: 14px;
}

.template1-app__settings-item-content span {
  color: #475569;
  font-size: 11px;
  line-height: 1.35;
}

.template1-app__settings-item-description--muted {
  color: #b91c1c;
}

.template1-app__settings-item-icon--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.template1-app__card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 84px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #dbe4f2;
  color: inherit;
  text-align: left;
  background: #ffffff;
  cursor: pointer;
}

.template1-app__card div strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.template1-app__card div span {
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.template1-app__card-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: #e2e8f0;
}

.template1-app__card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #3b82f6;
  white-space: nowrap;
  user-select: none;
}

.template1-app__title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 4px 0 8px;
}

.template1-app__title-row h2 {
  margin: 0;
  font-size: 20px;
}

@media (max-width: 1120px) {
  .template1-app__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .template1-app {
    padding: 10px;
    border-radius: 16px;
    gap: 9px;
  }

  .template1-app__brand h1 {
    font-size: 16px;
  }

  .template1-app__brand p {
    font-size: 11px;
  }

  .template1-app__cards,
  .template1-app__home-list {
    grid-template-columns: 1fr;
  }

  .template1-app__home-item {
    grid-template-columns: 1fr;
  }

  .template1-app__section-head--detail {
    flex-direction: column;
  }

  .template1-app__card {
    grid-template-columns: auto 1fr;
  }

  .template1-app__card-action {
    grid-column: 1 / -1;
  }
}
