/* ============================================================
   Hệ thống thiệp mời — bảng màu & thành phần dùng chung
   .theme-admin  : khu quản trị
   .theme-stage  : trang khách
   Cả hai đều tông sáng; chỉ khác nền và độ nhấn.
   ============================================================ */

:root {
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --sh-2: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 12px 24px -6px rgba(16, 24, 40, .10);
  --sh-3: 0 18px 50px -12px rgba(16, 24, 40, .28);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --bg: #f7f8fa;
  --surface: #fff;
  --surface-2: #f9fafb;
  --ink: #101828;
  --ink-2: #475467;
  --muted: #98a2b3;
  --line: #e4e7ec;
  --line-2: #eef0f3;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff4ff;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --ok: #079455;
  --ok-soft: #ecfdf3;
}

/* Trang khách: nền sáng, hơi ấm, có vệt màu nhẹ cho sang */
.theme-stage {
  --bg: #f4f6fb;
  background:
    radial-gradient(58rem 34rem at 8% -8%, #e3ecff 0%, transparent 58%),
    radial-gradient(46rem 30rem at 100% 8%, #f0e8ff 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }

body {
  font-family: 'Be Vietnam Pro', -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.28rem; }
h2 { font-size: .98rem; }
h3 { font-size: .95rem; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.sub { color: var(--ink-2); font-size: .86rem; }
.help { color: var(--muted); font-size: .8rem; display: flex; align-items: flex-start; gap: .35rem; font-style: normal; }
.help .ico { width: 14px; height: 14px; flex: none; margin-top: .18rem; }
.mt { margin-top: .6rem; }
.mb { margin-bottom: .7rem; }
.dim { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .8rem; }
.stack { display: grid; gap: 1.05rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: .15rem 0; }
.ico { width: 18px; height: 18px; flex: none; }

.sec-title {
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------------- thương hiệu ---------------- */
.brand-lockup { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand-mark {
  flex: none; display: grid; place-items: center; overflow: hidden;
  border-radius: 10px; background: linear-gradient(140deg, var(--brand), #7c3aed); color: #fff;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-mark b { font-weight: 800; letter-spacing: -.02em; }
.brand-text { display: grid; line-height: 1.25; min-width: 0; }
.brand-text b { font-weight: 700; letter-spacing: -.015em; }
.brand-text em { font-style: normal; color: var(--muted); }

.brand-lockup.sm .brand-mark { width: 34px; height: 34px; }
.brand-lockup.sm .brand-mark b { font-size: .72rem; }
.brand-lockup.sm .brand-text b { font-size: .93rem; }
.brand-lockup.sm .brand-text em { font-size: .73rem; }

.brand-lockup.lg { gap: .7rem; }
.brand-lockup.lg .brand-mark { width: 46px; height: 46px; border-radius: 12px; }
.brand-lockup.lg .brand-mark b { font-size: .95rem; }
.brand-lockup.lg .brand-text b { font-size: 1.05rem; }

/* ---------------- nút ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; font-size: .875rem;
  padding: .55rem .9rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; box-shadow: var(--sh-1);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: var(--line); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { padding: .38rem .6rem; font-size: .82rem; }
.btn.sm .ico { width: 15px; height: 15px; }
.btn.block { width: 100%; }

.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-size: .82rem;
  color: var(--brand); cursor: pointer; text-align: left;
}
.link-btn:hover { text-decoration: underline; }

/* ---------------- form ---------------- */
.fld { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.lbl { font-size: .8rem; font-weight: 600; color: var(--ink); }

input[type=text], input[type=password], select {
  width: 100%; font: inherit; font-size: .9rem;
  padding: .55rem .7rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-1);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder { color: var(--muted); }
input:focus, select:focus {
  outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2398a2b3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center; padding-right: 2rem;
}
.color-row { display: flex; align-items: center; gap: .75rem; }
input[type=color] {
  width: 46px; height: 36px; padding: 2px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
}

.switch { display: flex; align-items: center; gap: .7rem; cursor: pointer; }
.switch > input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 23px; border-radius: 99px; flex: none; background: var(--line); position: relative; transition: background .18s var(--ease); }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .18s var(--ease); }
.switch > input:checked + .track { background: var(--brand); }
.switch > input:checked + .track .knob { transform: translateX(17px); }
.switch > input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-text { display: grid; line-height: 1.35; }
.switch-text b { font-size: .875rem; }
.switch-text em { font-style: normal; font-size: .78rem; color: var(--muted); }

.check-list { display: grid; gap: .1rem; }
.check { display: flex; align-items: center; gap: .6rem; cursor: pointer; padding: .45rem .55rem; border-radius: var(--r-sm); }
.check:hover { background: var(--surface-2); }
.check > input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 18px; height: 18px; flex: none; border-radius: 5px;
  border: 1.5px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: transparent; transition: all .15s var(--ease);
}
.check .box .ico { width: 12px; height: 12px; stroke-width: 3; }
.check > input:checked + .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.check > input:focus-visible + .box { outline: 2px solid var(--brand); outline-offset: 2px; }
.check-txt { display: grid; line-height: 1.3; }
.check-txt b { font-size: .875rem; font-weight: 600; }
.check-txt em { font-style: normal; font-size: .76rem; color: var(--muted); }

/* ---------------- thông báo ---------------- */
.alert { display: flex; align-items: flex-start; gap: .5rem; padding: .65rem .8rem; border-radius: var(--r-sm); font-size: .85rem; border: 1px solid transparent; }
.alert.bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.alert.good { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.alert.warn-soft { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert ul { margin: 0; padding-left: 1.1rem; }

.tag { display: inline-block; font-size: .74rem; font-weight: 600; white-space: nowrap; padding: .15rem .5rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tag.bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }

.pill { position: absolute; top: .6rem; left: .6rem; z-index: 2; font-size: .72rem; font-weight: 600; padding: .18rem .55rem; border-radius: 99px; backdrop-filter: blur(6px); }
.pill.on { background: rgba(7, 148, 85, .92); color: #fff; }
.pill.off { background: rgba(16, 24, 40, .72); color: #fff; }
.pill.public { background: rgba(7, 148, 85, .92); color: #fff; }
.pill.unlisted { background: rgba(176, 116, 8, .94); color: #fff; }

/* ============================================================
   KHU QUẢN TRỊ
   ============================================================ */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1.1rem; padding: 1rem .7rem; position: sticky; top: 0; height: 100vh; }
.side-brand { display: block; padding: .25rem .4rem; text-align: center; }
.side-brand:hover { text-decoration: none; }
.side-nav { display: grid; gap: 2px; flex: 1; align-content: start; }
.side-nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; font-size: .87rem; transition: background .13s var(--ease), color .13s var(--ease); }
.side-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side-nav a .ico { color: var(--muted); }
.side-nav a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.side-nav a.on .ico { color: var(--brand); }

.side-foot { border-top: 1px solid var(--line-2); padding-top: .7rem; display: grid; gap: .4rem; }
.side-user { display: flex; align-items: center; gap: .6rem; padding: 0 .4rem; }
.side-user .avatar { width: 29px; height: 29px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.side-user .avatar .ico { width: 15px; height: 15px; }
.side-user span { display: grid; line-height: 1.25; min-width: 0; }
.side-user b { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.side-user em { font-style: normal; font-size: .72rem; color: var(--muted); }
.side-logout { width: 100%; display: flex; align-items: center; gap: .6rem; background: none; border: 0; cursor: pointer; font: inherit; font-size: .84rem; color: var(--ink-2); padding: .45rem .6rem; border-radius: var(--r-sm); }
.side-logout:hover { background: var(--danger-soft); color: var(--danger); }

.main { min-width: 0; display: flex; flex-direction: column; }

/* thanh tiêu đề: gọn, không chiếm chỗ */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap;
  padding: .75rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.topbar-title { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; min-width: 0; }
.topbar h1 { font-size: 1.12rem; }
.topbar .sub { font-size: .82rem; }
.crumb { display: inline-flex; align-items: center; gap: .2rem; font-size: .82rem; color: var(--muted); font-weight: 500; }
.crumb .ico { width: 14px; height: 14px; }
.crumb:hover { color: var(--ink); text-decoration: none; }
.content {
  padding: 1.3rem 1.5rem 3rem; display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem; align-content: start;
  /* Thu nhỏ trang xuống 25% là khung nhìn rộng ~7600px; không chặn thì khung xem
     thử phình theo, chữ tí hon mà thiệp to bằng cả màn hình. */
  width: 100%; max-width: 1400px; margin-inline: auto;
}

/* ---------------- thẻ ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.card.narrow { max-width: 440px; }
/* Thẻ có bảng chọn bung ra ngoài (lịch, danh sách) thì không được cắt */
.card.allow-pop { overflow: visible; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.card-body { padding: 1.1rem; }
.card-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .85rem 1.1rem; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.note { display: flex; gap: .8rem; align-items: flex-start; color: var(--ink-2); font-size: .86rem; }
.note-ico { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.split > * { min-width: 0; }
.preview-col { min-width: 0; }

/* ---------------- lưới sự kiện ---------------- */
.grid.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 1.05rem; }
.card.ev { display: flex; flex-direction: column; transition: box-shadow .18s var(--ease), transform .18s var(--ease); }
.card.ev:hover { box-shadow: var(--sh-2); transform: translateY(-2px); text-decoration: none; }
.ev-thumb { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface-2) center / cover no-repeat; border-bottom: 1px solid var(--line-2); }
.ev-thumb.blank { display: grid; place-items: center; }
.thumb-empty { display: grid; justify-items: center; gap: .35rem; color: var(--muted); font-size: .78rem; font-weight: 500; }
.thumb-empty .ico { width: 26px; height: 26px; }
.ev-body { padding: .85rem 1rem; display: grid; gap: .45rem; flex: 1; align-content: start; }
.ev-body h3 a { color: var(--ink); }
.ev-body h3 a:hover { color: var(--brand); text-decoration: none; }
.ev-body strong { font-size: .93rem; }
.ev-body em { font-style: normal; font-size: .8rem; color: var(--muted); }
.ev-when { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--ink-2); }
.ev-when .ico { width: 14px; height: 14px; color: var(--muted); }
.panel-head .when { display: inline-flex; align-items: center; gap: .35rem; }
.panel-head .when .ico { width: 15px; height: 15px; }
.kv { display: grid; gap: .18rem; margin: 0; }
.kv > div { display: flex; gap: .4rem; font-size: .81rem; }
.kv dt { color: var(--muted); margin: 0; text-transform: lowercase; }
.kv dd { margin: 0; color: var(--ink-2); font-weight: 500; }
.ev-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .65rem 1rem; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.ev-actions form { display: contents; }
.ev-actions .danger { margin-left: auto; }

/* ---------------- tab khung ---------------- */
.tabs {
  display: flex; gap: .15rem; padding: 0 1.1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line-2);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .6rem .7rem; font-size: .85rem; font-weight: 500; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: var(--brand-dark); font-weight: 600; border-bottom-color: var(--brand); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: inline-block; }
.dot.ok { background: var(--ok); }

.frame-meta { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; font-size: .82rem; }
.frame-meta > div { display: grid; line-height: 1.3; }
.frame-meta .lbl { font-size: .72rem; color: var(--muted); font-weight: 500; }
.frame-meta form { margin-left: auto; }

/* ---------------- vùng thả ảnh ---------------- */
.drop {
  position: relative; display: grid; place-items: center; cursor: pointer; overflow: hidden;
  aspect-ratio: 16 / 10; border-radius: var(--r);
  border: 1.5px dashed var(--line); background: var(--surface-2);
  transition: border-color .15s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--brand); }
.drop.is-locked { cursor: default; opacity: .72; aspect-ratio: 4 / 5; }
.drop.is-locked:hover { border-color: var(--line); }
.editor-empty {
  display: grid; justify-items: center; gap: .4rem; text-align: center;
  aspect-ratio: 4 / 5; align-content: center; padding: 1.5rem;
  border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--surface-2);
}
.editor-empty b { font-size: .92rem; }
.editor-empty p { font-size: .82rem; color: var(--muted); max-width: 34ch; }
.drop.sm { aspect-ratio: 3 / 2; }
.drop-inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: .15rem; text-align: center; padding: 1rem; color: var(--ink-2); transition: opacity .15s var(--ease); }
.drop-inner .ico { width: 24px; height: 24px; color: var(--muted); margin-bottom: .15rem; }
.drop-inner b { font-size: .85rem; color: var(--ink); }
.drop-inner em { font-style: normal; font-size: .76rem; color: var(--muted); }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0f172a; }
.drop.filled .drop-inner { opacity: 0; background: rgba(8, 12, 22, .62); width: 100%; height: 100%; align-content: center; }
.drop.filled .drop-inner b, .drop.filled .drop-inner em, .drop.filled .drop-inner .ico { color: #fff; }
.drop.filled:hover .drop-inner { opacity: 1; }
/* Đã có nền -> thu thành một dải thấp, cột trái khỏi dài lê thê.
   Mở lớn thì chặn chiều cao xấp xỉ khung xem thử bên phải, không phình quá. */
.drop.compact { aspect-ratio: auto; height: 84px; }
.drop.compact img { object-fit: cover; }
.drop.filled:not(.compact) { max-height: min(62vh, 520px); }
.drop.filled:not(.compact) img { object-fit: contain; }

.avatar-row { display: flex; align-items: center; gap: 1.1rem; }
.avatar-lg { width: 88px; height: 88px; flex: none; border-radius: 50%; background: var(--surface-2) center / cover no-repeat; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.avatar-lg .ico { width: 32px; height: 32px; }

/* ---------------- trình chỉnh bố cục ---------------- */
.editor { max-width: 620px; margin-inline: auto; position: relative; border-radius: var(--r); overflow: hidden; background: #0f172a; border: 1px solid var(--line-2); touch-action: none; }

/* --- đường gióng khi kéo (kiểu Canva) --- */
.guides { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.guide { position: absolute; display: block; }
.guide.v { top: 0; bottom: 0; width: 1px; margin-left: -.5px;
  background: repeating-linear-gradient(to bottom, #ff2d92 0 6px, transparent 6px 11px); }
.guide.h { left: 0; right: 0; height: 1px; margin-top: -.5px;
  background: repeating-linear-gradient(to right, #ff2d92 0 6px, transparent 6px 11px); }
.guide.mid { opacity: 1; }
.guide:not(.mid) { opacity: .72; }
#editorCanvas { display: block; width: 100%; height: auto; }
.handle { position: absolute; transform: translate(-50%, -50%); cursor: grab; border-radius: 50%; }
.handle.text { border-radius: 4px; }
.handle:focus-visible { outline: none; border-color: #7c3aed; }
.handle.dragging { cursor: grabbing; }

.save-state { font-size: .78rem; color: var(--muted); margin-left: auto; }
.save-state.on { color: var(--warn); font-weight: 600; }

/* ---------------- bảng ---------------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th { text-align: left; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .65rem 1.1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tbl td { padding: .6rem 1.1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }

/* ---------------- trạng thái rỗng ---------------- */
.empty { display: grid; justify-items: center; gap: .5rem; text-align: center; padding: 3.2rem 1.5rem; border-radius: var(--r-lg); background: var(--surface); border: 1px dashed var(--line); }
.empty p { color: var(--ink-2); max-width: 42ch; }
.empty .btn { margin-top: .6rem; }
.empty-ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: .3rem; }
.empty-ico .ico { width: 24px; height: 24px; }

/* ---------------- đăng nhập ---------------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.login-page::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(50rem 30rem at 15% -10%, #e0eaff 0%, transparent 60%),
    radial-gradient(45rem 28rem at 90% 110%, #efe4ff 0%, transparent 60%);
}
.login-shell { display: grid; justify-items: center; gap: 1.1rem; width: 100%; }
.login-card { width: 100%; max-width: 396px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-2); padding: 1.9rem 1.7rem; display: grid; gap: .85rem; }
.login-card h1 { font-size: 1.2rem; margin-top: .3rem; }
.login-card .sub { margin-bottom: .4rem; }
.login-foot { font-size: .8rem; color: var(--muted); }

/* ============================================================
   TRANG KHÁCH
   ============================================================ */
.site-head { padding: 1.3rem 1.5rem .6rem; display: flex; justify-content: center; }
.site-head .brand-lockup.wordmark { justify-items: center; }
.site-head .brand-lockup.wordmark img { width: 132px; }
.home { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 2rem; display: grid; gap: 1.6rem; }
.home-head { display: grid; gap: .3rem; }
.home-head h1 { font-size: 1.75rem; }
.site-foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 2rem 1rem 3rem; }

.maker { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: 100vh; }
.panel {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 1.1rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: 1.05rem;
  /* Dính theo màn hình: cuộn trang thì cột trái không để lại khoảng trắng phía dưới */
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.panel-head { display: grid; gap: .15rem; }
.panel-head h1 { font-size: 1.12rem; }
.panel-head .sub { font-size: .82rem; }
.panel-head b { color: var(--ink); }

.step { display: grid; grid-template-columns: 24px 1fr; gap: .75rem; align-items: start; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-size: .75rem; font-weight: 700; margin-top: .1rem; }
.step-body { display: grid; gap: .45rem; min-width: 0; }

.pills { display: grid; gap: .4rem; }
.pill-btn {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .52rem .7rem; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  transition: all .15s var(--ease);
}
.pill-btn:hover { border-color: var(--brand); color: var(--ink); }
.pill-btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.ratio { flex: none; border: 1.5px solid currentColor; border-radius: 3px; opacity: .7; }
.ratio.r-square { width: 16px; height: 16px; }
.ratio.r-portrait { width: 13px; height: 17px; }
.ratio.r-landscape { width: 20px; height: 12px; }

.panel-foot { margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--line-2); display: grid; gap: .65rem; }
.dl-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }

.stage { display: grid; place-items: center; padding: 2rem; min-width: 0; }
/* Thiệp lấy hết chiều cao màn hình cho lớn, không tự chặn ở 620px nữa */
.stage-inner { width: 100%; display: grid; justify-items: center; gap: .6rem; }
#card {
  display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 5.5rem);
  border-radius: var(--r); background: var(--surface-2); box-shadow: var(--sh-3);
}

/* Xem toàn màn hình: phủ kín, thiệp to hết cỡ */
body.card-zoom { overflow: hidden; }
body.card-zoom .stage {
  position: fixed; inset: 0; z-index: 90; padding: 1rem;
  background: rgba(9, 14, 27, .92);
}
body.card-zoom #card { max-height: calc(100vh - 5rem); max-width: calc(100vw - 2rem); }
body.card-zoom .stage-hint, body.card-zoom .crop-tip { color: rgba(255, 255, 255, .75); }
.zoom-btn {
  position: absolute; top: .8rem; right: .9rem; z-index: 92;
  display: inline-flex; align-items: center; gap: .35rem;
}
body:not(.card-zoom) .zoom-btn { position: static; }
/* Trên nền tối phải đổi màu, không thì nút trắng chìm vào lớp phủ */
body.card-zoom .zoom-btn {
  background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff;
}
body.card-zoom .zoom-btn:hover { background: rgba(255, 255, 255, .22); border-color: #fff; }
body.card-zoom .zoom-btn .ico { color: #fff; }

/* ============================================================
   COMPONENT DÙNG CHUNG — hộp thoại & thông báo (thay alert/confirm)
   ============================================================ */
.ui-backdrop {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 1.2rem; background: rgba(16, 24, 40, .45); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .16s var(--ease);
}
.ui-backdrop.on { opacity: 1; }
.ui-dialog {
  width: 100%; max-width: 400px; background: var(--surface); color: var(--ink);
  border-radius: var(--r-lg); box-shadow: 0 20px 50px -12px rgba(16, 24, 40, .35);
  padding: 1.3rem; display: grid; gap: .55rem;
  transform: translateY(8px) scale(.98); transition: transform .18s var(--ease);
}
.ui-backdrop.on .ui-dialog { transform: none; }
.ui-dialog h3 { font-size: 1.02rem; }
.ui-dialog p { color: var(--ink-2); font-size: .87rem; }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.solid:hover { background: #b42318; border-color: #b42318; }

/* Thông báo hiện ở PHÍA TRÊN — dưới thì hay bị thanh cắt xén / nút tải che mất */
.ui-toasts {
  position: fixed; z-index: 95; left: 50%; top: 1rem; transform: translateX(-50%);
  display: grid; gap: .5rem; justify-items: center; pointer-events: none;
}
.ui-toast {
  background: #101828; color: #fff; font-size: .86rem; font-weight: 500;
  padding: .6rem .95rem; border-radius: 99px; box-shadow: var(--sh-2);
  opacity: 0; transform: translateY(-8px); transition: all .2s var(--ease);
  max-width: min(90vw, 460px); text-align: center;
}
.ui-toast.on { opacity: 1; transform: none; }
.ui-toast.ok { background: #065f38; }
.ui-toast.bad { background: #912018; }
.ui-toast.warn { background: #93610a; }


/* ============================================================
   BẢNG ĐIỀU KHIỂN BỐ CỤC
   ============================================================ */
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); margin-bottom: .55rem;
}
.seg-btn {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 600; color: var(--ink-2);
  padding: .38rem .65rem; border: 0; border-radius: 7px; background: transparent;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.seg-btn .ico { width: 15px; height: 15px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--surface); color: var(--brand-dark); box-shadow: var(--sh-1); }

.ctrls { display: grid; gap: .75rem; margin-top: 1rem; }
.ctrl-group {
  border: 1px solid var(--line); border-radius: var(--r); padding: .75rem .85rem;
  display: grid; gap: .5rem; background: var(--surface-2);
}
.ctrl-head {
  display: flex; align-items: center; gap: .4rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .1rem;
}
.ctrl-head .ico { width: 14px; height: 14px; }

.rng {
  display: grid; grid-template-columns: 1fr 8.5rem 3.1rem; align-items: center;
  gap: .7rem; font-size: .82rem;
}
.rng > span { color: var(--ink-2); font-weight: 500; }
.rng > b {
  font-size: .76rem; color: var(--ink); text-align: right; font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: .1rem .3rem;
}
.rng.swatch > b { display: none; }
.rng.swatch { grid-template-columns: 1fr auto; }
.rng.swatch input[type=color] { width: 3.4rem; height: 28px; margin-right: 3.8rem; }

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 20px;
  background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 99px; background: var(--line);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -6px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand);
  box-shadow: var(--sh-1); transition: transform .12s var(--ease);
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type=range]::-moz-range-track { height: 5px; border-radius: 99px; background: var(--line); }
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--brand);
  background: var(--surface); box-shadow: var(--sh-1);
}

.switch.sm .track { width: 34px; height: 20px; }
.switch.sm .knob { width: 14px; height: 14px; }
.switch.sm > input:checked + .track .knob { transform: translateX(14px); }
.switch.sm .switch-text b { font-size: .82rem; font-weight: 500; color: var(--ink-2); }
.switch.sm > input:checked ~ .switch-text b { color: var(--ink); font-weight: 600; }

.box-opts {
  display: grid; gap: .5rem; padding: .6rem .7rem; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
}

.tag.mini { font-size: .66rem; padding: .05rem .35rem; background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }

.editor.pan-mode .handle.text { pointer-events: none; opacity: .35; }
.editor.pan-mode .handle:not(.text) { cursor: move; }

/* ---------------- công cụ ảnh phía khách ---------------- */
.photo-tools {
  display: grid; gap: .45rem; padding: .6rem .7rem; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.photo-tools .rng { grid-template-columns: 1fr 6.5rem 2.9rem; }
.photo-tools-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.photo-tools-row .btn { flex: 1; justify-content: center; }
.btn.ghost.danger { color: var(--danger); }
.btn.ghost.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.fit-row { display: flex; gap: .9rem; flex-wrap: wrap; }
.tools-lbl { font-size: .78rem; color: var(--muted); }

/* --- thanh canh giữa trong trình chỉnh bố cục --- */
.align-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
}
.align-lbl { font-size: .78rem; color: var(--muted); }
.align-lbl b { color: var(--ink-2); font-weight: 600; }
.align-bar .link-btn { flex-basis: 100%; text-align: left; font-size: .78rem; }
.align-grid { display: flex; gap: .5rem; margin-left: auto; flex-wrap: wrap; }
.align-set {
  display: inline-flex; gap: .1rem; padding: .12rem;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
}
.abtn {
  display: grid; justify-items: center; gap: .1rem; cursor: pointer;
  min-width: 44px; padding: .3rem .3rem .25rem; border: 0; border-radius: 7px;
  background: none; color: var(--ink-2); font: inherit;
}
.abtn .ico { width: 18px; height: 18px; }
.abtn span { font-size: .66rem; }
.abtn:hover { background: var(--surface-2); color: var(--ink); }
.abtn:active { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.link-btn.danger { color: var(--danger); }
.stage-hint { text-align: center; font-size: .78rem; color: var(--muted); margin-top: .6rem; }

/* --- thanh cắt xén ảnh (nhấp đúp vào ảnh trên thiệp) --- */
/* Thanh NỔI, không chen vào bố cục và không đè lên thiệp: neo đáy màn hình,
   luôn thấy dù cuộn tới đâu. Trên di động thì trải hết bề ngang cho dễ bấm. */
.crop-bar {
  position: fixed; z-index: 40; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
  display: flex; align-items: center; gap: .85rem;
  padding: .5rem .5rem .5rem .9rem;
  border-radius: 999px; background: #101828; color: #fff;
  box-shadow: 0 14px 38px rgba(16, 24, 40, .38);
}
.crop-lbl { display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.crop-lbl .ico { width: 17px; height: 17px; opacity: .85; }

.crop-zoom { display: flex; align-items: center; gap: .45rem; }
.crop-step {
  width: 26px; height: 26px; flex: 0 0 auto; cursor: pointer;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
  font: inherit; font-size: 1rem; line-height: 1; display: grid; place-items: center;
}
.crop-step:hover { background: rgba(255, 255, 255, .22); }
.crop-zoom input[type=range] { width: 9rem; margin: 0; }
.crop-zoom input[type=range]::-webkit-slider-runnable-track { background: rgba(255, 255, 255, .22); }
.crop-zoom input[type=range]::-moz-range-track { background: rgba(255, 255, 255, .22); }
.crop-zoom > b {
  min-width: 3.1rem; text-align: right; font-size: .76rem; font-weight: 500;
  color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums;
}
.crop-bar .crop-done { border-radius: 999px; padding-inline: 1rem; }
.crop-tip { color: var(--muted); }
#card.cropping { cursor: grab; }
#card.cropping:active { cursor: grabbing; }

@media (max-width: 700px) {
  .crop-bar {
    left: .55rem; right: .55rem; bottom: .55rem; transform: none;
    flex-wrap: wrap; gap: .5rem .7rem; border-radius: 18px; padding: .6rem .7rem;
  }
  .crop-lbl { flex: 1; }
  .crop-zoom { order: 3; flex-basis: 100%; }
  .crop-zoom input[type=range] { flex: 1; width: auto; }
  .crop-step { width: 32px; height: 32px; }
  .crop-bar .crop-done { padding-inline: 1.2rem; }
}
}
#card.grabbing { cursor: grabbing; }
/* Ngón tay vuốt trên thiệp phải CUỘN ĐƯỢC TRANG. Chỉ khi vào chế độ cắt xén mới
   giành lấy cả hai chiều để kéo ảnh và chụm hai ngón thu phóng. */
#card { cursor: default; touch-action: pan-y; }
#card.cropping { touch-action: none; }

/* Hiện theo loại thiết bị: máy có chuột vs máy cảm ứng */
.only-touch, .only-touch-i { display: none; }
@media (hover: none) and (pointer: coarse) {
  .only-touch { display: inline-flex; justify-content: center; gap: .4rem; }
  .only-touch-i { display: inline; }
  .no-touch, .no-touch-i { display: none !important; }
}

/* Ba mức hiển thị của sự kiện — đặt ngay đầu thẻ thông tin */
.vis { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.vis-opt { position: relative; cursor: pointer; }
.vis-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vis-opt span {
  display: block; padding: .28rem .7rem; border-radius: 999px;
  font-size: .76rem; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.vis-opt:hover span { color: var(--ink); }
.vis-opt:has(input:checked) span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .14); }
.vis-opt:has(input[value="public"]:checked) span { color: #0a7a3d; }
.vis-opt:has(input[value="off"]:checked) span { color: #b42318; }
.vis-opt:has(input:focus-visible) span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Nhân bản sự kiện: ô chọn + nút trên một hàng */
.dup-row { display: flex; gap: .5rem; align-items: center; }
.dup-row select { flex: 1; min-width: 0; }

/* Mẹo bấm đúp để chỉnh ảnh — hiện ngay khi khách vừa chọn ảnh */
.tip-dbl {
  display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 .1rem;
  padding: .5rem .6rem; border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  font-size: .78rem; line-height: 1.45; color: var(--ink-2);
}
.tip-dbl svg { flex: none; width: 16px; height: 16px; margin-top: .1rem; color: var(--brand); }
.tip-dbl b { color: var(--ink); }
.tip-dbl em { font-style: normal; }

/* ---------------- màn hình nhỏ ---------------- */
@media (max-width: 1180px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); gap: .8rem; }
  .side-nav { flex-direction: row; display: flex; flex-wrap: wrap; flex: 1; }
  .side-foot { border-top: 0; padding-top: 0; display: flex; align-items: center; gap: .6rem; }
  .side-user { display: none; }
  .topbar { position: static; }
  .topbar, .content { padding-left: 1.05rem; padding-right: 1.05rem; }
  .maker { grid-template-columns: 1fr; }
  .panel { position: static; height: auto; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  #card { max-height: none; width: 100%; }
  .stage { padding: 1.4rem 1.05rem 3rem; }
  .stage-inner { width: 100%; }
  .two { grid-template-columns: 1fr; }
  .rng { grid-template-columns: 5.5rem 1fr 3rem; }
}

/* ---------------- bổ sung: vai trò, seg nhỏ, upload ngầm, nút dịch ảnh ---------------- */
.role-row { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; }
.role-row input[type=text] { max-width: 14rem; }

.seg.small { margin-bottom: .35rem; }
.seg.small .seg-btn { font-size: .76rem; padding: .3rem .55rem; }

.drop-busy {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center;
  justify-content: center; gap: .5rem; border-radius: var(--r);
  background: rgba(8, 12, 22, .68); color: #fff; font-size: .85rem; font-weight: 600;
}
.spin {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tabs button.tab { background: none; border: 0; cursor: pointer; font: inherit; }

.nudge { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .6rem; }
.nudge-lbl { font-size: .82rem; color: var(--ink-2); font-weight: 500; }
.nudge-pad {
  display: grid; grid-template-columns: repeat(3, 26px); grid-template-rows: repeat(3, 26px);
  gap: 2px;
}
.nudge-btn {
  display: grid; place-items: center; cursor: pointer; font: inherit; font-size: .62rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 6px; padding: 0;
}
.nudge-btn:hover { border-color: var(--brand); color: var(--brand); }
.nudge-btn.up { grid-area: 1 / 2; }
.nudge-btn.left { grid-area: 2 / 1; }
.nudge-btn.mid { grid-area: 2 / 2; }
.nudge-btn.right { grid-area: 2 / 3; }
.nudge-btn.down { grid-area: 3 / 2; }

#card.grabbable { cursor: grab; }

/* ---------------- bổ sung: tách nền, kiểu ô, tay nắm ảnh cắt nền ---------------- */
.seg.small.tight { margin: 0; justify-self: end; }
.seg.small.tight .seg-btn { font-size: .74rem; padding: .26rem .5rem; }
.cutout-row { position: relative; }
.cutout-row .spin { border-color: rgba(37,99,235,.3); border-top-color: var(--brand); margin-left: auto; }
.handle.cutout { border-radius: 8px; }
.btn .spin { border-color: rgba(37,99,235,.3); border-top-color: var(--brand); }

/* ---------------- logo dạng wordmark (ảnh đã có sẵn chữ tên) ---------------- */
.brand-lockup.wordmark { display: grid; justify-items: start; gap: .15rem; }
.side-brand .brand-lockup.wordmark { justify-items: center; }
.brand-lockup.wordmark img { display: block; height: auto; }
.brand-lockup.wordmark.sm img { width: 96px; }
.brand-lockup.wordmark.lg img { width: 152px; }
.brand-lockup.wordmark em {
  font-style: normal; font-size: .73rem; color: var(--muted); line-height: 1.2;
}
.login-card .brand-lockup.wordmark { justify-items: center; justify-self: center; }

/* ---------------- 2 ô trung tính: form quản trị + trang khách ---------------- */
/* .card-head là space-between nên hai tab bị đẩy về hai đầu — kéo sát lại */
.slot-tabs { gap: .25rem; padding: .5rem .6rem; justify-content: flex-start; }
.stab {
  cursor: pointer; padding: .38rem .9rem; border: 0; border-radius: 999px;
  background: none; color: var(--ink-2); font: inherit; font-size: .86rem; font-weight: 600;
}
.stab:hover { background: var(--surface-2); color: var(--ink); }
.stab.on { background: var(--brand); color: #fff; }

/* --- bộ chọn ngày giờ tự dựng --- */
.dtpick { position: relative; }
.dt-field {
  width: 100%; display: flex; align-items: center; gap: .55rem; cursor: pointer;
  padding: .58rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted); font: inherit; font-size: .88rem; text-align: left;
}
.dtpick.has-value .dt-field { color: var(--ink); }
.dt-field:hover { border-color: var(--brand); }
.dt-field[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.dt-field > b { flex: 1; font-weight: 500; }
.dt-field .ico { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.dt-field .caret { width: 15px; height: 15px; }
.dt-field[aria-expanded="true"] .caret { transform: rotate(180deg); }

.dt-pop {
  position: absolute; z-index: 50; top: calc(100% + .4rem); left: 0; width: 268px;
  padding: .6rem; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); box-shadow: 0 18px 44px rgba(16, 24, 40, .18);
}
.dt-head { display: flex; align-items: center; gap: .4rem; padding: .1rem .1rem .45rem; }
.dt-head b { flex: 1; text-align: center; font-size: .86rem; }
.dt-nav {
  width: 26px; height: 26px; cursor: pointer; line-height: 1; font-size: 1rem;
  border: 0; border-radius: 7px; background: none; color: var(--ink-2);
}
.dt-nav:hover { background: var(--surface-2); color: var(--ink); }

.dt-week, .dt-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dt-week span { text-align: center; font-size: .68rem; font-weight: 600; color: var(--muted); padding: .2rem 0; }
.dt-day {
  aspect-ratio: 1; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: 8px; background: none; color: var(--ink);
  font: inherit; font-size: .8rem;
}
.dt-day:hover { background: var(--surface-2); }
.dt-day.out { color: var(--muted); opacity: .5; }
.dt-day.today { box-shadow: inset 0 0 0 1px var(--brand); color: var(--brand); font-weight: 600; }
.dt-day.on { background: var(--brand); color: #fff; font-weight: 600; box-shadow: none; }

.dt-time {
  display: flex; align-items: center; gap: .4rem;
  margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--line-2);
}
.dt-time .ico { width: 16px; height: 16px; color: var(--muted); }
.dt-time select {
  flex: 1; font: inherit; font-size: .85rem; padding: .35rem .4rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.dt-colon { color: var(--muted); font-weight: 600; }
.dt-foot {
  display: flex; align-items: center; gap: .6rem; margin-top: .55rem;
  padding-top: .55rem; border-top: 1px solid var(--line-2);
}
.dt-foot .btn { margin-left: auto; }

.slot-block { display: grid; gap: .8rem; }
.slot-fields { display: grid; gap: .8rem; padding-left: 3.1rem; }
.lbl-note { font-weight: 400; color: var(--muted); }

.slot-photo { display: flex; align-items: flex-start; gap: 1rem; }
.slot-photo + .slot-photo { padding-top: 1rem; border-top: 1px solid var(--line-2); }
.slot-photo .avatar-lg { width: 72px; height: 72px; }
.slot-photo .avatar-lg .ico { width: 26px; height: 26px; }
.slot-photo-body { display: grid; gap: .5rem; min-width: 0; }
.slot-photo-title { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; }

.guest-slot { display: grid; gap: .7rem; padding-bottom: .2rem; }
.guest-slot + .guest-slot { padding-top: 1rem; border-top: 1px solid var(--line-2); }
.guest-slot-head { display: flex; align-items: center; gap: .55rem; font-size: .9rem; }

/* Cảnh báo khung đang xem không phải khung khách thấy */
.alert.not-default { align-items: center; }
.alert.not-default b { display: block; font-weight: 600; line-height: 1.45; }
.alert.not-default .btn { color: var(--ink); }

/* Logo trang khách: nhỏ lại và canh giữa cho gọn cột trái */

/* Ô chọn phông trong bảng điều khiển bố cục */
.rng.wide { grid-template-columns: 5.6rem 1fr 0; }
.rng.wide select { font-size: .8rem; padding: .35rem .5rem; }
.rng.wide > b { display: none; }

/* ---------------- chọn phông + tay cầm kéo kích thước ---------------- */
.font-pick { display: grid; gap: .4rem; padding: .1rem 0 .3rem; }
.font-pick input[type=search] {
  width: 100%; font: inherit; font-size: .82rem; padding: .4rem .55rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
}
.font-pick select {
  width: 100%; font-size: .82rem; padding: .25rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); background-image: none;
}
.font-pick optgroup { font-size: .74rem; color: var(--muted); }
.font-pick option { padding: .15rem .25rem; }
#fontVnWarn { color: var(--warn); }


/* ============================================================
   BỐ CỤC MỚI: form theo ô, tay cầm dễ thấy, ô nhập số, mobile
   ============================================================ */
.topbar-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.slot-card .card-head.slot-head { flex-wrap: wrap; gap: .5rem 1.1rem; }
.slot-card .card-head.slot-head h2 { margin-right: auto; }
.slot-fields .line {
  display: grid; grid-template-columns: 11.5rem 1fr; align-items: center; gap: .8rem;
}
.slot-fields .line.photo-line { align-items: start; }
.slot-photo { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.slot-photo .avatar-lg { width: 64px; height: 64px; }
.slot-photo .avatar-lg .ico { width: 24px; height: 24px; }

/* --- tay cầm trên khung xem thử: viền mảnh + nút tròn/thanh bo, kiểu Canva --- */
.handle {
  border: 1.5px solid transparent;
  background: transparent;
  box-shadow: none;
}
.handle:hover { border-color: rgba(124, 58, 237, .55); background: transparent; }
.handle-tag {
  position: absolute; left: 50%; top: -.35rem; transform: translate(-50%, -100%);
  font-size: .68rem; font-weight: 600; white-space: nowrap;
  background: var(--brand); color: #fff; padding: .1rem .4rem; border-radius: 5px;
  opacity: 0; transition: opacity .12s var(--ease); pointer-events: none;
}
.handle:hover .handle-tag, .handle.sel .handle-tag { opacity: 1; }
.handle.sel { border-color: #7c3aed; border-style: solid; background: transparent; }

.grip {
  position: absolute; background: #fff; border: 1px solid rgba(16, 24, 40, .28);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .28);
  opacity: 0; transition: opacity .12s var(--ease);
}
/* bốn góc: nút TRÒN nhỏ */
.grip.nw, .grip.ne, .grip.se, .grip.sw { width: 12px; height: 12px; border-radius: 50%; }
/* bốn cạnh: THANH bo tròn, dài theo chiều cạnh */
.grip.n, .grip.s { width: 22px; height: 7px; border-radius: 99px; }
.grip.e, .grip.w { width: 7px; height: 22px; border-radius: 99px; }

.handle:hover .grip, .handle.sel .grip { opacity: 1; }
.handle:not(:hover):not(.sel) .grip { pointer-events: none; }
.grip:hover { border-color: #7c3aed; }

.grip.n { top: -3.5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.grip.s { bottom: -3.5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.grip.e { right: -3.5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.grip.w { left: -3.5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.grip.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.grip.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.grip.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.grip.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.editor.pan-mode .grip, .editor.pan-mode .handle-tag { display: none; }
/* Đang cắt xén: viền ô đã do canvas vẽ rồi, khối HTML chỉ còn nhiệm vụ nhận chuột */
.editor.pan-mode .handle { border-color: transparent; background: transparent; box-shadow: none; }
.editor.pan-mode .handle:hover { background: transparent; }

/* --- ô nhập số --- */
.num { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr) 4.6rem auto; align-items: center; gap: .5rem; font-size: .82rem; }
.num .num-rng { width: 100%; margin: 0; }
.num > span { color: var(--ink-2); font-weight: 500; }
.num > i { font-style: normal; font-size: .76rem; color: var(--muted); width: 1rem; }
.num input[type=number] {
  width: 100%; font: inherit; font-size: .84rem; text-align: right;
  padding: .32rem .45rem; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.num input[type=number]:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

/* --- ô chọn màu --- */
.swatch-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem; font-size: .82rem; }
.swatch-row > span { color: var(--ink-2); font-weight: 500; }
.swatch {
  display: inline-flex; align-items: center; gap: .3rem;
  border: 1px solid var(--line); border-radius: 8px; padding: .16rem .16rem .16rem .18rem;
  background: var(--surface);
}
.swatch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.swatch-dot { display: inline-flex; cursor: pointer; }
.swatch input[type=color] {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer;
}
.swatch input[type=color]::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 6px; }
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
/* Gõ tay được mã màu, không phải chỉ bấm bảng chọn */
.swatch-hex {
  width: 6.2rem; border: 0; outline: none; background: none; padding: .1rem .2rem;
  font: inherit; font-size: .76rem; color: var(--ink);
  font-variant-numeric: tabular-nums; text-transform: uppercase;
}

.ctrl-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.ctrl-group input[type=search] {
  width: 100%; font: inherit; font-size: .82rem; padding: .38rem .55rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
}
.ctrl-group select {
  width: 100%; font-size: .82rem; padding: .38rem .5rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.ctrl-group select:focus { outline: 0; border-color: var(--brand); }

/* --- thanh bên thu gọn ở màn hình chỉnh bố cục (kiểu Canva) --- */
.side-slim .app { grid-template-columns: 64px 1fr; }
.side-slim .side { padding: .8rem .4rem; align-items: center; }
.side-slim .side-brand .brand-text,
.side-slim .side-brand em,
.side-slim .side-nav a span,
.side-slim .side-user,
.side-slim .side-logout span { display: none; }
.side-slim .side-brand .brand-lockup.wordmark img { width: 44px; }
.side-slim .side-nav { gap: .2rem; }
.side-slim .side-nav a,
.side-slim .side-logout {
  justify-content: center; padding: .55rem 0; gap: 0; font-size: 0;
}
.side-slim .side-nav a .ico, .side-slim .side-logout .ico { width: 20px; height: 20px; }
.side-slim .side-foot { justify-content: center; }
@media (max-width: 860px) {
  .side-slim .app { grid-template-columns: 1fr; }
  .side-slim .side { padding: .55rem .8rem; }
  .side-slim .side-nav a, .side-slim .side-logout { padding: .4rem .55rem; }
}

/* --- bảng chỉnh: cột dọc NEO SÁT thanh menu hệ thống, đúng chỗ Canva đặt ---
   Chọn một khối trên thiệp là bảng trượt ra, đúng nhóm điều khiển của khối đó.
   Bảng dùng position: fixed nên KHÔNG bị .card (overflow: hidden) cắt mất,
   và khi bảng mở thì phần nội dung tự dịch sang phải cho vừa. */
.editor-area { position: relative; }
/* Phóng khung xem thử bằng lăn chuột — chỉ phóng chỗ nhìn, không đổi bố cục */
.editor-area.zoomed { overflow: hidden; border-radius: var(--r); }
/* Dời chỗ nhìn bằng chuột phải -> không cần thanh cuộn */
.editor-area.panning, .editor-area.panning * { cursor: grabbing !important; }
.view-zoom {
  position: absolute; z-index: 20; top: .5rem; right: .5rem; cursor: pointer;
  padding: .3rem .6rem; border: 0; border-radius: 999px;
  background: rgba(16, 24, 40, .82); color: #fff; font: inherit; font-size: .72rem;
}
.view-zoom:hover { background: rgba(16, 24, 40, .95); }
.view-zoom[hidden] { display: none; }
/* Hộp gọn, cao vừa nội dung — KHÔNG kéo hết chiều cao màn hình. Nổi đè lên trên,
   không đẩy bố cục, giống hệt bảng công cụ của Canva. */
.ctrl-pop {
  position: fixed; z-index: 60; left: 78px; top: 74px;
  width: 384px; max-height: calc(100vh - 108px); overflow-y: auto;
  padding: .8rem .9rem 1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: 0 22px 52px rgba(16, 24, 40, .22);
}
.pop-head { display: flex; align-items: center; gap: .5rem; padding: .1rem .1rem .45rem; }
.pop-head b { font-size: .86rem; }
.pop-x {
  margin-left: auto; width: 24px; height: 24px; cursor: pointer; line-height: 1;
  border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 1.1rem;
}
.pop-x:hover { background: var(--surface-2); color: var(--ink); }

.pop-tabs {
  display: flex; gap: .15rem; margin-bottom: .6rem; padding-bottom: .45rem;
  border-bottom: 1px solid var(--line-2);
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.pop-tabs::-webkit-scrollbar { display: none; }
.ctab {
  flex: 0 0 auto; display: grid; justify-items: center; gap: .1rem; cursor: pointer;
  padding: .35rem .45rem; border: 0; border-radius: 8px;
  background: none; color: var(--ink-2); font: inherit; font-size: .66rem; font-weight: 500;
  line-height: 1.1; text-align: center;
}
.ctab .ico { width: 17px; height: 17px; }
.ctab:hover { background: var(--surface-2); color: var(--ink); }
.ctab.on { background: var(--brand); color: #fff; font-weight: 600; }
.ctab.on .ico { color: #fff; }
.ctrls { min-width: 0; }
.ctrl-panel { display: grid; gap: .8rem; }

/* Điện thoại: thanh bên nằm ngang trên cùng -> hộp bám sát mép trái, hẹp lại */
@media (max-width: 860px) {
  .ctrl-pop { left: .6rem; right: .6rem; width: auto; max-width: 340px; top: 4.6rem; }
}

/* Trong bảng nổi hẹp: nhãn một dòng riêng, thanh kéo + ô số một dòng -> không
   dòng nào bị xuống hàng lộn xộn, thanh kéo cũng đủ dài để kéo. */
.ctrl-pop .num {
  grid-template-columns: 6.4rem minmax(0, 1fr) 4.2rem auto;
  grid-template-areas: 'lbl rng num unit';
  gap: .5rem;
}
.ctrl-pop .num > span { grid-area: lbl; }
.ctrl-pop .num > .num-rng { grid-area: rng; }
.ctrl-pop .num > input[type=number] { grid-area: num; }
.ctrl-pop .num > i { grid-area: unit; }
.ctrl-pop .swatch-row, .ctrl-pop .style-row { gap: .4rem; }
.ctrl-pop .ctrl-group { padding: .6rem .65rem; }
.ctrl-pop .fit-row { gap: .7rem; }

/* nút biểu tượng nhỏ (mũi tên xổ / thu) */
.icon-btn {
  display: grid; place-items: center; width: 28px; height: 28px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn .ico { width: 16px; height: 16px; transition: transform .15s var(--ease); }
.icon-btn.up .ico { transform: rotate(180deg); }

/* nút căn chỉnh đang khớp thì tô nền cho biết */
.abtn.on { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.abtn.on .ico { opacity: 1; }

/* --- ô chọn phông (component tự dựng) --- */
.fontpick { position: relative; }
.fontpick-btn {
  width: 100%; display: flex; align-items: center; gap: .6rem; cursor: pointer;
  padding: .5rem .65rem; border-radius: var(--r-sm); text-align: left;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
}
.fontpick-btn:hover { border-color: var(--brand); }
.fontpick-btn[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.fp-main { display: grid; gap: .1rem; min-width: 0; flex: 1; }
.fp-main b { font-size: .84rem; font-weight: 600; }
.fp-main em { font-style: normal; font-size: 1rem; color: var(--ink-2); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-caret { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); }
.fontpick-btn[aria-expanded="true"] .fp-caret { transform: rotate(180deg); }

.fontpick-pop {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + .35rem);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 22rem; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); box-shadow: 0 14px 38px rgba(15, 23, 42, .16);
}
.fp-search { padding: .55rem .55rem .4rem; border-bottom: 1px solid var(--line-2); }
.fp-search input {
  width: 100%; font: inherit; font-size: .84rem; padding: .4rem .55rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.fp-search input:focus { outline: 0; border-color: var(--brand); }
.fontpick-list { overflow-y: auto; padding: .3rem; }
.fp-group {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: .45rem .55rem .25rem;
}
.fp-item {
  width: 100%; display: grid; gap: .05rem; cursor: pointer; text-align: left;
  padding: .4rem .55rem; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit;
}
.fp-item b { font-size: .74rem; font-weight: 600; color: var(--muted); }
.fp-item em { font-style: normal; font-size: 1.02rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-item .fp-novn { font-style: normal; font-size: .66rem; color: var(--danger); font-family: 'Be Vietnam Pro', system-ui, sans-serif; }
.fp-item:hover { background: var(--surface-2); }
.fp-item.on { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.fp-item.on b { color: var(--brand); }
.fp-empty { padding: 1rem .6rem; text-align: center; font-size: .82rem; color: var(--muted); }
.fp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  flex-wrap: wrap; padding: .5rem .6rem; border-top: 1px solid var(--line-2); background: var(--surface-2);
}

/* --- phông riêng tải lên --- */
.ownfont {
  margin-top: .6rem; padding: .6rem .65rem .55rem; border-radius: 12px;
  border: 1px dashed var(--line-2); background: var(--surface-2);
}
.ownfont-head { display: grid; gap: .1rem; margin-bottom: .45rem; }
.ownfont-head b { font-size: .82rem; }
.ownfont-list { display: grid; gap: 4px; margin: 0 0 .5rem; padding: 0; list-style: none; }
.ownfont-list li {
  display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem;
  border-radius: 9px; background: var(--surface); border: 1px solid var(--line);
}
.ownfont-list li b { flex: 1; min-width: 0; font-size: .85rem; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ownfont-empty { font-size: .78rem; color: var(--muted); padding: .1rem 0; }
.ownfont-del {
  border: 0; background: none; cursor: pointer; padding: .1rem .3rem;
  font-size: .76rem; color: var(--muted); border-radius: 6px;
}
.ownfont-del:hover { color: var(--danger, #e5484d); background: color-mix(in srgb, currentColor 12%, transparent); }
.ownfont-add { display: flex; flex-wrap: wrap; gap: .4rem; }
.ownfont-add input[type="text"] { flex: 1 1 10rem; min-width: 0; }

/* --- danh sách lớp: kéo thả đổi thứ tự --- */
.layer-list { display: grid; gap: 3px; margin: .1rem 0 .4rem; padding: 0; list-style: none; }
.layer-row {
  position: relative; display: flex; align-items: center; gap: .5rem; cursor: grab;
  padding: .45rem .55rem; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: .8rem; color: var(--ink-2);
}
.layer-grip { color: var(--muted); font-size: .9rem; line-height: 1; letter-spacing: -.1em; }
.layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-row:hover { border-color: var(--brand); color: var(--ink); }
.layer-row.on { background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.layer-row.dragging { opacity: .45; cursor: grabbing; }
.layer-row.fixed { cursor: default; opacity: .72; }
.layer-row.fixed:hover { border-color: var(--line); }
.layer-row.bg {
  cursor: grab; background: var(--surface-2); border-style: dashed; color: var(--ink-2); font-weight: 600;
}
/* vạch chỉ chỗ sắp thả */
.layer-row.drop-before::before, .layer-row.drop-after::after {
  content: ''; position: absolute; left: 0; right: 0; height: 2px;
  border-radius: 2px; background: var(--brand);
}
.layer-row.drop-before::before { top: -3px; }
.layer-row.drop-after::after { bottom: -3px; }

/* --- đậm / nghiêng --- */
.style-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem; font-size: .82rem; }
.style-row > span { color: var(--ink-2); font-weight: 500; }
.style-btns { display: inline-flex; gap: .3rem; }
.sbtn {
  width: 30px; height: 28px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: .92rem; line-height: 1; font-family: Georgia, 'Times New Roman', serif;
}
.sbtn.bold { font-weight: 800; }
.sbtn.ital { font-style: italic; }
.sbtn:hover { border-color: var(--brand); color: var(--ink); }
.sbtn.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* --- mobile --- */
@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: stretch; gap: .6rem; }
  .topbar-actions { justify-content: flex-start; }
  .topbar-actions .btn { flex: 1; }
  .slot-fields .line { grid-template-columns: 1fr; gap: .45rem; }
  .slot-fields .line > .switch { justify-self: start; }
  .num { grid-template-columns: 5.2rem minmax(0, 1fr) 3.6rem auto; gap: .35rem; font-size: .78rem; }
  .card-head { flex-wrap: wrap; gap: .5rem; }
  .tabs { gap: .1rem; }
  .tab { padding: .5rem .5rem; font-size: .8rem; }
  .content { padding: .9rem .8rem 3rem; }
  .card-body { padding: .85rem; }
  .ctrls { gap: .6rem; }
  .grip { width: 20px; height: 20px; }
  .grip.e, .grip.ne, .grip.se { right: -10px; }
  .grip.w, .grip.nw, .grip.sw { left: -10px; }
  .grip.s, .grip.se, .grip.sw { bottom: -10px; }
  .grip.n, .grip.nw, .grip.ne { top: -10px; }
  /* Thanh bên trên di động: gọn lại, khỏi chiếm nửa màn hình */
  .side { padding: .55rem .8rem; gap: .5rem; }
  .side-brand .brand-lockup.wordmark img { width: 92px; }
  .side-brand .brand-lockup.wordmark em { display: none; }
  .side { flex-wrap: nowrap; overflow-x: auto; }
  .side-nav { flex-wrap: nowrap; gap: .15rem; }
  .side-nav a { padding: .4rem .55rem; font-size: .84rem; white-space: nowrap; }
  .side-foot { flex: 0 0 auto; }
  .side-logout { font-size: .84rem; white-space: nowrap; }
}
