/* ===== Gia phả trực tuyến — giao diện ===== */
:root {
  --bg: #fcf8f0; --paper: #fffaf1; --paper2: #fcf1dd; --line: #ecdcb6; --line2: #dcc28a; --gold: #b98d3c;
  --primary: #d2582b; --primary-d: #b4441c; --primary-l: #fbe5d8; --brown: #6b3a1e; --brown-d: #4e2912;
  --green: #3f6b3c; --text: #2d2219; --muted: #7c6b58;
  --ok: #2f8a57; --ok-l: #dcf3e5; --pink: #c2408f; --pink-l: #fde3f2; --blue: #2f78b7; --blue-l: #dcecfb; --yellow-l: #fbf0c6;
  --f-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif; --f-serif: 'Noto Serif', Georgia, serif; --f-script: 'Dancing Script', cursive;
  --shadow: 0 2px 10px rgba(80, 50, 20, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--f-body); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-d); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; color: inherit; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: rgba(185, 141, 60, .12); padding: 1px 5px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--f-serif); margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .c { text-align: center; } .accent { color: var(--primary-d); }
.spacer { flex: 1; }
.boot { padding: 80px; text-align: center; color: var(--muted); font-family: var(--f-serif); }

.parchment {
  background-color: #f6ebd3;
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(255, 255, 255, .45), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(190, 150, 80, .14), transparent 50%),
    radial-gradient(ellipse at 60% 10%, rgba(200, 160, 90, .08), transparent 40%),
    repeating-linear-gradient(45deg, rgba(160, 120, 60, .025) 0 2px, transparent 2px 7px);
}
.ornate { position: relative; background-color: var(--paper); border: 1px solid var(--line2); border-radius: 3px; }
.ornate::before {
  content: ""; position: absolute; inset: 6px; pointer-events: none; z-index: 1;
  background:
    linear-gradient(var(--gold), var(--gold)) top left / 14px 2px, linear-gradient(var(--gold), var(--gold)) top left / 2px 14px,
    linear-gradient(var(--gold), var(--gold)) top right / 14px 2px, linear-gradient(var(--gold), var(--gold)) top right / 2px 14px,
    linear-gradient(var(--gold), var(--gold)) bottom left / 14px 2px, linear-gradient(var(--gold), var(--gold)) bottom left / 2px 14px,
    linear-gradient(var(--gold), var(--gold)) bottom right / 14px 2px, linear-gradient(var(--gold), var(--gold)) bottom right / 2px 14px;
  background-repeat: no-repeat;
}
.orn { display: flex; align-items: center; width: 120px; margin: 4px 0 12px; }
.orn::before, .orn::after { content: ""; flex: 1; height: 1px; background: var(--gold); }
.orn b { width: 7px; height: 7px; background: var(--primary); transform: rotate(45deg); margin: 0 5px; }
.orn-c { margin-left: auto; margin-right: auto; width: 180px; }

