:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --border: #e6ebf2;
  --blue: #1a73e8;
  --blue-dark: #1558c7;
  --blue-soft: #eaf2ff;
  --green: #14965a;
  --green-soft: #e9f8f0;
  --cyan: #06a9c9;
  --cyan-soft: #e8faff;
  --amber: #f4b000;
  --amber-soft: #fff7e2;
  --red: #dc3e55;
  --red-soft: #fff0f3;
  --purple: #7b61ff;
  --purple-soft: #f1efff;
  --slate: #64748b;
  --slate-soft: #f1f5f9;
  --shadow: 0 10px 28px rgba(18, 38, 63, 0.06);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.bi { line-height: 1; }

.icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

button, input, select, textarea {
  font: inherit;
}

.bi { line-height: 1; }

.shield-icon .bi,
.school-icon .bi,
.service-icon .bi,
.admin-brand .bi,
.login-logo .bi,
.install-logo .bi {
  display: block;
}

.portal-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.topbar-left p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.shield-icon {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 900;
  background: var(--blue-soft);
}

.shield-icon i,
.shield-icon .icon-text {
  font-size: 14px;
}

.date-chip,
.admin-chip {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

.date-chip i,
.date-chip .icon-text {
  font-size: 14px;
}

.date-chip {
  color: #1d3151;
  background: #f3f7ff;
}

.admin-chip {
  background: var(--blue);
  color: #fff;
  letter-spacing: 0.02em;
}

.admin-chip.danger {
  background: var(--red);
}

.portal-page {
  width: min(100% - 60px, 1540px);
  margin: 30px auto 52px;
}

.hero-card {
  min-height: 116px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.hero-school {
  display: flex;
  align-items: center;
  gap: 16px;
}

.school-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: none;
}

.school-icon i,
.school-icon .icon-text {
  font-size: 30px;
}

.hero-school h2 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(25px, 3vw, 38px);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero-school p {
  margin: 8px 0 0;
  color: #424f63;
  font-size: 15px;
}

.hero-status {
  text-align: right;
  min-width: 160px;
}

.hero-status span,
.hero-status small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.hero-status strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  min-height: 126px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-card span,
.stat-card small {
  display: block;
  color: #4f5f73;
  font-size: 13px;
  font-weight: 600;
}

.stat-card strong {
  display: block;
  margin: 9px 0 5px;
  color: #111827;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card.green strong { color: var(--green); }
.stat-card.cyan strong { color: var(--cyan); }
.stat-card.amber strong { color: var(--amber); }
.stat-card.red strong { color: var(--red); }

.portal-tools {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.search-panel {
  position: relative;
}

.search-panel span {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.search-panel input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  outline: none;
  padding: 0 16px 0 42px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.search-panel input:focus {
  border-color: rgba(26, 115, 232, 0.45);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.10);
}

.category-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-btn {
  height: 48px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #4f5f73;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-btn .bi {
  margin-right: 6px;
  font-size: 15px;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 490px;
  gap: 24px;
  align-items: start;
}

.panel-card,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-title h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.panel-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-title > span {
  color: #334155;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}

.panel-title.compact {
  align-items: center;
  margin-bottom: 14px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-card {
  min-height: 178px;
  display: flex;
  gap: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 26px rgba(18, 38, 63, 0.04);
  transition: 0.18s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(26, 115, 232, 0.32);
  box-shadow: 0 16px 34px rgba(18, 38, 63, 0.08);
}

.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--blue-soft);
}

.service-icon i,
.service-icon .icon-text {
  font-size: 22px;
}

.service-body {
  flex: 1;
  min-width: 0;
}

.service-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.service-card h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.service-topline span {
  flex: none;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
}

.service-card p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-card small {
  color: var(--blue);
  font-weight: 900;
}

.color-green .service-icon, .color-green .service-topline span { background: var(--green-soft); color: var(--green); }
.color-cyan .service-icon, .color-cyan .service-topline span { background: var(--cyan-soft); color: var(--cyan); }
.color-amber .service-icon, .color-amber .service-topline span { background: var(--amber-soft); color: var(--amber); }
.color-red .service-icon, .color-red .service-topline span { background: var(--red-soft); color: var(--red); }
.color-purple .service-icon, .color-purple .service-topline span { background: var(--purple-soft); color: var(--purple); }
.color-slate .service-icon, .color-slate .service-topline span { background: var(--slate-soft); color: var(--slate); }

.side-column {
  display: grid;
  gap: 24px;
}

.alert-list,
.notice-list {
  display: grid;
  gap: 0;
}

.alert-row,
.notice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.alert-row:last-child,
.notice-row:last-child {
  border-bottom: 0;
}

.alert-row strong,
.notice-row strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.alert-row span,
.notice-row span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.alert-row-icon,
.alert-row-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
}

.alert-row-icon i,
.alert-row-icon .icon-text {
  font-size: 13px;
}

.alert-row .alert-row-icon {
  margin-top: 0;
  color: #fff;
  font-size: 12px;
}

.notice-row small {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  color: #fff;
  background: var(--slate);
  font-weight: 900;
}

.progress-block {
  display: grid;
  gap: 8px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 800;
}

.progress-bar {
  height: 9px;
  background: #e9eef5;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar i {
  display: block;
  height: 100%;
  background: #168452;
}

.small-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.empty-state {
  display: none;
  padding: 34px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: var(--surface-soft);
}

/* Admin */
.admin-body {
  background: var(--bg);
}

.admin-layout {
  width: min(100% - 42px, 1500px);
  margin: 22px auto 48px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 94px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-brand span {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
}

.admin-brand span i,
.admin-brand span .icon-text {
  font-size: 18px;
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar nav a {
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #435067;
  font-weight: 800;
  border-radius: 14px;
  transition: 0.18s ease;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: var(--blue);
  color: #fff;
}

.admin-content {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.admin-page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.admin-page-title h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.admin-page-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.admin-grid-2 {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 18px;
  align-items: start;
}

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

.form-stack label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 800;
  font-size: 14px;
}

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

.field-help {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.5;
}

.field-help code {
  padding: 2px 6px;
  border-radius: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--blue);
}

.table-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  margin-right: 5px;
}

.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus {
  border-color: rgba(26, 115, 232, 0.45);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.10);
}

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

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #344054;
  font-weight: 800;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: auto;
}

