:root {
  --primary: #0057FF;
  --primary-600: #0047E6;
  --primary-700: #0039C2;
  --primary-50: #EEF4FF;
  --primary-100: #DCE8FF;
  --primary-200: #BDD3FF;
  --sky: #2A9BFF;

  --navy: #0A1433;
  --ink: #111B3A;
  --text: #2A3555;
  --muted: #5E6A88;
  --muted-2: #8A94AD;
  --line: #E6EBF4;
  --line-2: #EEF2F8;
  --bg: #F6F8FC;
  --bg-2: #F1F5FB;
  --white: #FFFFFF;

  --green: #12B76A;
  --green-600: #0E9F5C;
  --green-50: #E9F9F0;
  --orange: #FF7A1A;
  --orange-50: #FFF2E8;
  --purple: #7A5AF8;
  --purple-50: #F2EEFF;
  --pink: #F23C7A;
  --pink-50: #FFEEF3;
  --yellow: #FFB020;
  --yellow-50: #FFF7E6;
  --red: #F04438;
  --red-50: #FEF1F0;
  --gray-50: #F2F4F8;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-xs: 0 1px 2px rgba(16, 30, 70, .05);
  --shadow-sm: 0 1px 2px rgba(16, 30, 70, .04), 0 4px 14px rgba(16, 30, 70, .05);
  --shadow: 0 2px 6px rgba(16, 30, 70, .04), 0 14px 36px rgba(16, 30, 70, .07);
  --shadow-lg: 0 10px 30px rgba(16, 30, 70, .08), 0 30px 80px rgba(16, 30, 70, .12);
  --glow: 0 10px 26px rgba(0, 87, 255, .28), 0 2px 8px rgba(0, 87, 255, .2);
  --ring: 0 0 0 4px rgba(0, 87, 255, .14);

  --grad-primary: linear-gradient(100deg, #1A8BFF 0%, #0A63FF 45%, #0041F0 100%);
  --font: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--primary-100); color: var(--navy); }
:focus-visible { outline: 3px solid rgba(0, 87, 255, .35); outline-offset: 2px; border-radius: 6px; }

.ic { width: 18px; height: 18px; flex: none; stroke-width: 2; }
i.ic { display: inline-block; }
.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.hl { color: var(--primary); }