/* ----- Nút ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 3px; border: 1px solid var(--line2); background: #fff; color: var(--primary-d); font-weight: 600; font-size: 13px; white-space: nowrap; text-decoration: none !important; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--paper2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary-d); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45), 0 1px 2px rgba(0, 0, 0, .15); }
.btn-primary:hover { background: var(--primary-d); }
.btn-outline { background: #fff; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--line); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(185, 141, 60, .12); color: var(--primary-d); }
.btn-link { background: none; border: 0; color: var(--muted); font-weight: 400; padding-left: 0; }
.btn-link:hover { background: none; text-decoration: underline; }
.btn-danger { background: #b3261e; color: #fff; border-color: #8c1c16; }
.btn-danger:hover { background: #8c1c16; }
.btn-danger-o { background: #fff; color: #b3261e; border-color: #e3a29d; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #f1c9c5; }
.btn-danger-o:hover { background: #fdeceb; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn.on { background: var(--primary-l); border-color: var(--primary); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.kebab { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 50%; color: var(--muted); }
.kebab:hover { background: rgba(185, 141, 60, .15); color: var(--text); }

/* ----- Badge, chip ----- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; border: 1px solid; white-space: nowrap; vertical-align: middle; font-family: var(--f-body); }
.b-red { color: var(--primary-d); background: var(--primary-l); border-color: #f2b9a0; }
.b-gold { color: #7a5516; background: #fbf0d6; border-color: var(--line2); }
.b-yellow { color: #7a5c00; background: var(--yellow-l); border-color: #e5cd6c; }
.b-green { color: var(--ok); background: var(--ok-l); border-color: #a6dbbb; }
.b-gray { color: #554b42; background: #efebe5; border-color: #d4ccc1; }
.b-pink { color: var(--pink); background: var(--pink-l); border-color: #f0b3d7; }
.b-blue { color: var(--blue); background: var(--blue-l); border-color: #a8cdf0; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid var(--line2); background: #fff; padding: 5px 12px; border-radius: 20px; font-size: 13px; }
.chip small { color: var(--muted); margin-left: 3px; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary-d); }
.chip.on small { color: #ffe3d6; }

/* ----- Form ----- */
input, select, textarea { font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line2); border-radius: 4px; padding: 7px 10px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(210, 88, 43, .14); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; padding: 0; }
textarea { resize: vertical; }
select { padding-right: 26px; }
.fg { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: #4d3f31; min-width: 0; }
.fg input, .fg select, .fg textarea { font-weight: 400; font-size: 14px; width: 100%; }
.fg small { font-weight: 400; }
.chk-line { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; padding-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid.g1 { grid-template-columns: 1fr; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.seg { display: flex; gap: 18px; padding: 6px 0; font-weight: 500; }
.seg label { display: flex; gap: 6px; align-items: center; }
.switch { position: relative; display: inline-block; width: 38px; height: 21px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d8cfc2; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(17px); }
.search-box { position: relative; display: flex; align-items: center; }
.search-box > i { position: absolute; left: 10px; color: var(--muted); font-size: 13px; pointer-events: none; }
.search-box input { padding-left: 30px; width: 240px; }
.search-drop { position: absolute; top: calc(100% + 4px); right: 0; width: 300px; max-height: 360px; overflow: auto; background: #fff; border: 1px solid var(--line2); border-radius: 6px; box-shadow: 0 8px 26px rgba(60, 40, 20, .18); z-index: 30; padding: 4px; }
.search-drop button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 4px; text-align: left; }
.search-drop button:hover { background: var(--paper2); }
.search-drop span { display: flex; flex-direction: column; }
.search-drop small { color: var(--muted); }

/* ----- Ảnh đại diện ----- */
.ava { border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; }
.ava-empty { background: #cfd4da; color: #fff; align-items: center; justify-content: center; font-size: 60%; }
.ava-empty i { font-size: 1.6em; }
.ava-m { background: #a9c9e8; } .ava-f { background: #ebb3d3; }

/* ===================== QUẢN TRỊ ===================== */
.adm { display: flex; min-height: 100vh; }
.sb { width: 215px; flex: none; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; border-right: 1px solid var(--line2); z-index: 40; overflow-y: auto; }
.sb::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(185, 141, 60, .45); pointer-events: none; }
.sb-logo { display: flex; gap: 10px; align-items: center; padding: 16px 16px 12px; margin: 8px 8px 4px; border-bottom: 1px solid var(--line2); text-decoration: none !important; }
.seal { width: 40px; height: 40px; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e9b949, #b07d1e); color: #7a1010; display: flex; align-items: center; justify-content: center; font: 700 22px/1 serif; box-shadow: inset 0 0 0 2px #fff3c4, 0 0 0 1px #9a6a1c; }
.sb-logo-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sb-logo-txt b { font-family: var(--f-serif); color: #9b5a12; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.sb-logo-txt small { font-family: var(--f-script); color: var(--green); font-size: 15px; }
.sb-nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.sb-nav a { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 7px; color: var(--text); font-weight: 500; border: 1px solid transparent; text-decoration: none; position: relative; z-index: 2; }
.sb-nav a i { width: 16px; text-align: center; color: #5d4a36; }
.sb-nav a:hover { background: rgba(255, 255, 255, .45); }
.sb-nav a.active { background: #f0dcaf; border-color: var(--line2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); font-weight: 600; }
.sb-group { display: flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: #9b7a3e; margin: 14px 12px 4px; }
.sb-group::after { content: ""; flex: 1; height: 1px; background: rgba(185, 141, 60, .5); }
.sb-foot { margin-top: auto; padding: 14px 20px 22px; font-size: 11.5px; color: var(--muted); position: relative; z-index: 2; }
.sb-mask { display: none; }
.adm-main { margin-left: 215px; flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.adm-top { position: sticky; top: 0; z-index: 30; display: flex; gap: 10px; align-items: center; padding: 9px 22px; background: rgba(252, 248, 240, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.sb-burger { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.uava { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
#adm-page { padding: 20px 22px 40px; flex: 1; }
.adm-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 8px; border-top: 1px solid var(--line); background: #fbf3e3; }

.page-head h1 { font-family: var(--f-script); font-weight: 700; font-size: 40px; color: var(--green); line-height: 1.1; }
.page-head .orn { margin: 2px 0 6px; }
.page-head p { margin: 0 0 16px; color: #5b4c3d; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .sep { width: 1px; height: 24px; background: var(--line2); margin: 0 2px; }
.tree-sel { min-width: 220px; }
.panel { padding: 18px 20px; }
.panel h3 { font-size: 17px; color: var(--primary-d); font-weight: 700; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; }
.panel-h a { font-weight: 700; font-size: 13px; position: relative; z-index: 2; }
.note { padding: 12px 18px; margin-top: 16px; font-size: 13px; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty > i { font-size: 38px; color: var(--line2); }

/* Tổng quan */
.hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; padding: 26px 30px; margin-bottom: 16px; border-width: 2px; }
.hero-r { border-left: 1px solid var(--line2); padding-left: 28px; }
.kicker { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: #8a6a3a; font-weight: 700; }
.clan { font-size: 34px; color: var(--green); font-weight: 800; margin-top: 2px; }
.hero .orn-c { margin-left: 40px; }
.big-count { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; }
.big-count b { font: 800 58px/1 var(--f-serif); color: var(--green); }
.big-count span { font: 700 17px var(--f-serif); letter-spacing: 2px; color: #6b5a2f; display: flex; flex-direction: column; }
.big-count em { font: italic 400 14px var(--f-body); letter-spacing: 0; color: var(--primary-d); }
.hero-meta { display: flex; justify-content: space-between; gap: 16px; border-top: 1px dashed var(--line2); padding-top: 10px; }
.hero-meta small { display: block; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: #8a6a3a; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { display: flex; justify-content: space-between; padding: 16px 18px; color: inherit; text-decoration: none !important; transition: transform .15s; }
.stat:hover { transform: translateY(-2px); }
.stat small { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; color: #6b5a44; }
.stat b { display: block; font: 800 28px/1.2 var(--f-serif); color: var(--primary-d); }
.stat em { font-style: normal; font-size: 12px; color: var(--muted); }
.stat-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-l); border: 1px solid #f2b9a0; color: var(--primary-d); display: flex; align-items: center; justify-content: center; }
.dash-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.list .li:last-child { border-bottom: 0; }
.li-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-l); border: 1px solid #f2b9a0; color: var(--primary-d); display: flex; align-items: center; justify-content: center; flex: none; }
.li-b { flex: 1; min-width: 0; }
.li > a { font-weight: 700; font-size: 13px; }
.date-tile { width: 44px; flex: none; text-align: center; border: 1px solid var(--line2); border-radius: 4px; background: #fff; overflow: hidden; }
.date-tile b { display: block; font: 800 18px/1.3 var(--f-serif); color: var(--primary-d); }
.date-tile small { display: block; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; }

/* Gia phả cards */
.tree-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tcard { padding: 22px 18px 18px; text-align: center; }
.tcard h3 { font-size: 19px; color: var(--green); font-weight: 800; padding: 0 20px; }
.tcard p { margin: 0 0 10px; }
.tcard .kebab { position: absolute; top: 12px; right: 12px; z-index: 2; }
.tc-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 14px 0; background: var(--paper2); border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.tc-stats div { padding: 10px; } .tc-stats div + div { border-left: 1px solid var(--line2); }
.tc-stats b { display: block; font: 800 24px var(--f-serif); color: var(--primary-d); }
.tc-stats small { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; color: #6b5a44; }
.tc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 2; }

/* Bảng */
.tbl-panel { padding: 0; }
.tbl-panel::before { display: none; }
.tbl-tools { display: flex; gap: 10px; align-items: center; padding: 12px 14px; flex-wrap: wrap; }
.tbl-tools label { display: flex; gap: 8px; align-items: center; color: #5b4c3d; }
.tbl-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { background: #fbefd9; text-align: left; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: #5b4630; padding: 10px 14px; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tbl td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: #fffdf8; }
.tbl .c { text-align: center; }
.who { display: flex; gap: 10px; align-items: center; }
.who a { color: var(--text); }
.who .badge { margin-left: 4px; font-size: 10.5px; padding: 0 7px; }
.thumb { width: 52px; height: 40px; border: 1px solid var(--line2); border-radius: 4px; overflow: hidden; flex: none; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ok-t { color: var(--ok); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; gap: 8px; }
.pager-btns { display: flex; gap: 4px; }
.pg { min-width: 30px; height: 30px; border: 1px solid var(--line2); background: #fff; border-radius: 4px; }
.pg.active { background: var(--primary); color: #fff; border-color: var(--primary-d); }
.pg:disabled { opacity: .4; cursor: default; }
.pg-gap { padding: 4px; }
.tabs { display: flex; gap: 4px; padding: 6px 14px 0; border-bottom: 1px solid var(--line2); }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: #5b4c3d; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--primary-d); border-color: var(--primary); }

/* Phả đồ */
.ft-wrap { position: relative; height: calc(100vh - 290px); min-height: 460px; overflow: hidden; border-width: 2px; border-color: var(--gold); box-shadow: inset 0 0 0 6px #f6ebd3, inset 0 0 0 7px var(--line2); }
.ft-canvas { position: absolute; inset: 0; }
.ft-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.ft-svg.dragging { cursor: grabbing; }
.ft-card { cursor: pointer; }
.ft-card:hover rect:first-of-type { filter: brightness(1.04); }
.ft-tog { cursor: pointer; }
.ft-legend { position: absolute; left: 16px; bottom: 12px; display: flex; gap: 12px; font-size: 11.5px; color: #5b4c3d; background: rgba(255, 250, 241, .9); padding: 4px 10px; border-radius: 4px; border: 1px solid var(--line); z-index: 2; flex-wrap: wrap; }
.ft-legend span { display: inline-flex; gap: 5px; align-items: center; }
.ft-legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; border: 1px solid; }
.ft-legend b { border: 1px solid #5c9bd6; background: #fff; font-size: 9px; padding: 0 3px; border-radius: 2px; }
.lg-m { background: #d3e8fb; border-color: #5c9bd6 !important; } .lg-f { background: #fbd6ee; border-color: #d47ab3 !important; }
.lg-d { background: linear-gradient(135deg, #2d2219 45%, #fff 45%); border-color: #999 !important; }
.ft-panel { position: absolute; top: 18px; right: 18px; bottom: 18px; width: 300px; background: #fffaf1; border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 8px 28px rgba(60, 40, 20, .2); overflow-y: auto; z-index: 5; }
.fp-head { display: flex; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.fp-head img { width: 56px; height: 64px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line2); }
.fp-head h3 { font-size: 16px; color: var(--brown); }
.fp-x { margin-left: auto; align-self: flex-start; border: 0; background: none; font-size: 18px; color: var(--muted); }
.fp-rows { padding: 8px 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed #efe2c4; font-size: 13px; }
.kv span { color: var(--muted); flex: none; }
.kv b { font-weight: 500; text-align: right; }
.fp-btns { display: flex; flex-direction: column; gap: 8px; padding: 8px 14px 16px; }
.fp-btns .btn { justify-content: flex-start; color: var(--text); font-weight: 500; }
.fp-btns .btn i { color: var(--primary); width: 16px; }
.fp-btns .btn-danger-o { justify-content: center; color: #b3261e; font-weight: 600; }
.fp-btns .btn-danger-o i { color: #b3261e; }
.ft-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); }
.ft-empty > i { font-size: 44px; color: var(--green); }
.ft-empty h3 { color: var(--green); }

/* In phả đồ */
body.print-mode .sb, body.print-mode .adm-top, body.print-mode .adm-foot { display: none; }
body.print-mode .adm-main { margin-left: 0; }
body.print-mode #adm-page { padding: 12px 16px; }
.pv-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.pv-head h2 { color: var(--brown); font-size: 20px; }
.pv-tools select { padding: 6px 10px; font-size: 13px; }
.pv-hint { font-size: 12px; color: #5b4c3d; margin: -4px 0 8px; }
.pv-hint i { color: var(--primary); }
.pv-wrap { height: calc(100vh - 165px); background: #efe4cc; border: 1px solid var(--line2); box-shadow: none; }

/* Hồ sơ */
.prof-top { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.prof-photo img, .prof-photo .ava { width: 100px; height: 112px; border-radius: 6px; object-fit: cover; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.prof-photo .ava { border-radius: 6px; font-size: 34px; }
.prof-top h2 { font-size: 24px; color: var(--brown-d); }
.prof-title { color: var(--primary-d); font-weight: 600; margin: 2px 0; }
.prof-top .chips { margin: 8px 0; }
.prof-dates { font-size: 13.5px; }
.prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pbox { border: 1px solid var(--line2); border-radius: 6px; padding: 12px 14px; background: #fffdf8; }
.pbox.wide { grid-column: 1 / -1; }
.pbox h4 { font-size: 15px; margin-bottom: 6px; color: var(--brown-d); }
.pbox .kv b a { font-weight: 600; }
.sp-item { padding: 4px 0; } .sp-item i { color: var(--primary); }
.bio { white-space: normal; line-height: 1.65; }

/* Form thành viên */
.mform-top { display: flex; gap: 18px; margin-bottom: 14px; }
.mform-top .form-grid { flex: 1; }
.photo-pick { width: 112px; flex: none; text-align: center; }
.pp-img { width: 112px; height: 124px; border: 1px dashed var(--line2); border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #fff; }
.pp-img img { width: 100%; height: 100%; object-fit: cover; }
.pp-img .ava { border-radius: 4px; font-size: 32px; }
.pp-btns { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--primary-d); margin-bottom: 10px; }

/* Bài viết */
.cover-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.cover-prev { width: 120px; height: 68px; border: 1px dashed var(--line2); border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; }
.cover-prev img { width: 100%; height: 100%; object-fit: cover; }
.rte { border: 1px solid var(--line2); border-radius: 4px; background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #fbf3e3; position: sticky; top: -18px; z-index: 2; }
.rte-bar button { width: 32px; height: 30px; border: 1px solid transparent; background: none; border-radius: 3px; color: #5b4630; }
.rte-bar button:hover { background: #fff; border-color: var(--line2); }
.rte-area { min-height: 320px; padding: 14px 18px; outline: none; }
.article { line-height: 1.75; font-size: 15.5px; }
.article h2 { font-size: 21px; color: var(--brown); margin: 1em 0 .4em; }
.article img { max-width: 100%; height: auto; border-radius: 4px; }
.article table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14px; }
.article th, .article td { border: 1px solid var(--line2); padding: 6px 10px; }
.article th { background: #fbefd9; }

/* Sự kiện, thư viện, cấu hình */
.conv { padding: 6px 10px; background: var(--paper2); border-radius: 4px; min-height: 30px; font-weight: 500; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gitem { margin: 0; padding: 8px; overflow: hidden; }
.gitem::before { display: none; }
.gitem img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border-radius: 2px; cursor: zoom-in; }
.gitem figcaption { padding: 8px 2px 2px; display: flex; flex-direction: column; }
.gitem figcaption small { color: var(--muted); }
.g-act { position: absolute; top: 14px; right: 14px; display: flex; gap: 4px; opacity: 0; transition: .15s; }
.gitem:hover .g-act { opacity: 1; }
.g-act button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(20, 12, 5, .92); display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; text-align: center; max-width: 90vw; }
.lightbox img { max-width: 90vw; max-height: 84vh; border-radius: 4px; }
.lightbox figcaption { color: #f3e3c3; margin-top: 10px; }
.lightbox button { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 18px; }
.lb-x { top: 20px; right: 20px; } .lb-p { left: 20px; } .lb-n { right: 20px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cfg-grid .panel h3, .sys-grid .panel h3 { margin-bottom: 0; }
.banner-prev { margin-top: 12px; background: #f6ebd3; border-radius: 6px; border: 1px solid var(--line); }
.banner-prev svg { width: 100%; display: block; }
.cfg-home { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }
.hero-prev { aspect-ratio: 16/10; border-radius: 6px; overflow: hidden; border: 1px solid var(--line2); }
.hero-prev img, .hero-prev svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.save-bar { display: flex; justify-content: flex-end; margin-top: 14px; }
.menu-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; position: relative; z-index: 2; }
.menu-row { display: flex; gap: 12px; align-items: center; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.menu-label { width: 200px; }
.nav-preview { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 16px; }
.menu-panel { max-width: 860px; }
.menu-panel .toolbar, .menu-panel .save-bar { position: relative; z-index: 2; }
.sys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sys-grid .panel > *, .cfg-grid .panel > * { position: relative; z-index: 2; }
.steps { padding-left: 20px; line-height: 1.9; }
.danger-zone h3 { color: #b3261e !important; }

/* Nhập Excel */
.imp-step { display: flex; gap: 16px; align-items: center; padding: 14px 16px; }
.imp-step::before { display: none; }
.imp-step p { margin: 4px 0 0; }
.imp-btns { display: flex; gap: 8px; flex: none; }
.imp-result { margin-top: 12px; }
.imp-err { background: #fdeceb; border: 1px solid #f1c9c5; color: #8c1c16; padding: 10px 14px; border-radius: 6px; max-height: 260px; overflow: auto; }
.imp-err ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.imp-ok { background: var(--ok-l); border: 1px solid #a6dbbb; color: #1f6b40; padding: 10px 14px; border-radius: 6px; }

/* ----- Hộp thoại ----- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(40, 25, 10, .5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.modal-bg.closing { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--paper); border-radius: 12px; box-shadow: 0 20px 60px rgba(30, 15, 0, .35); width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-sm { max-width: 460px; } .modal-md { max-width: 720px; } .modal-lg { max-width: 900px; } .modal-xl { max-width: 1100px; }
.modal-head { background: var(--brown); color: #fbe7c4; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 18px; color: #fbe7c4; }
.modal-head .sub { font-size: 12px; color: #e6caa0; margin-top: 2px; }
.modal-x { border: 0; background: none; color: #fbe7c4; font-size: 18px; width: 32px; height: 32px; border-radius: 50%; }
.modal-x:hover { background: rgba(255, 255, 255, .12); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; background: #fffdf8; }
.confirm-msg { margin: 4px 0; font-size: 15px; }

/* Hướng dẫn */
.g-bar { height: 5px; background: #f3e4c4; border-radius: 4px; overflow: hidden; }
.g-bar i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.g-steps { display: flex; justify-content: space-between; margin: 14px 0 18px; }
.g-step { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); flex: 1; }
.g-step b { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line2); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.g-step.on { color: var(--primary-d); font-weight: 700; }
.g-step.on b, .g-step.done b { background: var(--primary); color: #fff; border-color: var(--primary-d); }
.g-ic { width: 70px; height: 70px; border-radius: 50%; margin: 0 auto; background: var(--primary-l); border: 2px solid #f2b9a0; box-shadow: 0 0 0 4px #fff, 0 0 0 5px #f2b9a0; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--primary); }
.g-kick { text-align: center; margin-top: 14px; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: #8a6a3a; font-weight: 700; }
.g-h { text-align: center; font-size: 26px; color: var(--green); font-weight: 800; }
.g-t { text-align: center; max-width: 520px; margin: 8px auto 16px; color: #4d3f31; }
.g-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-card { background: #fdf0db; border: 1px solid var(--line2); border-radius: 6px; padding: 12px 14px; }
.g-card b i { color: var(--primary); }
.g-card p { margin: 6px 0; font-size: 13px; }

/* Menu ba chấm, thông báo */
.popmenu { position: fixed; z-index: 150; min-width: 200px; background: #fff; border: 1px solid var(--line2); border-radius: 6px; box-shadow: 0 10px 30px rgba(50, 30, 10, .2); padding: 4px; }
.popmenu button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 8px 12px; border-radius: 4px; text-align: left; font-size: 13.5px; }
.popmenu button i { width: 16px; color: var(--muted); }
.popmenu button:hover { background: var(--paper2); }
.popmenu button.danger, .popmenu button.danger i { color: #b3261e; }
.popmenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: center; background: #2d2219; color: #fff; padding: 11px 16px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: 420px; animation: pop .2s; transition: .3s; }
.toast.out { opacity: 0; transform: translateX(20px); }
.toast-ok i { color: #7ee2a8; } .toast-error { background: #8c1c16; } .toast-info i { color: #ffd479; }

/* ===================== WEBSITE ===================== */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.band { height: 16px; background-color: #e9c46a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 13h6V3h12v8h-6V7h-2v6h12V3h8' fill='none' stroke='%23a3741d' stroke-width='2'/%3E%3C/svg%3E"); border-bottom: 2px solid #b98d3c; }
.s-head { text-align: center; padding: 10px 16px 6px; }
.s-banner { display: flex; align-items: center; justify-content: center; gap: 10px; }
.s-banner-svg { display: block; width: min(600px, 70vw); }
.s-banner-svg svg { width: 100%; display: block; }
.cloud-cluster { width: min(200px, 16vw); }
.cloud-cluster.flip { transform: scaleX(-1); }
.site-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 6px 0 18px; }
.site-nav a, .pill { font: 700 21px/1 var(--f-script); color: var(--green); padding: 9px 26px; border-radius: 50px; background: #fff6e0; border: 2px solid #d6b45e; box-shadow: inset 0 0 0 2px #fff6e0, inset 0 0 0 3px #e9cf8c, 0 2px 4px rgba(120, 80, 20, .15); text-decoration: none !important; transition: .15s; }
.site-nav a:hover { background: #fdecc0; }
.site-nav a.active { background: linear-gradient(#f2d27a, #d9ac45); color: #3b4f1a; border-color: #b58a2c; box-shadow: inset 0 0 0 2px #f8e3a6, 0 2px 6px rgba(120, 80, 20, .3); }
.s-burger { display: none; }
#site-main { flex: 1; }
.s-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }
.s-wrap.wide { max-width: 1500px; }
.s-wrap.narrow { max-width: 860px; }
.ribbon { text-align: center; margin: 28px 0 18px; }
.ribbon span { display: inline-block; position: relative; font: 700 26px/1 var(--f-script); color: #fff; background: var(--green); padding: 10px 40px 12px; clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%); text-shadow: 0 1px 2px rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.intro { display: grid; grid-template-columns: 1fr 1.25fr; gap: 26px; align-items: center; padding-top: 6px; }
.intro-img { border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(70, 40, 10, .3); aspect-ratio: 16/11; }
.intro-img img, .intro-img svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.intro-txt .ribbon { margin-top: 0; }
.intro-txt p { text-align: justify; line-height: 1.75; margin: 0 0 10px; }
.s-stats { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 30px 0 0; padding: 16px; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.s-stats div { text-align: center; padding: 0 22px; border-right: 1px solid var(--line2); }
.s-stats b { display: block; font: 800 30px var(--f-serif); color: var(--primary-d); }
.s-stats span { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #6b5a44; font-weight: 700; }
.ev-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.evc { display: flex; gap: 14px; padding: 14px; }
.evc::before { display: none; }
.evc-date { width: 72px; flex: none; text-align: center; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; background: #fff; align-self: flex-start; }
.evc-date b { display: block; font: 800 28px/1.3 var(--f-serif); color: var(--primary-d); }
.evc-date small { display: block; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 0; }
.evc-date em { display: block; font-style: normal; font-size: 11px; color: var(--muted); padding: 2px 0; }
.evc h4 { font-size: 16px; color: var(--brown); margin-bottom: 2px; }
.evc .badge { margin-top: 6px; }
.ev-list { display: flex; flex-direction: column; gap: 12px; }
.evrow { display: grid; grid-template-columns: 80px 1fr auto; gap: 16px; padding: 16px; align-items: start; }
.evrow::before { display: none; }
.evrow h3 { font-size: 18px; color: var(--brown); }
.evrow p { margin: 6px 0 0; }
.evrow.past { opacity: .65; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pcard { background: var(--paper); border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; color: inherit; text-decoration: none !important; transition: .15s; display: flex; flex-direction: column; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(80, 50, 20, .15); }
.pcard-img { aspect-ratio: 16/9; background: linear-gradient(135deg, #a3191b, #6d0c0c); display: flex; align-items: center; justify-content: center; color: #f1c14e; font-size: 34px; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.pcard-b { padding: 12px 16px 16px; }
.pcard-b small { color: var(--primary-d); font-weight: 600; }
.pcard-b h3 { font-size: 17px; color: var(--brown-d); margin: 4px 0 6px; }
.pcard-b p { margin: 0; color: #5b4c3d; font-size: 13.5px; }
.post { padding: 30px 40px; }
.post h1 { text-align: center; color: var(--green); font-size: 30px; font-weight: 800; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; position: relative; z-index: 2; }
.post-cover { width: 100%; border-radius: 6px; margin: 16px 0; }
.post .article { margin-top: 18px; }
.s-ft { height: calc(100vh - 140px); min-height: 520px; background-color: #f6ebd3; }
.s-ft.full { position: fixed; inset: 0; z-index: 90; height: 100vh; border-radius: 0; }
.s-tree-tools { position: relative; z-index: 95; }
.s-foot { margin-top: 30px; }
.s-foot-in { display: flex; justify-content: space-between; gap: 30px; padding-top: 22px; padding-bottom: 26px; flex-wrap: wrap; }
.s-foot h4 { color: var(--brown); font-size: 18px; margin-bottom: 6px; }
.s-foot p { margin: 4px 0; } .s-foot i { color: var(--primary); width: 16px; }

/* ===================== MÀN HÌNH NHỎ ===================== */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .cfg-grid, .sys-grid, .cfg-home { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .form-grid .span2 { grid-column: span 2; }
}
@media (max-width: 900px) {
  .sb { transform: translateX(-100%); transition: transform .2s; }
  .adm.sb-open .sb { transform: none; }
  .adm.sb-open .sb-mask { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .adm-main { margin-left: 0; }
  .sb-burger { display: inline-flex; }
  .adm-top .btn-outline { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-r { border-left: 0; padding-left: 0; border-top: 1px solid var(--line2); padding-top: 16px; }
  .intro { grid-template-columns: 1fr; }
  .ft-panel { left: 10px; right: 10px; width: auto; top: auto; max-height: 60%; }
  .prof-grid { grid-template-columns: 1fr; }
  .cloud-cluster { display: none; }
  .s-banner-svg { width: min(600px, 100%); }
  .s-burger { display: inline-flex; gap: 8px; align-items: center; margin: 4px auto 10px; border: 1px solid var(--line2); background: #fff6e0; padding: 8px 18px; border-radius: 30px; font-weight: 700; color: var(--green); }
  .site-nav { display: none; flex-direction: column; align-items: stretch; gap: 8px; }
  .site-nav.open { display: flex; }
}
@media (max-width: 640px) {
  #adm-page { padding: 14px 16px 30px; }
  .form-grid, .form-grid.g3 { grid-template-columns: 1fr; }
  .form-grid .span2, .span3 { grid-column: auto; }
  .mform-top { flex-direction: column; align-items: center; }
  .mform-top .form-grid { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .search-box input { width: 100%; }
  .search-box { flex: 1; min-width: 180px; }
  .g-two { grid-template-columns: 1fr; }
  .g-step span { display: none; }
  .post { padding: 20px 16px; }
  .evrow { grid-template-columns: 70px 1fr; }
  .evrow .badge { grid-column: 2; justify-self: start; }
  .s-wrap { padding: 0 16px 30px; }
  .modal-bg { padding: 8px; }
  .imp-step { flex-direction: column; align-items: stretch; }
  .menu-row { flex-wrap: wrap; } .menu-label { width: 100%; }
  .s-stats div { padding: 0 10px; border: 0; }
  .ft-wrap { height: calc(100vh - 230px); }
}

/* ---------- Đăng nhập & tài khoản ---------- */
button.user-chip { border: 1px solid transparent; background: transparent; padding: 3px 8px 3px 3px; border-radius: 22px; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
button.user-chip:hover { border-color: var(--line2); background: #fff; }
button.user-chip > i { font-size: 11px; color: var(--muted); }
body.mode-login { background: var(--bg); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 34px 30px 24px; display: flex; flex-direction: column; gap: 14px; text-align: center; box-shadow: 0 12px 40px rgba(80, 50, 20, .12); }
.login-card .fg, .login-card .chk-line { text-align: left; }
.login-card .chk-line { padding-top: 0; display: flex; font-size: 13px; }
.login-card h1 { margin: 0; font-family: var(--f-serif); font-size: 22px; color: var(--brown); }
.login-card p { margin: 0; }
.login-card .note { margin: 0; text-align: left; }
.seal.big { width: 64px; height: 64px; font-size: 34px; margin: 0 auto; }
.btn-block { width: 100%; padding: 11px; font-size: 14.5px; }
.login-err { background: #fdecea; border: 1px solid #f2b8b0; color: #a12a1b; border-radius: 4px; padding: 8px 12px; font-size: 13px; text-align: left; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 40px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 34px; height: 30px; cursor: pointer; }
.role-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px 18px; margin-bottom: 14px; }
.role-help div { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.role-help b { color: var(--brown); }
.role-help span { color: var(--muted); }
.perm-cell { max-width: 320px; }
.perm-cell .badge { margin: 2px 0; }
.row-off td { opacity: .55; }
.uform { display: flex; flex-direction: column; gap: 14px; }
.uform fieldset { border: 1px solid var(--line2); border-radius: 4px; padding: 10px 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.uform legend { font-weight: 700; font-size: 12.5px; color: var(--brown); padding: 0 6px; }
.uform .chk-line { padding-top: 0; display: flex; }
.scope-list { display: flex; flex-direction: column; gap: 4px; padding-left: 24px; max-height: 180px; overflow: auto; transition: opacity .15s; }
.cred { background: var(--paper2); border: 1px dashed var(--line2); border-radius: 4px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; word-break: break-all; margin: 10px 0; }
.nowrap { white-space: nowrap; }
p.error { color: #a12a1b; }

/* ---------- Bản đồ ---------- */
.geo-in { display: flex; gap: 6px; }
.geo-in input { flex: 1; min-width: 0; }
.gm-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.gm-lay { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.gm-lay i, .gm-item > i { color: var(--c); width: 16px; text-align: center; }
.gm-q { width: 170px; }
.gm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; height: min(70vh, 640px); overflow: hidden; padding: 0; }
.gm-map { height: 100%; min-height: 320px; z-index: 0; }
.gm-list { border-left: 1px solid var(--line2); overflow-y: auto; background: var(--paper); }
.gm-list-h { position: sticky; top: 0; background: var(--paper2); padding: 9px 12px; font-size: 12.5px; font-weight: 700; color: var(--brown); border-bottom: 1px solid var(--line2); display: flex; align-items: center; gap: 6px; z-index: 1; }
.gm-list-h .btn { margin-left: auto; padding: 2px 8px; }
.gm-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 9px 12px; cursor: pointer; font: inherit; color: var(--text); }
.gm-item:hover { background: #fff; }
.gm-item span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gm-item small { color: var(--muted); font-size: 11.5px; }
.gm-item em { font-style: normal; font-weight: 700; font-size: 12px; color: var(--primary-d); white-space: nowrap; }
.gm-empty { padding: 14px; }
.gm-pin { background: none; border: 0; }
.gm-pin span { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.gm-pin span i { transform: rotate(45deg); color: #fff; font-size: 13px; }
.gm-pop { min-width: 170px; font-family: var(--f-body); }
.gm-pop b { font-size: 14px; color: var(--brown); }
.gm-pop-a { display: flex; gap: 12px; margin-top: 8px; font-size: 12.5px; }
.gm-pick { display: flex; flex-direction: column; gap: 8px; }
.gm-pick-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gm-pick-map { height: min(60vh, 460px); border: 1px solid var(--line2); border-radius: 4px; z-index: 0; }
.s-map .gm-wrap { background: var(--paper); }
@media (max-width: 900px) {
  .role-help { grid-template-columns: 1fr; }
  .gm-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(320px, 55vh) auto; height: auto; }
  .gm-list { border-left: 0; border-top: 1px solid var(--line2); max-height: 320px; }
  .gm-q { flex: 1; width: auto; }
}
.gm-home { display: flex !important; align-items: center; justify-content: center; width: 34px; height: 34px; background: #fff; color: var(--brown) !important; font-size: 15px; }
.gm-home:hover { background: #f4f4f4; }