.wide-form { max-width: 860px; }
.narrow-form { max-width: 520px; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.compact-table {
  max-height: 720px;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.data-table th,
.data-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.data-table th {
  color: #475467;
  background: #f8fafc;
  font-weight: 900;
}

.data-table small {
  color: var(--muted);
  word-break: break-all;
}

.table-icon {
  margin-right: 6px;
}

.icon-preview-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
}

.icon-preview-box code {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px;
  color: #334155;
}


.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.ok { background: var(--green-soft); color: var(--green); }
.status-pill.blue { background: var(--blue-soft); color: var(--blue); }
.status-pill.muted { background: var(--slate-soft); color: var(--slate); }

.actions-cell {
  display: flex;
  gap: 7px;
  align-items: center;
}

.actions-cell form {
  display: inline;
}

.btn {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
}

.btn i,
.btn .icon-text {
  line-height: 1;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(26, 115, 232, 0.20);
}

.btn-primary:hover { background: var(--blue-dark); }
.btn-light { background: #f3f6fb; color: #243044; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { min-height: 34px; padding: 7px 10px; border-radius: 11px; font-size: 12px; }

.alert {
  padding: 13px 15px;
  border-radius: 14px;
  font-weight: 800;
}

.alert-success {
  color: #11633f;
  background: var(--green-soft);
  border: 1px solid rgba(20, 150, 90, 0.18);
}

.alert-danger {
  color: #9f2336;
  background: var(--red-soft);
  border: 1px solid rgba(220, 62, 85, 0.18);
}

.text-danger {
  color: var(--red) !important;
  font-weight: 800;
}

/* Login / Install */
.login-body,
.install-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(26, 115, 232, 0.12), transparent 36rem),
    var(--bg);
}

