/* TradeMantra Admin — workspace UI (separate from the public site) */
:root {
  --navy: #071B3A; --navy-2: #0E2547; --navy-3: #1B355A;
  --green: #0F5D3A; --green-2: #087A45; --green-bg: #EAF7EF;
  --red: #E53935; --red-bg: #FDEDEC; --amber: #B26B00; --amber-bg: #FFF4E0; --blue: #2563C9; --blue-bg: #EAF1FC;
  --bg: #F4F6F5; --card: #fff; --line: #E3E8E5; --line-2: #EDF1EE;
  --text: #101828; --text-2: #344054; --muted: #5D6879;
  --r: 10px; --r-sm: 7px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sb: 248px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--navy); }
img { max-width: 100%; display: block; }
svg { display: inline-block; vertical-align: middle; flex: none; }
input, select, textarea, button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.strong { font-weight: 600; color: var(--navy); }
.block { display: block; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.inline { display: inline; }
.req { color: var(--red); }
:focus-visible { outline: 2px solid var(--green-2); outline-offset: 2px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sb); flex: none; background: var(--navy); color: #C9D3E0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.sb-brand { display: flex; align-items: center; gap: 10px; margin: 14px; padding: 10px 12px; background: #fff; border-radius: 9px; }
.sb-brand img { height: 34px; width: auto; }
.sb-brand span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green); margin-left: auto; }
.sb-brand:hover { text-decoration: none; }
.sb-nav { padding: 4px 10px 16px; display: grid; gap: 2px; }
.sb-sep { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8FA1BD; padding: 16px 12px 6px; }
.sb-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px; color: #C9D3E0; font-weight: 500; }
.sb-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sb-nav a.active { background: var(--green); color: #fff; }
.sb-nav a svg { opacity: .9; }
.sb-nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.sb-foot { margin-top: auto; padding: 14px 22px 20px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sb-foot a { color: #9FB0C7; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 28px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sb-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--navy); }
.me { position: relative; }
.me-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; font-weight: 700; }
.me-name { font-weight: 600; font-size: 13px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px -16px rgba(7, 27, 58, .35); padding: 6px; display: none; }
.me.open .dropdown { display: block; }
.dd-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.dd-head small { display: block; color: var(--muted); font-size: 12px; }
.dropdown a, .dropdown button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 6px; color: var(--text-2); background: none; border: 0; cursor: pointer; text-align: left; font-size: 13.5px; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); text-decoration: none; }
.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