.btn {
  --btn-bg: var(--white);
  --btn-fg: var(--ink);
  --btn-bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: 14px; border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, color .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: #fff; --btn-bd: transparent; background: var(--grad-primary); box-shadow: var(--glow); }
.btn-primary:hover { box-shadow: 0 14px 32px rgba(0, 87, 255, .36), 0 2px 8px rgba(0, 87, 255, .2); }
.btn-soft { --btn-bg: var(--primary-50); --btn-fg: var(--primary-700); --btn-bd: transparent; }
.btn-soft:hover { --btn-bg: var(--primary-100); box-shadow: none; }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text); }
.btn-ghost:hover { --btn-bg: var(--bg); box-shadow: none; }
.btn-dark { --btn-bg: var(--navy); --btn-fg: #fff; --btn-bd: transparent; }
.btn-green { --btn-bg: #1FAF5A; --btn-fg: #fff; --btn-bd: transparent; }
.btn-green:hover { --btn-bg: #179B4E; }
.btn-danger { --btn-bg: var(--red); --btn-fg: #fff; --btn-bd: transparent; }
.btn-danger-soft { --btn-bg: var(--red-50); --btn-fg: #C4271C; --btn-bd: transparent; }
.btn-sm { height: 38px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; }
.btn-xs { height: 32px; padding: 0 11px; border-radius: 9px; font-size: 13px; gap: 6px; }
.btn-xs .ic { width: 15px; height: 15px; }
.btn-lg { height: 54px; padding: 0 26px; border-radius: 16px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 46px; padding: 0; }
.btn-icon.btn-sm { width: 38px; }
.btn-icon.btn-xs { width: 32px; }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn.is-loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.label .opt { font-weight: 500; color: var(--muted-2); font-size: 12.5px; }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 15px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--white);
  font-size: 15px; color: var(--ink);
  transition: border-color .18s, box-shadow .18s, background .18s;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .select:hover, .textarea:hover { border-color: #D5DDEB; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.textarea { height: auto; min-height: 130px; padding: 13px 15px; resize: vertical; line-height: 1.6; }
.select {
  padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235E6A88' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select:disabled { background-color: var(--bg); color: var(--muted-2); cursor: not-allowed; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 56px; }
.input-wrap .unit {
  position: absolute; right: 6px; top: 6px; bottom: 6px; min-width: 40px; padding: 0 10px;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--bg); color: var(--muted); font-weight: 600; font-size: 13px; pointer-events: none;
}
.input-wrap .lead-ic { position: absolute; left: 14px; color: var(--muted-2); pointer-events: none; }
.input-wrap .lead-ic + .input { padding-left: 44px; }
.input-wrap .eye { position: absolute; right: 8px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.input-wrap .eye:hover { background: var(--bg); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.err { font-size: 12.5px; color: #D92D20; font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.err:empty { display: none; }
.has-error .input, .has-error .select, .has-error .textarea { border-color: #F97066; background: #FFFBFA; }
.has-error .input:focus { box-shadow: 0 0 0 4px rgba(240, 68, 56, .12); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text); line-height: 1.45; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 22px; height: 22px; flex: none; border-radius: 7px; border: 1.5px solid #CBD4E4; background: #fff;
  display: grid; place-items: center; transition: all .18s var(--ease); margin-top: -1px;
}
.check .box::after {
  content: ""; width: 11px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform .2s var(--spring);
}
.check input:checked + .box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .box { box-shadow: var(--ring); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; padding: 12px 0; }
.switch + .switch { border-top: 1px solid var(--line-2); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 46px; height: 28px; flex: none; border-radius: 99px; background: #D5DCE8; position: relative; transition: background .2s; }
.switch .track::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: transform .25s var(--spring);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch .s-text { display: grid; gap: 2px; }
.switch .s-text b { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.switch .s-text small { font-size: 12.5px; color: var(--muted); }
.switch.reverse { flex-direction: row-reverse; justify-content: flex-end; }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 18px; border-radius: 10px;
  font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; transition: all .2s var(--ease);
}
.seg input:checked + span { background: #fff; color: var(--primary-700); box-shadow: var(--shadow-sm); }
.seg input:focus-visible + span { box-shadow: var(--ring); }
.seg.block { display: flex; }
.seg.block label { flex: 1; }
.seg.block span { justify-content: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 99px;
  border: 1.5px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all .18s var(--ease);
}
.chip span .ic { width: 16px; height: 16px; color: var(--muted-2); transition: color .18s; }
.chip:hover span { border-color: #CAD5E8; }
.chip input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }
.chip input:checked + span .ic { color: var(--primary); }
.chip input:focus-visible + span { box-shadow: var(--ring); }
.chips.square .chip span { border-radius: 12px; min-width: 48px; justify-content: center; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.tile .t-body {
  height: 100%; display: grid; justify-items: center; align-content: center; gap: 10px; text-align: center;
  padding: 18px 10px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff;
  transition: all .2s var(--ease);
}
.tile .t-ic {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  background: var(--bg-2); color: var(--muted); transition: all .25s var(--spring);
}
.tile .t-ic .ic { width: 24px; height: 24px; }
.tile b { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.tile small { font-size: 12px; color: var(--muted); margin-top: -6px; }
.tile:hover .t-body { border-color: #C9D6EE; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tile input:checked + .t-body { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(0, 87, 255, .1); }
.tile input:checked + .t-body .t-ic { background: var(--primary); color: #fff; transform: scale(1.06) rotate(-4deg); }
.tile input:focus-visible + .t-body { box-shadow: var(--ring); }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tiles.wide .t-body { grid-auto-flow: column; justify-content: start; text-align: left; padding: 16px 18px; gap: 14px; }
.tiles.wide .t-body > span { display: grid; gap: 2px; }
.tiles.wide small { margin-top: 0; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.card-head h2, .card-head h3 { font-size: 17px; font-weight: 700; color: var(--ink); }

.badge {
  --b-bg: var(--gray-50); --b-fg: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  background: var(--b-bg); color: var(--b-fg); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge .ic { width: 14px; height: 14px; }
.badge.green { --b-bg: var(--green-50); --b-fg: #08875A; }
.badge.orange { --b-bg: var(--orange-50); --b-fg: #C4500B; }
.badge.purple { --b-bg: var(--purple-50); --b-fg: #5B3FD9; }
.badge.blue { --b-bg: var(--primary-50); --b-fg: var(--primary-700); }
.badge.red { --b-bg: var(--red-50); --b-fg: #C4271C; }
.badge.pink { --b-bg: var(--pink-50); --b-fg: #C31F59; }
.badge.gray { --b-bg: var(--gray-50); --b-fg: var(--muted); }
.badge.dark { --b-bg: rgba(10, 20, 51, .78); --b-fg: #fff; backdrop-filter: blur(6px); }

.avatar {
  width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--grad-primary); color: #fff; font-weight: 700; font-size: 15px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--grad-primary); transition: width .6s var(--ease); }
.progress.warn > span { background: linear-gradient(90deg, #FFB020, #FF7A1A); }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 20px; }
.empty .e-ic {
  width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center;
  background: var(--primary-50); color: var(--primary); margin-bottom: 6px;
}
.empty .e-ic .ic { width: 32px; height: 32px; }
.empty h3 { font-size: 18px; font-weight: 700; color: var(--ink); }
.empty p { color: var(--muted); max-width: 420px; }
.empty .btn { margin-top: 8px; }

.toast-wrap { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  pointer-events: auto; animation: toast-in .45s var(--spring);
}
.toast .t-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .12); }
.toast.success .t-ic { background: #12B76A; }
.toast.error .t-ic { background: #F04438; }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }

.modal {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%;
  display: none; place-items: center;
}
.modal[open] { display: grid; }
.modal::backdrop { background: rgba(10, 20, 51, .45); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
.modal-box {
  width: min(460px, calc(100vw - 32px)); background: #fff; border-radius: 26px; padding: 28px;
  box-shadow: var(--shadow-lg); animation: pop .35s var(--spring); position: relative;
}
.modal-box .m-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 16px; background: var(--red-50); color: var(--red); }
.modal-box .m-ic .ic { width: 26px; height: 26px; }
.modal-box h3 { font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.modal-box p { color: var(--muted); }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes fade { from { opacity: 0; } }

.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: all .18s var(--ease);
}
.menu.open .menu-list { opacity: 1; visibility: visible; transform: none; }
.menu-list a, .menu-list button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text); text-align: left;
}
.menu-list a:hover, .menu-list button:hover { background: var(--bg); color: var(--ink); }
.menu-list .ic { width: 17px; height: 17px; color: var(--muted); }
.menu-list .danger, .menu-list .danger .ic { color: #D92D20; }
.menu-list hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 4px; }
.menu-list .menu-head { padding: 8px 12px 10px; display: grid; gap: 2px; }
.menu-list .menu-head b { font-size: 14px; color: var(--ink); }
.menu-list .menu-head small { font-size: 12.5px; color: var(--muted); }

.skeleton { background: linear-gradient(90deg, #EEF2F8 25%, #F6F8FC 50%, #EEF2F8 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: 14px; font-size: 14px; font-weight: 500; margin-bottom: 18px; }
.alert.error { background: var(--red-50); color: #B42318; }
.alert.info { background: var(--primary-50); color: var(--primary-700); }
.alert .ic { margin-top: 1px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--navy); letter-spacing: -.01em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-primary); color: #fff; box-shadow: var(--glow); }
.brand-mark .ic { width: 20px; height: 20px; }
.brand b { color: var(--primary); font-weight: 700; }

@media (max-width: 760px) {
  .container { padding-inline: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-4.keep-2, .grid-3.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: auto; }
  .card-pad { padding: 18px; }
  .card-head { padding: 18px 18px 0; }
  .toast-wrap { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.lang-menu .lang-btn { gap: 6px; padding: 0 10px; font-weight: 700; }
.lang-menu .lang-btn .ic:last-child { width: 15px; height: 15px; opacity: .6; }
.lang-menu .menu-list { min-width: 190px; }
.lang-menu .menu-list a.on { color: var(--primary-700); font-weight: 700; }
.lang-menu .menu-list a .ic { margin-left: auto; color: var(--primary); }
.lang-menu .flag { font-size: 17px; line-height: 1; }