.login-card,
.install-card {
  width: min(100%, 460px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(18, 38, 63, 0.12);
}

.install-card { width: min(100%, 560px); }

.login-logo,
.install-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 900;
  margin-bottom: 16px;
}

.login-logo i,
.login-logo .icon-text,
.install-logo i,
.install-logo .icon-text {
  font-size: 28px;
}

.login-card h1,
.install-card h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.login-card p,
.install-card p {
  color: var(--muted);
  line-height: 1.7;
}

.login-help {
  margin-top: 16px;
  padding: 13px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.install-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

@media (max-width: 1180px) {
  .stat-grid,
  .admin-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-grid,
  .admin-grid-2 {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .portal-topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-right {
    width: 100%;
    overflow-x: auto;
  }

  .portal-page,
  .admin-layout {
    width: min(100% - 24px, 1540px);
    margin-top: 16px;
  }

  .hero-card,
  .hero-school,
  .admin-page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-status {
    text-align: left;
  }

  .stat-grid,
  .admin-stat-grid,
  .portal-tools,
  .service-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

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

  .admin-sidebar {
    position: static;
  }

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

@media (max-width: 520px) {
  .service-card {
    flex-direction: column;
  }

  .admin-sidebar nav {
    grid-template-columns: 1fr;
  }
}

/* Icon picker: modal/grid selector */
.form-row.align-start {
  align-items: start;
}

.field-group {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 800;
}

.field-label {
  display: inline-block;
  color: #344054;
  font-weight: 900;
}

.icon-picker,
.icon-picker * {
  box-sizing: border-box;
}

.icon-picker {
  display: block;
  width: 100%;
}

.icon-picker-compact {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.icon-picker-current {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.icon-picker-current-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  flex: none;
}

.icon-picker-current-icon i {
  font-size: 21px;
  line-height: 1;
}

.icon-picker-current-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.icon-picker-current-meta strong {
  font-size: 13px;
  line-height: 1.2;
  color: #1f2937;
  font-weight: 900;
}

.icon-picker-current-meta code {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 8px;
}

.icon-picker-open {
  white-space: nowrap;
  min-height: 42px;
}

.icon-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.icon-picker-modal.is-open {
  display: flex;
}

.icon-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.icon-picker-dialog {
  position: relative;
  width: min(880px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  padding: 20px;
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(226, 232, 240, 0.95);
  overflow: hidden;
}

.icon-picker-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.icon-picker-dialog-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.icon-picker-dialog-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.icon-picker-close {
  width: 40px;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.15s ease;
}

.icon-picker-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.icon-picker-search-wrap {
  position: relative;
}

.icon-picker-search-wrap i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.icon-picker-search-wrap input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding-left: 44px;
  outline: none;
  font-size: 14px;
}

.icon-picker-search-wrap input:focus {
  border-color: rgba(26, 115, 232, 0.45);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.10);
  background: #fff;
}

.icon-picker-groups {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 14px;
}

.icon-picker-group + .icon-picker-group {
  margin-top: 18px;
}

.icon-picker-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  font-weight: 900;
  margin: 2px 4px 10px;
}

.icon-picker-group-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.75;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 10px;
}

.icon-option {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 18px;
  min-height: 92px;
  padding: 10px 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: #334155;
  cursor: pointer;
  transition: 0.16s ease;
  font-family: inherit;
}

.icon-option i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 20px;
  line-height: 1;
}