/* buttons */
.abtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.abtn:hover { text-decoration: none; }
.abtn.primary { background: var(--green); color: #fff; }
.abtn.primary:hover { background: #0B4A2E; }
.abtn.ghost { background: #fff; border-color: var(--line); color: var(--navy); }
.abtn.ghost:hover { border-color: #C5D0CA; background: #FAFBFA; }
.abtn.danger { background: var(--red); color: #fff; }
.abtn.danger:hover { background: #C62F2B; }
.abtn.danger-ghost { background: #fff; border-color: #F3C9C7; color: #B3261E; }
.abtn.danger-ghost:hover { background: var(--red-bg); }
.abtn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.abtn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg); color: var(--navy); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-bg); border-color: #F3C9C7; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green); font-weight: 600; cursor: pointer; }
.badge-btn { background: none; border: 0; padding: 0; cursor: pointer; }

/* badges */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: #C62F2B; }
.badge.amber { background: var(--amber-bg); color: #7A4A00; }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.navy { background: #E6ECF5; color: var(--navy); }
.badge.grey { background: #EEF1EF; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green-2); vertical-align: middle; }
.dot.red { background: var(--red); } .dot.blue { background: var(--blue); } .dot.amber { background: #E8930C; } .dot.navy { background: var(--navy); } .dot.teal { background: #0E8C82; }

/* panels & grids */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow { max-width: 560px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; font-weight: 700; }
.panel-head a { font-size: 13px; font-weight: 600; }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); background: #FBFCFB; display: flex; justify-content: flex-end; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 .span-2 { grid-column: 1 / -1; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.edit-side { position: sticky; top: 82px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.sep { border: 0; border-top: 1px solid var(--line-2); margin: 18px 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; color: inherit; transition: box-shadow .15s, transform .15s; }
.stat:hover { text-decoration: none; box-shadow: 0 10px 24px -16px rgba(7, 27, 58, .4); transform: translateY(-1px); }
.stat small { display: block; color: var(--muted); font-size: 12.5px; }
.stat strong { display: block; font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.2; letter-spacing: -.02em; }
.stat em { font-style: normal; font-size: 12px; color: var(--green-2); font-weight: 600; }
.s-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; flex: none; }
.s-ic.green { background: var(--green-bg); color: var(--green); } .s-ic.red { background: var(--red-bg); color: var(--red); } .s-ic.blue { background: var(--blue-bg); color: var(--blue); } .s-ic.amber { background: var(--amber-bg); color: var(--amber); } .s-ic.navy { background: #E6ECF5; color: var(--navy); }

/* callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r); background: var(--blue-bg); color: #1E3A6B; border: 1px solid #D3E1F7; margin-bottom: 16px; font-size: 13.5px; }
.callout.warn { background: var(--amber-bg); color: #6B4A0B; border-color: #F3E2C2; }
.callout.bad { background: var(--red-bg); color: #8E1F1C; border-color: #F6D2D0; }
.callout svg { margin-top: 1px; }
.callout .linkbtn { color: inherit; text-decoration: underline; }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #FBFCFB; white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #FAFCFA; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl small { font-size: 12px; }
.panel:not(.flush) .tbl th:first-child, .panel:not(.flush) .tbl td:first-child { padding-left: 0; }
.row-link { cursor: pointer; }
.w-chk { width: 36px; }
.w-thumb { width: 84px; }
.w-ord { width: 80px; }
.w-ic { width: 52px; }
.mini-thumb { display: block; width: 72px; height: 46px; border-radius: 6px; overflow: hidden; background: var(--navy); }
.mini-thumb img, .mini-thumb svg { width: 100%; height: 100%; object-fit: cover; }
.ic-chip { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--green-bg); color: var(--green); }
input.ord { width: 64px; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.empty, .empty-big { color: var(--muted); }
.empty { padding: 8px 0; margin: 0; }
.empty-big { text-align: center; padding: 56px 20px; }
.empty-big svg { color: #A6B3AC; }
.empty-big h3 { margin: 12px 0 4px; font-size: 16px; }
.empty-big p { margin: 0 0 16px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); gap: 10px; }
.pager span:last-child { display: flex; gap: 6px; }
.pager-info { color: var(--muted); font-size: 12.5px; padding: 12px 16px; }
.pager .pager-info { padding: 0; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { color: inherit; min-width: 0; }
.mini-list a:hover { text-decoration: none; }
.mini-list a:hover strong { color: var(--green); }
.mini-list strong { display: block; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list small { color: var(--muted); font-size: 12px; }

/* tabs & filters */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--navy); text-decoration: none; }
.tabs a.active { color: var(--green); border-bottom-color: var(--green); }
.tabs b { font-weight: 600; background: #EEF1EF; color: var(--muted); border-radius: 999px; padding: 1px 7px; font-size: 11.5px; margin-left: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters input, .filters select { height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; background: #fff; }
.filters label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.bulkbar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FBFCFB; }
.bulkbar select { height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; background: #fff; }
.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: 13px; color: var(--text-2); }

/* forms */
.form .fld, .fld { margin-bottom: 16px; }
.fld > label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.fld input[type=month], .fld input[type=text], .fld input[type=email], .fld input[type=password], .fld input[type=number], .fld input[type=date], .fld input[type=datetime-local], .fld input[type=url], .fld select, .fld textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid #D5DDD8; border-radius: var(--r-sm); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.fld textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(8, 122, 69, .12); }
.fld input[type=file] { display: block; width: 100%; padding: 10px; border: 1.5px dashed #CBD5CF; border-radius: var(--r-sm); background: #FAFBFA; cursor: pointer; }
.help { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; word-break: break-word; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.file-cur { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #FBFCFB; }
.file-cur img { width: 96px; height: 60px; object-fit: cover; border-radius: 5px; }
.file-cur.doc span { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-cur .chk { margin-left: auto; color: var(--red); }
.file-new { margin-top: 8px; max-height: 120px; border-radius: 6px; }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin-bottom: 14px; }
.switch input { position: absolute; opacity: 0; }
.switch .sw { flex: none; position: relative; width: 38px; height: 22px; border-radius: 999px; background: #CDD5D0; transition: background .15s; margin-top: 1px; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + .sw { background: var(--green-2); }
.switch input:checked + .sw::after { transform: translateX(16px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--green-2); outline-offset: 2px; }
.switch span:last-child { font-weight: 600; color: var(--navy); font-size: 13.5px; }
.switch small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 16px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 8px 14px; font-weight: 600; font-size: 13px; color: var(--muted); border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--green); color: #fff; }
.icon-pick { display: flex; gap: 8px; align-items: center; }
.icon-pick .ip-prev { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--green-bg); color: var(--green); }
.icon-pick select { flex: 1; height: 40px; border: 1px solid #D5DDD8; border-radius: var(--r-sm); padding: 0 10px; background: #fff; }

/* repeater */
.repeater { display: grid; gap: 8px; }
.rep-item { display: grid; grid-template-columns: 210px 1fr 1fr auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #FBFCFB; }
.rep-item:has(.icon-pick + input + .rep-tools) { grid-template-columns: 210px 1fr auto; }
.rep-item input[type=text] { height: 38px; border: 1px solid #D5DDD8; border-radius: 6px; padding: 0 10px; width: 100%; background: #fff; }
.rep-tools { display: flex; gap: 4px; }
.rep-tools button { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: var(--muted); }
.rep-tools button:hover { color: var(--navy); border-color: #C5D0CA; }
.rep-tools [data-remove]:hover { color: var(--red); }
.repeater > .abtn { justify-self: start; }

/* rich editor */
.editor { border: 1px solid #D5DDD8; border-radius: var(--r-sm); background: #fff; }
.ed-bar { border-radius: var(--r-sm) var(--r-sm) 0 0; }
.ed-src { border-radius: 0 0 var(--r-sm) var(--r-sm); }
.editor:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(8, 122, 69, .12); }
.ed-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #FBFCFB; position: sticky; top: 64px; z-index: 2; }
.ed-bar button { height: 30px; min-width: 32px; padding: 0 9px; border: 1px solid transparent; background: none; border-radius: 5px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ed-bar button:hover { background: #fff; border-color: var(--line); }
.ed-bar button.on { background: var(--green-bg); color: var(--green); }
.ed-sep { width: 1px; background: var(--line); margin: 4px 4px; }
.ed-area { min-height: 280px; max-height: 70vh; overflow-y: auto; padding: 16px 18px; outline: none; }
.ed-src { display: block; width: 100%; min-height: 320px; border: 0; padding: 14px; font: 12.5px/1.6 ui-monospace, Menlo, monospace; resize: vertical; outline: none; }
.editor.html-mode .ed-area { display: none; }
.prose-admin { font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.prose-admin h2 { font-size: 19px; margin: 1.2em 0 .4em; font-family: "Source Serif 4", Georgia, serif; }
.prose-admin h3 { font-size: 16px; margin: 1em 0 .3em; }
.prose-admin p { margin: 0 0 .9em; }
.prose-admin ul, .prose-admin ol { padding-left: 1.3em; }
.prose-admin blockquote { border-left: 3px solid var(--green-2); margin: 1em 0; padding-left: 14px; color: var(--navy); }
.prose-admin table { border-collapse: collapse; width: 100%; margin: 0 0 1em; }
.prose-admin th, .prose-admin td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose-admin .tbu { color: var(--muted); font-style: italic; }
.prose-admin.read { max-height: 75vh; overflow-y: auto; }
.ph-help strong { display: block; color: var(--navy); margin-bottom: 4px; }
.ph-help p { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.ph-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ph { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: #FBFCFB; border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.ph:hover { border-color: var(--green-2); }
.ph code { font-size: 11.5px; color: var(--navy); }
.ph i { font-style: normal; font-size: 10.5px; color: var(--amber); background: var(--amber-bg); border-radius: 4px; padding: 0 4px; }

/* detail */
.dl { margin: 0; display: grid; }
.dl div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.dl div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; color: var(--navy); }
.msg-body { white-space: normal; background: #FBFCFB; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 16px; margin-bottom: 14px; font-size: 14.5px; line-height: 1.65; color: var(--text-2); }
.sig-box { border: 1px dashed #C5D0CA; border-radius: var(--r-sm); background: #fff; padding: 14px; display: grid; place-items: center; min-height: 160px; }
.sig-box img { max-height: 180px; }

/* plans */
.plan-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.plan-admin { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--green-2); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; }
.plan-admin.acc-red, .plan-admin.acc-crimson { border-top-color: var(--red); }
.plan-admin.acc-amber { border-top-color: #E8930C; }
.pa-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pa-glyph { color: var(--green-2); }
.acc-red .pa-glyph, .acc-crimson .pa-glyph { color: var(--red); }
.acc-amber .pa-glyph { color: #E8930C; }
.plan-admin h3 { font-size: 16px; font-family: "Source Serif 4", Georgia, serif; }
.pa-price { font-size: 22px; font-weight: 700; color: var(--navy); margin: 6px 0 10px; }
.pa-price small { font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-admin ul { margin: 0 0 14px; padding-left: 18px; color: var(--text-2); font-size: 13px; flex: 1; }
.pa-actions { display: flex; gap: 8px; }
.matrix input[type=number] { width: 100%; min-width: 90px; height: 34px; border: 1px solid #D5DDD8; border-radius: 6px; padding: 0 8px; }
.matrix input[type=text] { width: 100%; min-width: 160px; height: 34px; border: 1px solid #D5DDD8; border-radius: 6px; padding: 0 10px; }
.matrix .cell-val { display: grid; gap: 4px; min-width: 140px; }
.matrix select { height: 34px; border: 1px solid #D5DDD8; border-radius: 6px; padding: 0 6px; background: #fff; }
.matrix .is-hidden { display: none; }
.matrix .new-row input { border-style: dashed; }

/* toasts & modal */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 100; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--navy); color: #fff; padding: 12px 14px; border-radius: 9px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5); animation: tin .25s ease; font-size: 13.5px; }
.toast.success svg { color: #3CCB84; }
.toast.error { background: #7A1B18; }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: #fff; opacity: .6; cursor: pointer; font-size: 18px; line-height: 1; }
.toast.hide { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.modal { position: fixed; inset: 0; background: rgba(7, 27, 58, .45); display: grid; place-items: center; z-index: 200; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 12px; padding: 24px; width: 100%; max-width: 400px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); text-align: center; }
.modal-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--red-bg); color: var(--red); margin-bottom: 12px; }
.modal-card h3 { font-size: 17px; margin-bottom: 6px; }
.modal-card p { color: var(--muted); margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* login */
.login-body { background: radial-gradient(70% 70% at 80% 0%, #0F3A28 0%, var(--navy) 60%); min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-wrap { width: 100%; max-width: 400px; text-align: center; }
.login-card { background: #fff; border-radius: 14px; padding: 32px 30px; text-align: left; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); }
.login-logo { height: 54px; width: auto; margin: 0 auto 22px; }
.login-card h1 { font-size: 20px; text-align: center; }
.login-card > p { text-align: center; margin: 4px 0 20px; }
.login-card .tiny { color: var(--muted); text-align: center; margin: 16px 0 0; }
.note { padding: 10px 12px; border-radius: 7px; font-size: 13px; margin-bottom: 14px; }
.note.bad { background: var(--red-bg); color: #8E1F1C; }
.note.ok { background: var(--green-bg); color: var(--green); }
.back { display: inline-block; margin-top: 18px; color: #AFC0D6; font-size: 13px; }

/* responsive */
@media (max-width: 1100px) {
  .edit-grid { grid-template-columns: 1fr; }
  .edit-side { position: static; }
  .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
  .grid-2 > .panel { margin-bottom: 0; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; box-shadow: 20px 0 40px -20px rgba(0, 0, 0, .5); }
  .me { margin-left: auto; }
  .tbl { min-width: 680px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .sb-toggle { display: block; }
  .topbar { padding: 0 14px; gap: 10px; }
  .me-name { display: none; }
  .content { padding: 16px 14px 40px; }
  .tb-actions { display: none; }
  .row-2, .row-3 { grid-template-columns: 1fr; gap: 0; }
  .rep-item, .rep-item:has(.icon-pick + input + .rep-tools) { grid-template-columns: 1fr; }
  .dl div { grid-template-columns: 1fr; gap: 2px; }
  .mobile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
}
@media (min-width: 861px) { .mobile-actions { display: none; } }
.ed-src[hidden] { display: none; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; transform: translateY(-160%); transition: transform .15s; background: var(--green); color: #fff; font-weight: 600; padding: 10px 16px; border-radius: 7px; }
.skip-link:focus { transform: none; color: #fff; text-decoration: none; outline: 3px solid #3CCB84; outline-offset: 2px; }
.content:focus { outline: none; }
:focus-visible { outline: 3px solid var(--green-2); outline-offset: 2px; }
.sidebar :focus-visible { outline-color: #3CCB84; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.switch input:focus-visible + .sw, .seg input:focus-visible + span { outline: 3px solid var(--green-2); outline-offset: 2px; }

.callout a, .panel p a, .tiny a, .help a { text-decoration: underline; text-underline-offset: 2px; }
