/* ===== Quản trị Cá Tầm ABC ===== */
:root {
  --g950: #02221d; --g900: #042923; --g850: #00352c; --g800: #0b4a3b; --g700: #0e5644; --g600: #16744f; --g500: #1a784c; --g400: #2e9a62;
  --c1: #16744f; --c2: #23a0a8; --c3: #8fc760;
  --teal: #23a0a8; --leaf: #8fc760; --mint: #eaf6ef; --mint2: #f3f9f5;
  --ink: #10302b; --ink2: #183f39; --muted: #64776f; --muted2: #8a9a93; --line: #e4ebe7; --line2: #eef3f0;
  --bg: #f4f7f6; --card: #fff;
  --ok: #1f8a4c; --ok-bg: #e5f6ec; --warn: #b7791f; --warn-bg: #fdf1dc; --danger: #c8372d; --danger-bg: #fde8e6; --info: #2563c9; --info-bg: #e3eefc;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(4, 41, 35, .05), 0 4px 14px rgba(4, 41, 35, .05);
  --shadow-lg: 0 18px 50px rgba(4, 41, 35, .22);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --side: 232px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg) linear-gradient(180deg, #eef4f1, var(--bg) 320px) no-repeat; -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: var(--g600); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; color: var(--ink2); line-height: 1.25; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.r { text-align: right; }
.c { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid rgba(26, 120, 76, .55); outline-offset: 2px; }

/* ----- Buttons ----- */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; color: var(--ink2); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.b:hover { border-color: #c9d8d0; background: #f8fbf9; }
.b:disabled { opacity: .55; pointer-events: none; }
.b--primary { background: linear-gradient(180deg, #1f8355, var(--g600)); color: #fff; border-color: var(--g600); }
.b--primary:hover { background: var(--g700); border-color: var(--g700); color: #fff; }
.b--soft { background: var(--mint); border-color: transparent; color: var(--g700); }
.b--soft:hover { background: #dcefe4; }
.b--danger { color: var(--danger); border-color: #f2c9c4; }
.b--danger:hover { background: var(--danger-bg); border-color: #eab0a9; }
.b--danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.b--danger-solid:hover { background: #ad2d24; color: #fff; }
.b--ghost { border-color: transparent; background: transparent; }
.b--ghost:hover { background: var(--mint2); }
.b--sm { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
.b--lg { min-height: 46px; font-size: 15px; padding: 10px 18px; }
.b--block { width: 100%; }
.b--icon { width: 34px; padding: 0; min-height: 34px; }
.link { background: none; border: 0; color: var(--g600); font-weight: 600; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* ----- Login ----- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login__art { position: relative; background: linear-gradient(160deg, var(--g850), var(--g950)); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px; overflow: hidden; }
.login__art::after { content: ''; position: absolute; inset: auto 0 0 0; height: 55%; background: url('../img/sidebar-deco.png') center bottom / cover no-repeat; opacity: .55; }
.login__art h1 { color: #fff; font-size: 34px; letter-spacing: .02em; margin-top: 14px; }
.login__sub { color: #b9d6c8; margin: 4px 0 0; letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px; }
.login__script { font-family: 'Dancing Script', cursive; font-size: 30px; color: #e7f3ec; line-height: 1.2; margin-top: 30px; position: relative; z-index: 1; }
.login__form { align-self: center; justify-self: center; width: min(420px, 92vw); padding: 32px 0; display: grid; gap: 14px; }
.login__form h2 { font-size: 26px; }
.login__err { color: var(--danger); margin: 0; background: var(--danger-bg); padding: 8px 12px; border-radius: 8px; }
.login__demo { display: grid; gap: 6px; padding: 14px; border-radius: var(--r); background: var(--mint2); border: 1px dashed #cfe3d7; font-size: 13px; }
.login__demo button { text-align: left; border: 0; background: #fff; padding: 8px 10px; border-radius: 6px; color: var(--ink2); }
.login__demo button:hover { background: var(--mint); }
.login__back { font-size: 13.5px; }

/* ----- Shell ----- */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: linear-gradient(180deg, var(--g850) 0%, var(--g900) 55%, var(--g950)); color: #d6e8df; display: flex; flex-direction: column; z-index: 40; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.side__brand { display: flex; flex-direction: column; align-items: center; padding: 20px 10px 14px; color: #fff; text-align: center; }
.side__brand img { width: 92px; height: auto; }
.side__brand b { font-size: 19px; letter-spacing: .02em; margin-top: 4px; }
.side__brand small { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #b9d6c8; margin-top: 2px; }
.side__brand em { font-style: normal; font-size: 10.5px; color: var(--leaf); margin-top: 2px; letter-spacing: .06em; }
.side__nav { padding: 4px 10px 8px; position: relative; z-index: 1; }
.side__group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7fa596; padding: 12px 12px 4px; }
.side__nav a { display: flex; align-items: center; gap: 13px; padding: 8px 12px; margin: 2px 0; border-radius: 9px; color: #e3efe9; font-weight: 500; font-size: 14px; border: 1px solid transparent; }
.side__nav a:hover { background: rgba(255, 255, 255, .06); }
.side__nav a.is-active { background: linear-gradient(180deg, #23875a, var(--g500)); border-color: rgba(143, 199, 96, .45); color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.side__nav svg { width: 21px; height: 21px; flex: none; opacity: .95; }
.side__nav .badge { margin-left: auto; background: #e8a33a; color: #2b1d02; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side__deco { flex: none; margin-top: auto; height: 170px; background: url('../img/sidebar-deco.png') center bottom / cover no-repeat; pointer-events: none; }
.side__overlay { display: none; }
.main { flex: 1; margin-left: var(--side); min-width: 0; display: flex; flex-direction: column; position: relative; isolation: isolate; }
.main::before { content: ''; position: absolute; top: 0; right: 0; width: 760px; max-width: 70%; height: 300px; z-index: -1; background: url('../img/c-mountain.jpg') right top / cover no-repeat; opacity: .22; -webkit-mask-image: radial-gradient(120% 100% at 100% 0, #000 25%, transparent 75%); mask-image: radial-gradient(120% 100% at 100% 0, #000 25%, transparent 75%); pointer-events: none; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 22px; background: linear-gradient(90deg, rgba(244, 247, 246, .96) 50%, rgba(244, 247, 246, .7)); backdrop-filter: blur(8px); }
.top__tools .tabs { flex-wrap: nowrap; }
.selbox, .top__uname { white-space: nowrap; }
.top__menu { display: none; border: 0; background: #fff; width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--shadow); align-items: center; justify-content: center; }
.top__title { min-width: 0; margin-right: auto; }
.top__title h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.top__title p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.top__tools { display: flex; gap: 8px; align-items: center; }
.top__demo { font-size: 11.5px; color: var(--muted2); white-space: nowrap; }
.top__search { position: relative; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 42px; width: 220px; color: var(--muted); }
.top__search input { border: 0; outline: 0; background: none; width: 100%; color: var(--ink); }
.search-pop { position: absolute; top: 48px; right: 0; width: 360px; max-height: 420px; overflow-y: auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.search-pop .grp { font-size: 11px; text-transform: uppercase; color: var(--muted2); padding: 8px 10px 2px; letter-spacing: .08em; }
.search-pop a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.search-pop a:hover, .search-pop a.is-focus { background: var(--mint2); }
.top__bell { position: relative; }
.top__bell > button { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--g700); display: grid; place-items: center; position: relative; }
.top__bell i { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; border: 2px solid #fff; }
.top__user { position: relative; padding-left: 12px; border-left: 1px solid var(--line); }
.top__user > button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px; font-weight: 600; color: var(--ink2); }
.ava { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--g600), var(--g850)); color: #fff; font-weight: 700; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background-size: cover; background-position: center; }
.pop { position: absolute; right: 0; top: 50px; width: 360px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 50; padding: 8px; max-height: 480px; overflow-y: auto; }
.pop--menu { width: 220px; display: grid; }
.pop--menu a, .pop--menu button { padding: 9px 12px; border-radius: 8px; color: var(--ink); text-align: left; background: none; border: 0; }
.pop--menu a:hover, .pop--menu button:hover { background: var(--mint2); }
.pop__head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line2); margin-bottom: 4px; display: grid; }
.pop__head small { color: var(--muted); }
.noti { display: flex; gap: 10px; padding: 10px; border-radius: 10px; color: var(--ink); }
.noti:hover { background: var(--mint2); }
.noti b { display: block; font-size: 13.5px; }
.noti span { color: var(--muted); font-size: 12.5px; }
.noti time { margin-left: auto; font-size: 11.5px; color: var(--muted2); white-space: nowrap; }
.view { padding: 4px 22px 30px; outline: 0; flex: 1; }

/* ----- Cards & grid ----- */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-dash1 { grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr) minmax(0, 1fr); }
.g-dash2 { grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr) minmax(0, 1fr); }
.g-farm1 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.g-farm2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 16px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid #ebf0ed; padding: 18px 20px; min-width: 0; position: relative; }
.card--flush { padding: 0; overflow: hidden; }
.card__h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card__h h2 { font-size: 18px; font-weight: 700; margin-right: auto; }
.card__h small { color: var(--muted); font-size: 12px; }
.card--flush .card__h { padding: 16px 20px 0; }
.legend { display: flex; gap: 14px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend i.dash { width: 18px; height: 0; border-radius: 0; border-top: 2px dashed; vertical-align: 3px; }
.legend i.line { width: 18px; height: 3px; border-radius: 2px; vertical-align: 3px; }

/* ----- KPI ----- */
.kpi { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; padding: 18px 20px 14px; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset: auto 0 0 0; height: 40px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='40' viewBox='0 0 400 40'%3E%3Cpath d='M0 30 Q50 16 100 26 T200 22 T300 28 T400 20' fill='none' stroke='%23e8f0ec' stroke-width='1.2'/%3E%3Cpath d='M0 36 Q60 26 120 33 T240 30 T400 32' fill='none' stroke='%23eef4f0' stroke-width='1'/%3E%3C/svg%3E") center / cover; pointer-events: none; }
.kpi__ic { grid-row: span 2; width: 76px; height: 76px; border-radius: 50%; background: var(--mint); color: var(--g700); display: grid; place-items: center; }
.kpi__ic svg { width: 36px; height: 36px; }
.kpi__lbl { font-size: 14.5px; color: var(--ink2); font-weight: 500; }
.kpi__val { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); }
.kpi__val small { font-size: 20px; font-weight: 700; margin-left: 2px; }
.kpi__foot { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 8px; position: relative; z-index: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--mint); color: var(--ok); white-space: nowrap; }
.chip--down { background: var(--danger-bg); color: var(--danger); }
.chip--flat { background: #eef2f0; color: var(--ink2); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 42px; }
.spark i { display: block; width: 5px; border-radius: 3px 3px 1px 1px; background: #8fd0cf; min-height: 3px; }
.spark i:last-child { background: var(--teal); }
.kpi__note { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted2); position: relative; z-index: 1; }

/* ----- Charts ----- */
.chart { position: relative; height: 290px; }
.chart--sm { height: 220px; }
.chart--xs { height: 170px; }
.donut { position: relative; height: 210px; }
.donut__c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut__c b { display: block; font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.donut__c span { font-size: 12px; color: var(--muted); }
.dlegend { display: grid; gap: 8px; margin-top: 14px; font-size: 13px; }
.dlegend div { display: flex; align-items: center; gap: 10px; }
.dlegend i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dlegend b { margin-left: auto; font-weight: 600; }
.dlegend small { color: var(--muted); margin-left: 6px; }
.split-donut { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; }
.split-donut .donut { height: 130px; }
.split-donut .donut__c b { font-size: 21px; }
.split-donut .dlegend { margin: 0; }

/* ----- Progress ----- */
.prog { margin-bottom: 18px; }
.prog:last-child { margin-bottom: 0; }
.prog__h { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; color: var(--ink2); font-size: 14.5px; }
.prog__h b { font-size: 18px; }
.bar { height: 10px; background: #edf2ef; border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--g600); transition: width .6s ease; }
.bar--teal i { background: var(--teal); }
.bar--leaf i { background: #4caf50; }
.bar--warn i { background: #e8a33a; }
.bar--danger i { background: var(--danger); }
.prog small { color: var(--muted); font-size: 12.5px; }
.prog__pace { float: right; color: var(--muted2); }

/* ----- Tables ----- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink2); background: #f4f7f5; padding: 10px 12px; white-space: nowrap; font-size: 13px; }
.tbl th:first-child { border-radius: 8px 0 0 8px; }
.tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.is-click { cursor: pointer; }
.tbl tbody tr:hover { background: #f8fbf9; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .thumb { width: 44px; height: 32px; border-radius: 6px; object-fit: cover; vertical-align: middle; }
.tbl .sub { display: block; color: var(--muted); font-size: 12px; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.pager { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.pager button.is-on { background: var(--g600); color: #fff; border-color: var(--g600); }
.pager button:disabled { opacity: .4; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty svg { width: 44px; height: 44px; color: #b9cbc3; margin-bottom: 8px; }

/* ----- Badges ----- */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.st--plain::before { display: none; }
.st--moi, .st--info { background: var(--info-bg); color: var(--info); }
.st--dang-xu-ly, .st--warn, .st--theo-doi, .st--cho-xuat, .st--da-coc { background: var(--warn-bg); color: var(--warn); }
.st--dang-giao, .st--dang-van-chuyen, .st--da-bao-gia { background: #e2f2fb; color: #1677a6; }
.st--hoan-tat, .st--ok, .st--on-dinh, .st--da-giao, .st--chot-don, .st--published, .st--da-tt, .st--da-cap { background: var(--ok-bg); color: var(--ok); }
.st--huy, .st--danger, .st--canh-bao, .st--chua-tt { background: var(--danger-bg); color: var(--danger); }
.st--dong, .st--draft, .st--trong, .st--xuat-trai { background: #eef1f0; color: #5f6f69; }
.tagx { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--mint); color: var(--g700); font-size: 12px; font-weight: 600; }

/* ----- Toolbar / filters ----- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 600; color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink2); }
.tabs button.is-on { background: var(--g600); color: #fff; }
.tabs button i { font-style: normal; font-size: 11px; background: rgba(0, 0, 0, .07); padding: 1px 7px; border-radius: 10px; }
.tabs button.is-on i { background: rgba(255, 255, 255, .2); }
.inp, .sel { height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 12px; outline: 0; min-width: 0; }
.inp:focus, .sel:focus { border-color: var(--g400); box-shadow: 0 0 0 3px rgba(46, 154, 98, .14); }
.inp--search { padding-left: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364776f' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 11px center no-repeat; width: 240px; }
.selbox { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-weight: 600; color: var(--ink2); }
.selbox select { border: 0; outline: 0; background: none; font-weight: 600; padding-right: 4px; cursor: pointer; }
.selbox svg { color: var(--g700); }

/* ----- Forms ----- */
.form { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.f { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); min-width: 0; }
.f > span i { color: var(--danger); font-style: normal; }
.f input:not([type=checkbox]):not([type=radio]):not([type=file]), .f select, .f textarea { width: 100%; min-height: 40px; border: 1px solid #d9e3de; border-radius: 8px; padding: 8px 12px; background: #fff; font-weight: 400; font-size: 14px; outline: 0; }
.f textarea { resize: vertical; min-height: 80px; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--g400); box-shadow: 0 0 0 3px rgba(46, 154, 98, .14); }
.f small { font-weight: 400; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--g600); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 40px; height: 22px; background: #cfd9d4; border-radius: 99px; position: relative; transition: background .15s; flex: none; }
.switch span::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 + span { background: var(--g600); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid rgba(26, 120, 76, .55); outline-offset: 2px; }
.fsec { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding-top: 6px; border-top: 1px solid var(--line2); }
.img-pick { display: flex; gap: 12px; align-items: center; }
.img-pick img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--mint2); }
.img-pick__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.gal { display: flex; gap: 8px; flex-wrap: wrap; }
.gal div { position: relative; }
.gal img { width: 84px; height: 60px; object-fit: cover; border-radius: 6px; }
.gal button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 12px; line-height: 1; }
.kv { display: grid; grid-template-columns: 1fr 1.6fr 34px; gap: 8px; align-items: center; }
.items { display: grid; gap: 8px; }
.item-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 90px 120px 120px 34px; gap: 8px; align-items: center; }
.item-row .total { text-align: right; font-weight: 600; }
.sum-box { display: grid; gap: 6px; justify-items: end; padding: 12px 14px; background: var(--mint2); border-radius: 10px; font-size: 14px; }
.sum-box b { font-size: 20px; color: var(--g700); }

/* ----- Modal & drawer ----- */
.modal { position: fixed; inset: 0; background: rgba(2, 30, 25, .5); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal__box { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal__box--lg { width: min(940px, 100%); }
.modal__box--xl { width: min(1180px, 100%); }
.modal__box--sm { width: min(440px, 100%); }
.modal__h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line2); }
.modal__h h3 { font-size: 18px; margin-right: auto; }
.modal__x { border: 0; background: var(--mint2); width: 34px; height: 34px; border-radius: 8px; font-size: 20px; line-height: 1; color: var(--ink2); }
.modal__b { padding: 18px 20px; overflow-y: auto; }
.modal__f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.modal__f .left { margin-right: auto; }
.drawer { position: fixed; inset: 0; z-index: 90; background: rgba(2, 30, 25, .35); animation: fade .15s; }
.drawer__box { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.steps { display: flex; gap: 4px; margin: 4px 0 16px; }
.steps span { flex: 1; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted2); padding-top: 10px; border-top: 4px solid #e3eae6; }
.steps span.is-done { color: var(--g600); border-color: var(--g600); }
.steps span.is-cancel { color: var(--danger); border-color: var(--danger); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: #dce8e1; }
.timeline li { position: relative; padding: 0 0 14px; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--g400); }
.timeline time { color: var(--muted); font-size: 12px; }
.timeline b { display: block; }
.timeline p { margin: 2px 0 0; color: #43584f; font-size: 13px; }
.timeline .rm { position: absolute; right: 0; top: 0; }

/* ----- Toast & confirm ----- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--g900); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: center; animation: pop .2s; max-width: 380px; }
.toast--err { background: #8f2119; }
.toast svg { flex: none; }

/* ----- Dashboard misc ----- */
.cta-big { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 64px; border-radius: var(--r); background: linear-gradient(110deg, var(--g850), var(--g500)); color: #fff; font-size: 17px; font-weight: 700; border: 0; width: 100%; box-shadow: 0 10px 24px rgba(4, 41, 35, .22); }
.cta-big:hover { filter: brightness(1.08); }
.cta-big svg { width: 26px; height: 26px; }
.act { display: grid; gap: 2px; font-size: 13px; }
.act div { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line2); }
.act time { color: var(--muted2); white-space: nowrap; font-size: 12px; min-width: 88px; }

/* ----- Farm map ----- */
.g-farm1 > section:first-child { display: flex; flex-direction: column; }
.fmap { flex: 1; grid-template-rows: auto auto; align-content: center; row-gap: 4px; display: grid; grid-template-columns: 1fr 34px 1fr; gap: 0; background: linear-gradient(135deg, #5e8b5a, #4d7b4c); border-radius: 10px; padding: 12px; position: relative; overflow: hidden; }
.fmap::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .12), transparent 40%), repeating-radial-gradient(circle at 70% 80%, rgba(0, 0, 0, .04) 0 2px, transparent 2px 9px); pointer-events: none; }
.fzone { position: relative; background: rgba(214, 226, 207, .78); border-radius: 12px; padding: 22px 10px 10px; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(72px, 112px); gap: 10px; align-self: center; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35); }
.fzone > b { position: absolute; top: 3px; left: 0; right: 0; text-align: center; font-size: 12px; letter-spacing: .08em; color: #23423a; }
.fzone--b { background: rgba(196, 219, 222, .82); }
.fcanal { background: linear-gradient(90deg, #6cb4cf, #8fd0e6, #6cb4cf); margin: 34px 10px; border-radius: 6px; position: relative; }
.fcanal::after { content: ''; position: absolute; left: 50%; top: 45%; width: 30px; height: 30px; transform: translate(-50%, -50%) rotate(45deg); background: #6cb4cf; border: 3px solid #e6f4f8; border-radius: 4px; }
.pond { position: relative; min-height: 72px; display: flex; align-items: flex-start; justify-content: flex-start; border-radius: 9px; border: 3px solid #d7ddd2; background: radial-gradient(ellipse at 30% 30%, #4cb5bd, #1d7c86 70%); color: #fff; font-weight: 700; font-size: 12px; padding: 6px 8px; text-align: left; overflow: hidden; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .25); transition: transform .15s, box-shadow .15s; }
.pond:hover { transform: translateY(-2px); }
.pond::after { content: ''; position: absolute; left: 24%; top: 50%; width: 44%; height: 20%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 20'%3E%3Cpath d='M2 10c8-6 22-8 34-5l10-4 2 4 10 2-10 3-2 4-10-3C24 14 10 16 2 10z' fill='%23083c40' opacity='.55'/%3E%3C/svg%3E") center / contain no-repeat; }
.pond.is-sel { border-color: #6dff7c; box-shadow: 0 0 0 3px rgba(109, 255, 124, .45), 0 0 18px rgba(109, 255, 124, .6); }
.pond.is-off { background: repeating-linear-gradient(45deg, #9fb5ae, #9fb5ae 6px, #a9beb7 6px, #a9beb7 12px); }
.pond.is-off::after { display: none; }
.pond__dot { position: absolute; right: 7px; bottom: 7px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .08); }
.dot--on-dinh { background: #22b14c; }
.dot--theo-doi { background: #f2b705; }
.dot--canh-bao { background: #e5383b; animation: blink 1.2s infinite; }
.dot--trong { background: #9aa8a3; }
@keyframes blink { 50% { box-shadow: 0 0 0 6px rgba(229, 56, 59, .25); } }
.fzone--u { grid-column: 1 / -1; margin-top: 10px; grid-template-columns: repeat(6, 1fr); padding-top: 10px; }
.fzone--u > b { position: static; grid-column: 1 / span 2; align-self: center; text-align: left; padding-left: 4px; }
.fzone--u { grid-auto-rows: 52px; }
.fzone--u .pond { min-height: 52px; }

/* ----- Gauges ----- */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.gauge { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 4px 8px; text-align: center; min-width: 0; }
.gauge h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.gauge svg { width: 100%; max-width: 130px; height: auto; display: block; margin: 0 auto; }
.gauge .val { font-weight: 800; font-size: 16px; fill: var(--ink); }
.gauge .lim { font-size: 10px; fill: var(--muted); }
.gauge .st { margin-top: 6px; }

/* ----- Alerts ----- */
.alerts { display: grid; gap: 4px; }
.al { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line2); }
.al:last-child { border-bottom: 0; }
.al__ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; font-size: 14px; }
.al__ic--warn { background: #f0a500; }
.al__ic--info { background: #2f6fd6; }
.al__ic--ok { background: #1f9a55; }
.al__ic--danger { background: #e5383b; }
.al__t { flex: 1; min-width: 0; }
.al__t b { display: block; font-size: 13.5px; }
.al__t span { color: var(--muted); font-size: 12.5px; }
.al time { color: var(--muted); font-size: 12px; }
.al.is-done { opacity: .5; }
.al.is-done b { text-decoration: line-through; }

/* ----- Media ----- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.mitem { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.mitem img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--mint2); cursor: zoom-in; }
.mitem div { padding: 8px 10px; font-size: 12.5px; display: grid; gap: 2px; }
.mitem b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mitem .acts { display: flex; gap: 4px; padding: 0 8px 8px; }
.mitem.is-pick { cursor: pointer; }
.mitem.is-pick:hover { border-color: var(--g400); box-shadow: 0 0 0 3px rgba(46, 154, 98, .18); }
.drop { border: 2px dashed #c6d8ce; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); background: var(--mint2); transition: background .15s, border-color .15s; }
.drop.is-over { background: var(--mint); border-color: var(--g400); }
.prod-thumb { width: 64px; height: 44px; border-radius: 6px; object-fit: cover; }

/* ----- Editor ----- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.editor-title { width: 100%; border: 0; font-size: 26px; font-weight: 800; padding: 6px 0; outline: 0; color: var(--ink); background: none; }
.ql-toolbar.ql-snow { border: 1px solid var(--line) !important; border-radius: 10px 10px 0 0; background: #fafcfb; position: sticky; top: 72px; z-index: 5; }
.ql-container.ql-snow { border: 1px solid var(--line) !important; border-top: 0 !important; border-radius: 0 0 10px 10px; font-family: var(--font) !important; font-size: 16px !important; }
.ql-editor { min-height: 420px; line-height: 1.7; }
.ql-editor p { margin: 0 0 .7em; }
.ql-editor ul, .ql-editor ol { margin: 0 0 .8em; }
.ql-editor h2 { font-size: 22px; margin: 1em 0 .4em; }
.ql-editor h3 { font-size: 18px; margin: 1em 0 .4em; }
.ql-editor img { border-radius: 8px; }
.side-card { position: sticky; top: 80px; display: grid; gap: 16px; }
.cover-prev { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; background: var(--mint2); border: 1px solid var(--line); }
.wc { font-size: 12px; color: var(--muted); }

/* ----- Settings ----- */
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.set-nav { display: grid; gap: 2px; background: #fff; border-radius: var(--r); padding: 8px; box-shadow: var(--shadow); position: sticky; top: 80px; }
.set-nav button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; font-weight: 500; color: var(--ink2); }
.set-nav button.is-on { background: var(--mint); color: var(--g700); font-weight: 700; }
.faq-edit { display: grid; gap: 10px; }
.faq-edit > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fcfdfc; }
.faq-edit .f { grid-column: 1; }

.qr-label { display: inline-grid; gap: 4px; text-align: center; border: 1px dashed #b9cfc4; border-radius: 10px; padding: 10px; background: #fff; }
.qr-label img { width: 140px; height: 140px; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22b14c; margin-right: 6px; animation: blink 1.6s infinite; }

/* ----- Responsive ----- */
@media (max-width: 1440px) {
  .kpi__val { font-size: 28px; }
  .kpi__ic { width: 64px; height: 64px; }
  .kpi__ic svg { width: 30px; height: 30px; }
  .top__demo { display: none; }
}
@media (max-width: 1280px) {
  .g-dash1, .g-dash2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .g-dash1 > :first-child, .g-dash2 > :first-child { grid-column: 1 / -1; }
  .g-farm2 { grid-template-columns: 1fr 1fr; }
  .g-farm2 > :last-child { grid-column: 1 / -1; }
  .top__search { width: 170px; }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-farm1, .g-21, .g-12, .editor-layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.side-open .side { transform: none; }
  .app.side-open .side__overlay { display: block; position: fixed; inset: 0; background: rgba(2, 30, 25, .45); z-index: 35; }
  .main { margin-left: 0; background-size: 380px auto; }
  .top { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .top__menu { display: inline-flex; order: 0; }
  .top__title { order: 1; flex: 1; }
  .top__bell { order: 2; }
  .top__user { order: 3; border-left: 0; padding-left: 0; }
  .tbl-wrap > .tbl { min-width: 640px; }
  .card > .tbl-wrap { margin: 0 -8px; }
  .top__title h1 { font-size: 20px; }
  .top__title p { display: none; }
  .top__search { order: 9; width: 100%; height: 40px; }
  .top__tools { order: 8; width: 100%; overflow-x: auto; }
  .top__uname { display: none; }
  .search-pop { width: 100%; }
  .view { padding: 4px 12px 24px; }
  .g3, .g2, .g-dash1, .g-dash2, .g-farm2, .set-layout { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; grid-template-columns: repeat(2, 1fr); }
  .row2, .row3 { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1fr 80px 100px 34px; }
  .item-row .total { display: none; }
  .login { grid-template-columns: 1fr; }
  .login__art { padding: 30px 20px 26px; }
  .login__art h1 { font-size: 24px; }
  .login__script { display: none; }
  .login__art::after { display: none; }
  .pop { width: min(340px, calc(100vw - 24px)); }
  .chart { height: 250px; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr; }
  .kpi__ic { width: 54px; height: 54px; }
  .dl { grid-template-columns: 110px 1fr; }
  .fmap { grid-template-columns: 1fr; }
  .fcanal { height: 16px; margin: 8px 0; }
  .fcanal::after { display: none; }
  .split-donut { grid-template-columns: 110px 1fr; }
  .inp--search { width: 100%; }
}
@media print {
  .side, .top, .toolbar, .modal__f, .b { display: none !important; }
  .main { margin: 0; }
  .modal { position: static; background: none; }
}

/* ===================== Bổ sung theo đề nghị 08/10/2026 ===================== */
.top__demo[hidden] { display: none !important; }
.login__hint { font-size: 12.5px; margin: 10px 0 0; }
.alert-warn, .alert-ok { display: block; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; margin: 0 0 12px; }
.alert-warn > svg, .alert-ok > svg { vertical-align: -3px; margin-right: 6px; }
.alert-warn { background: #fff6e8; color: #7a4d06; border: 1px solid #f3dcb2; }
.alert-ok { background: #e9f7ee; color: #16653a; border: 1px solid #cfe9d8; }
.mt0 { margin-top: 0; }
.pend { color: #8a6a1f; background: #fff6e2; border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.tfa { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.tfa img { border: 1px solid #e3e9e6; border-radius: 10px; }
.tfa__key { font-size: 16px; letter-spacing: .06em; background: #f4f7f5; padding: 8px 10px; border-radius: 8px; word-break: break-all; }
.rcodes { background: #f4f7f5; border-radius: 8px; padding: 10px 14px; line-height: 1.8; font-size: 15px; columns: 2; }
.steps2 { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; }
.rows { display: grid; gap: 8px; margin: 6px 0; }
.row-ed { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: start; }
.row-ed--3 { grid-template-columns: 1fr 1fr 1.6fr auto; }
.row-ed--st { grid-template-columns: 110px 1.3fr 2fr auto auto; align-items: center; }
.row-ed textarea { min-height: 40px; }
.sd-step { margin-bottom: 14px; }
.sd-step.is-later { opacity: .65; }
.sd-step.is-cur { box-shadow: 0 0 0 2px #16744f inset; }
.sd-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #16744f; color: #fff; font-size: 13px; margin-right: 6px; }
.sd-step.is-done .sd-n { background: #1f9a55; }
.sd-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.sd-g h4 { margin: 0 0 6px; font-size: 14px; }
.sd-g td:first-child { width: 62%; }
.sd-g td.r { white-space: normal !important; }
.sd-keep { margin-top: 12px; background: #f4f7f5; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.sd-keep ul { margin: 6px 0 0; padding-left: 20px; }
.ready { display: flex; flex-wrap: wrap; gap: 8px; }
.ready__i { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; background: #fff6e8; color: #7a4d06; font-size: 13px; }
.ready__i.is-ok { background: #e9f7ee; color: #16653a; }
.guide details { border-top: 1px solid #edf1ee; padding: 10px 2px; }
.guide summary { cursor: pointer; font-weight: 600; }
.guide p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: #304a45; }
.impcfg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #f7faf8; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 13.5px; }
.ibstep { border: 1px solid #e3e9e6; border-radius: 10px; padding: 8px 12px; margin: 0; }
.ibstep legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
pre.code { background: #0f2622; color: #d6efe4; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; overflow: auto; white-space: pre-wrap; }
label.radio { display: flex; gap: 8px; align-items: center; padding: 6px 0; cursor: pointer; }
.ul { margin: 0; padding-left: 20px; line-height: 1.7; font-size: 14px; }
@media (max-width: 760px) {
  .row-ed, .row-ed--3, .row-ed--st { grid-template-columns: 1fr; }
  .rcodes { columns: 1; }
}
@media print {
  .side, .top, .toolbar .b, .sd-step button, .sd-step form { display: none !important; }
}