.icon-option span {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.icon-option:hover {
  border-color: rgba(26, 115, 232, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.icon-option.active {
  border-color: rgba(26, 115, 232, 0.75);
  background: #eff6ff;
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.icon-option.active i {
  background: #fff;
}

.icon-option.is-hidden,
.icon-picker-group.is-hidden {
  display: none;
}

body.icon-picker-lock {
  overflow: hidden;
}

@media (max-width: 680px) {
  .icon-picker-compact {
    grid-template-columns: 1fr;
  }

  .icon-picker-open {
    width: 100%;
    justify-content: center;
  }

  .icon-picker-modal {
    padding: 10px;
  }

  .icon-picker-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 14px;
    border-radius: 22px;
  }

  .icon-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }
}

/* HOTFIX 20260520: prevent selected icon preview and button from overlapping in narrow admin form columns */
.icon-picker-compact {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.icon-picker-current {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  padding: 0 2px !important;
}

.icon-picker-current-meta {
  min-width: 0 !important;
  overflow: hidden !important;
}

.icon-picker-current-meta code {
  max-width: 100% !important;
  min-width: 0 !important;
  display: inline-block !important;
}

.icon-picker-open {
  width: 100% !important;
  min-width: 0 !important;
  justify-content: center !important;
  position: static !important;
  transform: none !important;
  margin: 0 !important;
}

.icon-picker-open i {
  flex: none !important;
}

/* Simple Portal mode: remove dashboard/stat layout and show portal links full width */
.portal-simple .portal-page {
  margin-top: 18px;
}

.portal-simple .portal-tools {
  margin-top: 0;
}

.portal-simple .content-grid {
  grid-template-columns: 1fr;
}

.portal-simple .main-column {
  min-width: 0;
}

.portal-simple .panel-card {
  width: 100%;
}

.portal-simple .panel-title {
  align-items: flex-start;
}

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

@media (max-width: 1280px) {
  .portal-simple .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .portal-simple .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .portal-simple .service-grid {
    grid-template-columns: 1fr;
  }
}


/* UI refresh 20260520: cleaner portal layout, compact professional cards */
.portal-topbar {
  padding: 0 22px;
}

.portal-page {
  width: min(100% - 40px, 1320px);
  margin: 22px auto 42px;
}

.portal-simple .panel-card {
  padding: 20px;
  border-radius: 22px;
}

.portal-simple .panel-title {
  margin-bottom: 16px;
}

.portal-simple .panel-title h3 {
  font-size: 18px;
}

.portal-simple .panel-title p {
  font-size: 13px;
}

.portal-tools {
  grid-template-columns: 300px 1fr;
  align-items: center;
  gap: 12px;
}

.search-panel input {
  height: 50px;
  border-radius: 18px;
  font-size: 15px;
}

.filter-btn {
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
}

.portal-simple .service-grid {
  gap: 14px;
}

.service-card {
  min-height: 0;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 18px;
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.service-icon i,
.service-icon .icon-text {
  font-size: 22px;
}

.service-body {
  display: grid;
  gap: 6px;
}

.service-topline {
  gap: 10px;
}

.service-card h4 {
  font-size: 17px;
  line-height: 1.35;
}

.service-topline span {
  max-width: 96px;
  padding: 5px 8px;
  font-size: 11px;
}

.service-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
}

.service-card small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .portal-topbar {
    padding: 0 18px;
  }

  .portal-page {
    width: min(100% - 24px, 1320px);
  }

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

@media (max-width: 860px) {
  .portal-topbar {
    padding: 14px;
    gap: 14px;
  }

  .topbar-left {
    align-items: flex-start;
    width: 100%;
  }

  .topbar-left h1 {
    font-size: 18px;
    line-height: 1.2;
  }

  .topbar-left p {
    font-size: 12px;
    line-height: 1.5;
  }

  .topbar-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    overflow: visible;
  }

  .date-chip,
  .admin-chip {
    height: 42px;
    justify-content: center;
  }

  .portal-page {
    margin-top: 14px;
    margin-bottom: 28px;
  }

  .portal-simple .panel-card {
    padding: 18px;
    border-radius: 20px;
  }

  .portal-simple .service-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .service-card {
    padding: 14px;
    gap: 12px;
  }

  .service-icon {
    width: 46px;
    height: 46px;
  }

  .service-card h4 {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .portal-page {
    width: calc(100% - 16px);
  }

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

  .date-chip,
  .admin-chip {
    width: 100%;
  }

  .search-panel input {
    height: 48px;
    font-size: 16px;
  }

  .category-filter {
    padding-bottom: 2px;
  }

  .filter-btn {
    height: 42px;
    padding: 0 14px;
    font-size: 14px;
  }

  .portal-simple .panel-title h3 {
    font-size: 17px;
  }

  .service-card {
    padding: 14px;
    gap: 12px;
  }

  .service-card p {
    font-size: 12px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  .service-topline span {
    max-width: 86px;
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  .service-card {
    flex-direction: row;
  }
}


/* Color theme refresh 20260520: official / professional government portal */
:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --text: #162338;
  --muted: #607087;
  --border: #d9e3ef;
  --blue: #1f6fe5;
  --blue-dark: #165ac0;
  --blue-soft: #e9f2ff;
  --navy: #17345f;
}

body.portal-simple {
  background:
    linear-gradient(180deg, #f4f7fb 0%, #eef3f9 100%);
}

.portal-topbar {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,251,255,0.94));
  border-bottom: 1px solid #d8e2ef;
  box-shadow: 0 8px 24px rgba(20, 49, 92, 0.05);
}

.shield-icon {
  background: linear-gradient(135deg, #eaf3ff, #d8e8ff);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 229, 0.12);
}

.topbar-left h1 {
  color: var(--navy);
}

.date-chip {
  background: linear-gradient(180deg, #f8fbff, #edf4ff);
  border: 1px solid #d7e4f7;
  color: #18365f;
}

.admin-chip {
  background: linear-gradient(135deg, #1f6fe5, #165ac0);
  box-shadow: 0 10px 22px rgba(31, 111, 229, 0.18);
}

.search-panel input,
.filter-btn,
.portal-simple .panel-card,
.service-card {
  border-color: #dbe4ef;
}

.search-panel input {
  background: linear-gradient(180deg, #ffffff, #f9fbfe);
}

.filter-btn {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: #42546d;
}

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(135deg, #1f6fe5, #2d7cf0);
  border-color: #1f6fe5;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 111, 229, 0.20);
}

.portal-simple .panel-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 14px 32px rgba(19, 44, 80, 0.06);
}

.portal-simple .panel-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1f6fe5, #79aefc);
}

.portal-simple .panel-title h3 {
  color: var(--navy);
}

.portal-simple .panel-title p {
  color: #748297;
}

.service-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 12px 26px rgba(15, 35, 64, 0.06);
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--blue);
}

.service-card:hover {
  border-color: rgba(31, 111, 229, 0.32);
  box-shadow: 0 18px 34px rgba(19, 44, 80, 0.10);
}

.service-card h4 {
  color: var(--navy);
}

.service-card p {
  color: #607087;
}

.service-card small {
  color: var(--blue);
}

.service-icon {
  background: linear-gradient(135deg, #eff5ff, #e2eeff);
  box-shadow: inset 0 0 0 1px rgba(31,111,229,0.08);
}

.service-topline span {
  box-shadow: inset 0 0 0 1px rgba(31,111,229,0.08);
}

.color-blue .service-card::before,
.service-card.color-blue::before { background: #1f6fe5; }
.service-card.color-green::before { background: #169b5c; }
.service-card.color-cyan::before { background: #09a7c5; }
.service-card.color-amber::before { background: #e6a300; }
.service-card.color-red::before { background: #da4457; }
.service-card.color-purple::before { background: #7b61ff; }
.service-card.color-slate::before { background: #64748b; }

.empty-state {
  background: linear-gradient(180deg, #fbfdff, #f4f8fd);
  color: #66778d;
}

/* subtle admin polish to match portal */
.admin-sidebar,
.admin-page-title,
.admin-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-color: #dbe4ef;
  box-shadow: 0 14px 32px rgba(19, 44, 80, 0.06);
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active,
.btn-primary {
  background: linear-gradient(135deg, #1f6fe5, #165ac0);
}

@media (max-width: 640px) {
  .portal-simple .panel-card::before {
    height: 3px;
  }

  .service-card::before {
    width: 3px;
  }
}


/* Mobile compact cards + modern government blue refresh 20260520 */
body.portal-simple {
  background:
    radial-gradient(circle at top left, rgba(63, 131, 248, 0.07), transparent 28rem),
    linear-gradient(180deg, #f5f8fc 0%, #edf3fa 100%);
}

.portal-topbar {
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(245,249,255,0.96));
}

.topbar-left h1 {
  color: #1a2f52;
}

.topbar-left p {
  color: #728197;
}

.search-panel input {
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(20, 49, 92, 0.05);
}

.category-filter {
  scrollbar-width: thin;
  scrollbar-color: #8ea7cb #dfe8f4;
}

.filter-btn {
  border-color: #d7e2ef;
  color: #40536e;
}

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(135deg, #2376ea, #3b8cff);
}

.portal-simple .panel-card {
  border-radius: 22px;
}

.portal-simple .panel-card::before {
  background: linear-gradient(90deg, #2376ea, #87b8ff);
}

.service-card {
  border-radius: 18px;
}

.service-card h4 {
  letter-spacing: -0.01em;
}

.service-topline span {
  color: #4c64a2;
  background: #eef3ff;
}

.service-card small {
  color: #2376ea;
}

@media (max-width: 640px) {
  .topbar-left h1 {
    font-size: 17px;
  }

  .topbar-left p {
    font-size: 12px;
  }

  .portal-tools {
    gap: 10px;
  }

  .search-panel input {
    height: 46px;
    padding-left: 40px;
    font-size: 15px;
  }

  .filter-btn {
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .portal-simple .panel-card {
    padding: 16px;
    border-radius: 18px;
  }

  .portal-simple .panel-title {
    margin-bottom: 12px;
  }

  .portal-simple .panel-title h3 {
    font-size: 16px;
  }

  .portal-simple .panel-title p {
    font-size: 12px;
  }

  .portal-simple .service-grid {
    gap: 10px;
  }

  .service-card {
    min-height: auto !important;
    padding: 12px 13px 12px 16px;
    gap: 12px;
    align-items: flex-start;
    box-shadow: 0 10px 18px rgba(15, 35, 64, 0.05);
  }

  .service-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin-top: 2px;
    flex: none;
  }

  .service-icon i,
  .service-icon .icon-text {
    font-size: 20px;
  }

  .service-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title tag"
      "meta meta";
    align-items: center;
    column-gap: 8px;
    row-gap: 4px;
    width: 100%;
  }

  .service-topline {
    display: contents;
  }

  .service-card h4 {
    grid-area: title;
    font-size: 15px;
    line-height: 1.35;
    margin: 0;
  }

  .service-topline span {
    grid-area: tag;
    max-width: none;
    white-space: nowrap;
    padding: 4px 7px;
    font-size: 10px;
  }

  .service-card p {
    display: none !important;
  }

  .service-card small {
    grid-area: meta;
    margin-top: 0;
    font-size: 12px;
    line-height: 1.3;
  }
}


/* Final tune 20260520: smaller mobile header, 2-column cards on large phones, stronger category color accents */
.service-card::before {
  width: 6px;
  border-radius: 0 8px 8px 0;
}

.service-card.color-blue::before { background: linear-gradient(180deg, #2b7fff, #1f6fe5); }
.service-card.color-green::before { background: linear-gradient(180deg, #20b36f, #14965a); }
.service-card.color-cyan::before { background: linear-gradient(180deg, #17c2df, #06a9c9); }
.service-card.color-amber::before { background: linear-gradient(180deg, #f7c443, #e6a300); }
.service-card.color-red::before { background: linear-gradient(180deg, #ef6478, #da4457); }
.service-card.color-purple::before { background: linear-gradient(180deg, #9a7bff, #7b61ff); }
.service-card.color-slate::before { background: linear-gradient(180deg, #8a98ad, #64748b); }

.service-card.color-blue .service-topline span { color: #245fbd; background: #e9f2ff; }
.service-card.color-green .service-topline span { color: #11814c; background: #e8f8ef; }
.service-card.color-cyan .service-topline span { color: #0a91ab; background: #e8fbff; }
.service-card.color-amber .service-topline span { color: #b67c00; background: #fff5da; }
.service-card.color-red .service-topline span { color: #c63a4d; background: #fff0f3; }
.service-card.color-purple .service-topline span { color: #6d53f1; background: #f2efff; }
.service-card.color-slate .service-topline span { color: #526174; background: #eff4f8; }

.service-card.color-blue .service-icon { background: linear-gradient(135deg, #eff5ff, #dfeeff); }
.service-card.color-green .service-icon { background: linear-gradient(135deg, #ecfbf3, #ddf5e7); }
.service-card.color-cyan .service-icon { background: linear-gradient(135deg, #ebfcff, #dcf7fc); }
.service-card.color-amber .service-icon { background: linear-gradient(135deg, #fff8e8, #ffefc9); }
.service-card.color-red .service-icon { background: linear-gradient(135deg, #fff1f4, #ffe2e8); }
.service-card.color-purple .service-icon { background: linear-gradient(135deg, #f4f1ff, #ebe5ff); }
.service-card.color-slate .service-icon { background: linear-gradient(135deg, #f4f7fa, #e8eef4); }

@media (max-width: 640px) {
  .portal-topbar {
    padding: 10px 12px;
    gap: 10px;
  }

  .topbar-left,
  .topbar-right {
    gap: 8px;
  }

  .shield-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }

  .shield-icon i,
  .shield-icon .icon-text {
    font-size: 12px;
  }

  .topbar-left h1 {
    font-size: 16px;
    line-height: 1.15;
  }

  .topbar-left p {
    font-size: 11px;
    line-height: 1.35;
    margin-top: 1px;
  }

  .date-chip,
  .admin-chip {
    height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

  .date-chip i,
  .date-chip .icon-text {
    font-size: 13px;
  }

  .portal-page {
    margin-top: 10px;
  }

  .portal-simple .service-grid {
    grid-template-columns: 1fr;
  }
}

/* large phones / small tablets: 2 columns */
@media (min-width: 560px) and (max-width: 860px) {
  .portal-simple .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }

  .service-card {
    padding: 13px 14px 13px 16px;
  }

  .service-card h4 {
    font-size: 15px;
  }

  .service-card p {
    display: none !important;
  }
}

/* very small phones keep single column and compact spacing */
@media (max-width: 559px) {
  .service-card {
    padding: 11px 12px 11px 15px;
  }
}


/* Category filter polish 20260520: slightly larger buttons, 10px rounded corners, more spacing before main menu */
.portal-tools {
  margin-bottom: 26px;
}

.category-filter {
  gap: 10px;
  padding-bottom: 6px;
}

.filter-btn {
  height: 48px;
  padding: 0 18px;
  border-radius: 10px;
}

.filter-btn .bi {
  margin-right: 4px;
}

@media (max-width: 860px) {
  .portal-tools {
    margin-bottom: 22px;
  }

  .category-filter {
    gap: 9px;
    padding-bottom: 8px;
  }

  .filter-btn {
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .portal-tools {
    margin-bottom: 20px;
  }

  .filter-btn {
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 13px;
  }
}


/* FINAL 20260520: category buttons + compact admin position */
.topbar-title-box {
  min-width: 0;
  width: 100%;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-title-row h1 {
  min-width: 0;
}

.admin-chip-small {
  width: auto !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  border-radius: 10px !important;
  flex: none;
  box-shadow: 0 6px 14px rgba(31, 111, 229, 0.16);
}

.portal-tools {
  margin-bottom: 34px !important;
}

.category-filter {
  gap: 12px !important;
  padding-bottom: 10px !important;
}

.filter-btn {
  height: 50px !important;
  padding: 0 20px !important;
  border-radius: 10px !important;
}

.filter-btn .bi,
.filter-btn .icon-text {
  font-size: 15px;
}

@media (max-width: 860px) {
  .portal-topbar {
    padding: 10px 12px !important;
  }

  .topbar-left {
    width: 100%;
    align-items: flex-start;
  }

  .topbar-title-row {
    width: 100%;
  }

  .topbar-title-row h1 {
    font-size: 16px !important;
    line-height: 1.15 !important;
  }

  .admin-chip-small {
    height: 26px !important;
    min-height: 26px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    border-radius: 9px !important;
  }

  .topbar-right {
    width: 100%;
    display: block !important;
    overflow: visible !important;
  }

  .date-chip {
    width: 100%;
    height: 36px !important;
    justify-content: center;
    font-size: 12px !important;
  }

  .portal-tools {
    margin-bottom: 32px !important;
  }

  .category-filter {
    gap: 11px !important;
    padding-bottom: 10px !important;
  }

  .filter-btn {
    height: 48px !important;
    padding: 0 18px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 640px) {
  .portal-tools {
    margin-bottom: 30px !important;
  }

  .category-filter {
    gap: 10px !important;
  }

  .filter-btn {
    height: 46px !important;
    padding: 0 17px !important;
  }
}

/* Production plus: logo, sort order, color swatches, backup page */
.brand-logo {
  overflow: hidden;
}

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

.logo-setting-box {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.logo-preview {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #2376ea;
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(35, 118, 234, 0.12);
  overflow: hidden;
}

.logo-preview i {
  font-size: 32px;
}

.logo-setting-content {
  display: grid;
  gap: 8px;
}

.form-help {
  margin: -2px 0 0;
  color: #738198;
  font-size: 13px;
}

.inline-check {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: #40536e;
  font-weight: 700;
}

.inline-check input {
  width: auto !important;
  height: auto !important;
}

.sort-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  color: #526174;
  background: #f4f8fd;
  border: 1px solid #dbe4ef;
  font-size: 13px;
  font-weight: 700;
}

.sort-save-form {
  display: flex;
  justify-content: flex-end;
  margin: -44px 0 12px;
}

.drag-col {
  width: 34px;
}

.drag-handle {
  width: 34px;
  color: #8ea2bb;
  cursor: grab;
  text-align: center;
  vertical-align: middle;
}

tr.is-dragging {
  opacity: .55;
  background: #edf5ff;
}

tr[draggable="true"] {
  transition: background .15s ease;
}

tr[draggable="true"]:hover {
  background: #f8fbff;
}

.color-swatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}

.color-swatch {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  width: auto !important;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #dbe4ef;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  color: #40536e;
  font-size: 13px;
}

.color-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-swatch span {
  width: 18px;
  height: 18px;
  border-radius: 7px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.color-swatch input:checked + span {
  outline: 3px solid rgba(35, 118, 234, 0.16);
}

.color-swatch:has(input:checked) {
  border-color: rgba(35, 118, 234, 0.45);
  box-shadow: 0 8px 18px rgba(35, 118, 234, 0.08);
}

.color-swatch.color-blue span { background: #2376ea; }
.color-swatch.color-green span { background: #169b5c; }
.color-swatch.color-cyan span { background: #09a7c5; }
.color-swatch.color-purple span { background: #7b61ff; }
.color-swatch.color-amber span { background: #e6a300; }
.color-swatch.color-red span { background: #da4457; }
.color-swatch.color-slate span { background: #64748b; }

.alert-warning {
  padding: 12px 14px;
  border-radius: 14px;
  color: #825900;
  background: #fff7df;
  border: 1px solid #ffe7a6;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .logo-setting-box {
    grid-template-columns: 1fr;
  }

  .sort-save-form {
    justify-content: flex-start;
    margin: 0 0 12px;
  }
}
