/* Copied unchanged from LicenseManagerOnWeb/wwwroot/css/app.css (sections 1-3, the Info360 UI standard).
   Do not edit here: change the standard at its source and copy it again. */
/* =====================================================================
   Info360 UI standard (ทิศทาง B, ตกลง 2026-11-15) - ชุดกลางของทั้งระบบ
   1) ตัวแปรสี / ฟอนต์ / ระยะ  2) โครงหน้า: เมนูซ้าย + แถบบน  3) ชิ้นส่วน ui-*
   หน้าใหม่และหน้าที่ย้ายมาใช้มาตรฐานนี้ ให้ใช้ตัวแปรและคลาส ui-* จากไฟล์นี้
   ห้ามใส่ค่าสี / ขนาดตัวอักษรตรงๆ ในหน้า
   ===================================================================== */

/* ---------- 1) ตัวแปร ---------- */
:root {
    /* พื้นและเส้น */
    --ui-bg: #F3F4F6;            /* พื้นหลังแอป */
    --ui-surface: #FFFFFF;       /* พื้นเนื้อหา */
    --ui-surface-2: #F6F7F9;     /* พื้นรอง (แถบสรุป, หัวตาราง hover) */
    --ui-line: #DDE1E7;          /* เส้นแบ่งทั่วไป */
    --ui-line-strong: #C9CFD8;   /* ขอบช่องกรอก, เส้นใต้หัวตาราง */
    --ui-line-soft: #E9ECF0;     /* เส้นระหว่างแถว */

    /* ตัวอักษร */
    --ui-text: #14181F;
    --ui-text-2: #56606E;        /* ข้อความรอง (ผ่าน 4.5:1 บนพื้นขาว) */
    --ui-link: #0B5CAD;
    --ui-link-hover: #08467F;

    /* สีหลัก: ปุ่มหลักสีเข้ม · ส้มของแบรนด์ใช้บอกตำแหน่งเท่านั้น (เมนู / แท็บ / ขั้นตอนที่เลือก) */
    --ui-ink: #14181F;
    --ui-ink-2: #262E3A;
    --ui-brand: #F0913F;
    --ui-brand-strong: #D9741A;
    --ui-brand-soft: #FFF6EC;

    /* สีสถานะ 5 สี: ตัวหนังสือ / พื้นอ่อน - ใช้ให้ตรงกันทุกหน้า */
    --ui-info: #0B5CAD;    --ui-info-soft: #E8F1FB;
    --ui-ok: #0B6B43;      --ui-ok-soft: #E7F6EE;
    --ui-warn: #8A4B00;    --ui-warn-soft: #FFF4D6;
    --ui-bad: #A8261B;     --ui-bad-soft: #FEECEB;
    --ui-idle: #56606E;    --ui-idle-soft: #F0F2F5;
    /* สีแถบบนของการ์ดสรุป (.ui-stat.tone-*) - สว่างกว่าสีตัวอักษรเพราะเป็นเส้นบาง */
    --ui-info-mark: #2F7FD1; --ui-ok-mark: #1F9D62; --ui-warn-mark: #E0A100;
    --ui-bad-mark: #D4483B;  --ui-idle-mark: #9AA6B5; --ui-demo-mark: #7A58C9; --ui-teal-mark: #1C9C9C;

    /* เมนูซ้าย */
    --ui-nav-bg: #14181F;
    --ui-nav-text: #C9D1DB;
    --ui-nav-muted: #9AA6B5;
    --ui-nav-hover: #1F2630;
    --ui-nav-on: #262E3A;
    --ui-nav-line: #2A323E;

    /* ตัวอักษร: 6 ขนาด */
    --ui-font: 'Noto Sans Thai', 'Segoe UI', Tahoma, sans-serif;
    --ui-fs-xs: 11px;    /* หัวคอลัมน์, หัวกลุ่มเมนู */
    --ui-fs-sm: 12px;    /* บรรทัดรอง */
    --ui-fs-md: 13px;    /* ตาราง, เมนู, ปุ่ม */
    --ui-fs-lg: 14px;    /* เนื้อหา, ฟอร์ม */
    --ui-fs-xl: 18px;    /* ตัวเลขสรุป */
    --ui-fs-h1: 20px;    /* ชื่อหน้า */

    /* มุมและระยะ */
    --ui-radius: 6px;
    --ui-radius-pill: 999px;
    --ui-gap-1: 4px; --ui-gap-2: 8px; --ui-gap-3: 12px; --ui-gap-4: 16px; --ui-gap-5: 24px;
    --ui-control-h: 34px;
    --ui-nav-w: 224px;
    --ui-topbar-h: 48px;
}

/* ---------- 2) โครงหน้า ---------- */
body.lm-app { background: var(--ui-bg); font-family: var(--ui-font); color: var(--ui-text); margin-bottom: 0; }
.lm-shell { display: flex; min-height: 100vh; }

.sb {
    width: var(--ui-nav-w); flex: 0 0 var(--ui-nav-w); background: var(--ui-nav-bg); color: var(--ui-nav-text);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    overflow-x: hidden; overflow-y: auto; z-index: 30;
    transition: width .18s ease, flex-basis .18s ease;
    scrollbar-width: thin; scrollbar-color: var(--ui-nav-line) transparent;
}
.sb-brand {
    display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700;
    padding: 14px 18px 12px; white-space: nowrap; text-decoration: none;
}
.sb-brand:hover { color: #fff; text-decoration: none; }
/* Info360 logo: full INFO mark + "360" when open, just the orange-dot "i" when collapsed */
.sb-logo-i { display: none; height: 24px; width: auto; }
.sb-logo-full { display: inline-flex; align-items: flex-end; gap: 3px; }
.sb-logo-full img { height: 24px; width: auto; display: block; }
.sb-logo-full b {
    font-family: 'Poppins', 'Segoe UI', sans-serif; font-weight: 700; font-size: 21px;
    line-height: .74; letter-spacing: -.5px; color: var(--ui-brand); margin-bottom: 2px;
}
body.sb-collapsed .sb .sb-logo-i { display: block; }
.sb-nav { flex: 1 1 auto; padding: 0 8px 10px; }
.sb-grp {
    font-size: var(--ui-fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ui-nav-muted);
    margin: 6px 0 1px; padding: 0 10px; min-height: 32px; white-space: nowrap; display: flex; align-items: center;
}
.sb-item {
    display: flex; align-items: center; gap: 9px; margin: 1px 0; padding: 0 10px; min-height: 36px;
    border-radius: var(--ui-radius); color: var(--ui-nav-text); font-size: var(--ui-fs-md); white-space: nowrap; text-decoration: none;
}
.sb-item:hover { background: var(--ui-nav-hover); color: #fff; text-decoration: none; }
.sb-item:focus-visible, .sb-grp.sb-tog:focus-visible { outline: 2px solid var(--ui-brand); outline-offset: -2px; }
.sb-item.on { background: var(--ui-nav-on); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--ui-brand); }
.sb-item i { width: 16px; text-align: center; font-size: 15px; flex: 0 0 16px; }
.sb-item .sb-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* ตัวเลขแจ้งเตือนในเมนู: ตัวเลขสีส้ม ไม่ใช้ป้ายแดงทึบ */
.sb-item .badge {
    background: transparent !important; color: var(--ui-brand); padding: 0; margin: 0 !important;
    font-size: var(--ui-fs-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}
.sb-foot { border-top: 1px solid var(--ui-nav-line); padding: 8px 8px 12px; }
/* หัวกลุ่มเมนูกดหด / ขยายได้ · เปิดเฉพาะกลุ่มของหน้าปัจจุบันและกลุ่มที่ผู้ใช้เปิดไว้ */
.sb-grp.sb-tog { cursor: pointer; justify-content: space-between; gap: 6px; user-select: none; border-radius: var(--ui-radius); }
.sb-grp.sb-tog:hover { color: #fff; background: var(--ui-nav-hover); }
.sb-grp.sb-tog::after { content: "\F282"; font-family: bootstrap-icons; font-size: 10px; letter-spacing: 0; transition: transform .15s; }
.sb-grp.sb-tog.closed::after { transform: rotate(-90deg); }
.sb-grp .sb-cnt { display: none; margin-left: auto; font-size: var(--ui-fs-xs); letter-spacing: 0; font-weight: 500; }
.sb-grp.closed .sb-cnt { display: inline; }
.sb-item.sb-hid { display: none; }

.lm-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tb {
    height: var(--ui-topbar-h); background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); display: flex;
    align-items: center; gap: var(--ui-gap-2); padding: 0 14px; position: sticky; top: 0; z-index: 20;
}
.tb-btn {
    border: 0; background: transparent; color: var(--ui-text-2); font-size: 18px; line-height: 1;
    padding: 6px 8px; border-radius: var(--ui-radius);
}
.tb-btn:hover { background: var(--ui-surface-2); color: var(--ui-text); }
.tb-user { font-size: var(--ui-fs-md); display: flex; align-items: center; gap: 7px; color: var(--ui-text); font-weight: 500; }
.tb-user .bi-person-circle { font-size: 17px; color: var(--ui-text-2); }
.tb-user .bi-chevron-down { font-size: 10px; color: var(--ui-text-2); }
.tb-crumb { font-size: var(--ui-fs-md); color: var(--ui-text-2); display: flex; align-items: center; gap: 6px; min-width: 0; }
.tb-crumb a { color: var(--ui-text-2); text-decoration: none; white-space: nowrap; }
.tb-crumb a:hover { color: var(--ui-link); }
.tb-crumb b { color: var(--ui-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tb .lang-switch { border-color: var(--ui-line-strong); border-radius: var(--ui-radius); }
.tb .lang-switch a { color: var(--ui-text-2); }
.tb .lang-switch a:hover { background: var(--ui-surface-2); color: var(--ui-text); }
.tb .lang-switch a.on { background: var(--ui-ink); color: #fff; }
.lm-content { flex: 1 1 auto; padding: 18px 20px 10px; }
.lm-footer { border-top: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-text-2); font-size: var(--ui-fs-sm); padding: 10px 20px; }

/* ยุบเมนู (เดสก์ท็อป) */
body.sb-collapsed .sb { width: 60px; flex-basis: 60px; }
body.sb-collapsed .sb .sb-label { display: none; }
body.sb-collapsed .sb .sb-grp { min-height: 0; height: 1px; margin: 8px 6px; padding: 0; background: var(--ui-nav-line); color: transparent; overflow: hidden; }
body.sb-collapsed .sb .sb-item { justify-content: center; padding: 0; gap: 0; }
body.sb-collapsed .sb .sb-item .badge { display: none; }
body.sb-collapsed .sb .sb-item.sb-hid { display: flex; }
body.sb-collapsed .sb .sb-grp.sb-tog::after, body.sb-collapsed .sb .sb-grp .sb-cnt { display: none; }
body.sb-collapsed .sb .sb-brand { justify-content: center; padding: 14px 0 12px; }

/* มือถือ: เมนูเลื่อนเข้าจากซ้าย */
.sb-backdrop { display: none; }
@media (max-width: 860px) {
    .sb {
        position: fixed; left: 0; top: 0; transform: translateX(-100%);
        transition: transform .2s ease; width: 264px; flex-basis: 264px;
    }
    .sb-item { min-height: 44px; font-size: var(--ui-fs-lg); }
    .sb-grp { min-height: 40px; }
    body.sb-open .sb { transform: none; box-shadow: 0 0 48px rgba(0, 0, 0, .4); }
    body.sb-collapsed .sb { width: 264px; flex-basis: 264px; }
    body.sb-collapsed .sb .sb-label { display: inline; }
    body.sb-collapsed .sb .sb-item { justify-content: flex-start; padding: 0 10px; gap: 9px; }
    body.sb-collapsed .sb .sb-item .badge { display: inline; }
    body.sb-collapsed .sb .sb-grp { height: auto; min-height: 40px; margin: 6px 0 1px; padding: 0 10px; background: none; color: var(--ui-nav-muted); overflow: visible; }
    body.sb-collapsed .sb .sb-item.sb-hid { display: none; }
    body.sb-collapsed .sb .sb-grp.sb-tog::after { display: inline; }
    body.sb-collapsed .sb .sb-grp.closed .sb-cnt { display: inline; }
    body.sb-collapsed .sb .sb-brand { justify-content: flex-start; padding: 14px 18px 12px; }
    body.sb-collapsed .sb .sb-logo-i { display: none; }
    body.sb-collapsed .sb .sb-logo-full { display: inline-flex; }
    body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 25; }
    .lm-content { padding: 14px 12px 10px; }
    .tb-crumb .tb-crumb-grp, .tb-crumb .tb-crumb-sep { display: none; }
    /* หัวหน้าของหน้ารุ่น dp-*: ปุ่มลงไปอยู่บรรทัดล่าง ชื่อหน้าได้เต็มความกว้าง */
    body.lm-app .dp-hero-top .dp-actions, body.lm-app .ui-head .ui-actions { margin-left: 0; width: 100%; }
}

/* ---------- 3) ชิ้นส่วน ui-* (สำหรับหน้าที่ย้ายมาใช้มาตรฐานนี้) ---------- */
.ui-page { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 20px 24px 24px; font-size: var(--ui-fs-md); line-height: 1.5; color: var(--ui-text); display: flex; flex-direction: column; gap: var(--ui-gap-4); }
.ui-page a { color: var(--ui-link); text-decoration: none; }
.ui-page a:hover { color: var(--ui-link-hover); text-decoration: underline; }
.ui-num { font-variant-numeric: tabular-nums; }
.ui-sub { font-size: var(--ui-fs-sm); color: var(--ui-text-2); }

/* หัวหน้า: ชื่อหน้า + ปุ่มชิดขวา */
.ui-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ui-gap-3); }
.ui-head h1 { margin: 0; font-size: var(--ui-fs-h1); font-weight: 700; line-height: 1.3; }
.ui-actions { display: flex; flex-wrap: wrap; gap: var(--ui-gap-2); }

/* ปุ่ม: หลัก (สีเข้ม หน้าละปุ่มเดียว) / รอง (ขอบ) / อันตราย */
.ui-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ui-control-h); padding: 0 12px;
    border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius); background: var(--ui-surface);
    font: inherit; font-size: var(--ui-fs-md); font-weight: 500; color: var(--ui-text); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.ui-btn:hover { background: var(--ui-surface-2); color: var(--ui-text); text-decoration: none; }
.ui-btn:focus-visible { outline: 2px solid var(--ui-link); outline-offset: 2px; }
.ui-btn.primary { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; font-weight: 600; }
.ui-btn.primary:hover { background: var(--ui-ink-2); color: #fff; }
.ui-btn.danger { color: var(--ui-bad); }
.ui-btn.sm { height: 30px; padding: 0 10px; }
.ui-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ช่องกรอก */
.ui-input, .ui-select {
    height: var(--ui-control-h); box-sizing: border-box; padding: 0 10px; border: 1px solid var(--ui-line-strong);
    border-radius: var(--ui-radius); background: var(--ui-surface); font: inherit; font-size: var(--ui-fs-md); color: var(--ui-text);
}
.ui-input:focus, .ui-select:focus { outline: 2px solid var(--ui-link); outline-offset: -1px; border-color: var(--ui-link); }

/* ป้ายชื่อคู่กับช่องกรอกในแถวตัวกรอง + ข้อความแจ้งในหน้า */
.ui-field { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--ui-fs-sm); color: var(--ui-text-2); white-space: nowrap; }
.ui-field.col { flex-direction: column; align-items: stretch; gap: 2px; }
.ui-field.col > label { margin: 0; }
.ui-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-gap-2); padding: 8px 12px; border-radius: var(--ui-radius); background: var(--ui-info-soft); color: var(--ui-text); font-size: var(--ui-fs-md); }
.ui-note.warn { background: var(--ui-warn-soft); }
.ui-note.bad { background: var(--ui-bad-soft); }

/* แถบตัวเลขสรุป (กดแล้วกรองได้) */
.ui-stat[hidden], .ui-stats[hidden] { display: none; }
.ui-stats { display: flex; flex-wrap: wrap; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface-2); overflow: hidden; }
.ui-stat { flex: 1 1 150px; padding: 10px 16px; display: flex; flex-direction: column; border-right: 1px solid var(--ui-line); color: var(--ui-text); text-decoration: none; }
.ui-page a.ui-stat { color: var(--ui-text); }
.ui-page a.ui-stat:hover { background: var(--ui-surface); text-decoration: none; }
.ui-stat .k { font-size: var(--ui-fs-sm); color: var(--ui-text-2); }
.ui-stat .v { font-size: var(--ui-fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.ui-stat.on { background: var(--ui-surface); box-shadow: inset 0 3px 0 var(--stat-c, transparent), inset 0 -2px 0 var(--ui-brand-strong); }
/* สีตามความหมาย = เส้น 3px ที่ขอบบน: info ยอดรวม · ok ปกติ · warn รอ/ใกล้ถึงกำหนด · bad เกินกำหนด · idle ยกเลิก · demo ทดสอบ (ไม่ใส่ = กลาง) */
.ui-stat { box-shadow: inset 0 3px 0 var(--stat-c, transparent); }
.ui-stat.tone-info { --stat-c: var(--ui-info-mark); }
.ui-stat.tone-ok { --stat-c: var(--ui-ok-mark); }
.ui-stat.tone-warn, .ui-stat.tone-warning { --stat-c: var(--ui-warn-mark); }
.ui-stat.tone-bad, .ui-stat.tone-danger { --stat-c: var(--ui-bad-mark); }
.ui-stat.tone-idle { --stat-c: var(--ui-idle-mark); }
.ui-stat.tone-demo { --stat-c: var(--ui-demo-mark); }

/* แท็บ (เส้นใต้สีส้ม = ที่เลือก) + แถวตัวกรอง */
.ui-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ui-gap-2); border-bottom: 1px solid var(--ui-line); }
.ui-tabs { display: flex; flex-wrap: wrap; gap: var(--ui-gap-1); margin-right: auto; }
.ui-tab { height: 38px; padding: 0 12px; display: inline-flex; align-items: center; border: 0; border-bottom: 2px solid transparent; background: transparent; font: inherit; color: var(--ui-text-2); cursor: pointer; text-decoration: none; }
.ui-page a.ui-tab { color: var(--ui-text-2); }
.ui-page a.ui-tab:hover { color: var(--ui-text); text-decoration: none; }
.ui-page a.ui-tab.on, .ui-tab.on { color: var(--ui-text); font-weight: 600; border-bottom-color: var(--ui-brand-strong); }
.ui-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-gap-2); padding-bottom: 6px; }

/* ตาราง: หัวสีอ่อน แถวเตี้ย เส้นบาง */
.ui-table-wrap { overflow-x: auto; }
.ui-table { width: 100%; border-collapse: collapse; font-size: var(--ui-fs-md); }
.ui-table thead th {
    padding: 8px; text-align: left; font-size: var(--ui-fs-xs); font-weight: 600; letter-spacing: .04em; color: var(--ui-text-2);
    border-bottom: 1px solid var(--ui-line-strong); white-space: nowrap; background: var(--ui-surface);
}
.ui-table tbody td { padding: 9px 8px; border-bottom: 1px solid var(--ui-line-soft); vertical-align: top; }
.ui-table tbody tr:hover td { background: var(--ui-surface-2); }
.ui-table tbody tr.sel td { background: var(--ui-brand-soft); }
.ui-table .r { text-align: right; }
.ui-table th:first-child, .ui-table td:first-child { padding-left: 0; }
.ui-table th:last-child, .ui-table td:last-child { padding-right: 0; }
.ui-empty { padding: 32px 0; text-align: center; color: var(--ui-text-2); }

/* สถานะ: จุดสี + ข้อความ (ค่าเริ่มต้น) หรือป้ายพื้นอ่อน (.ui-tag) */
.ui-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ui-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ui-idle); flex: 0 0 8px; }
.ui-status.info::before { background: var(--ui-info); } .ui-status.ok::before { background: var(--ui-ok); }
.ui-status.warn::before { background: var(--ui-brand-strong); } .ui-status.bad::before { background: var(--ui-bad); }
.ui-tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 4px; font-size: var(--ui-fs-sm); font-weight: 500; background: var(--ui-idle-soft); color: var(--ui-idle); white-space: nowrap; }
.ui-tag.info { background: var(--ui-info-soft); color: var(--ui-info); } .ui-tag.ok { background: var(--ui-ok-soft); color: var(--ui-ok); }
.ui-tag.warn { background: var(--ui-warn-soft); color: var(--ui-warn); } .ui-tag.bad { background: var(--ui-bad-soft); color: var(--ui-bad); }
.ui-text-ok { color: var(--ui-ok); font-weight: 600; } .ui-text-warn { color: var(--ui-warn); font-weight: 600; } .ui-text-bad { color: var(--ui-bad); font-weight: 600; }

/* หัวข้อย่อยในหน้ารายละเอียด + คู่ชื่อ-ค่า */
.ui-section { display: flex; flex-direction: column; gap: 10px; }
.ui-section > h2 { margin: 0; padding-bottom: 8px; font-size: var(--ui-fs-lg); font-weight: 700; border-bottom: 1px solid var(--ui-line-strong); }
.ui-kv { margin: 0; display: flex; flex-direction: column; }
.ui-kv > div { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 7px 0; border-bottom: 1px solid var(--ui-line-soft); }
.ui-kv dt { flex: 0 0 160px; color: var(--ui-text-2); font-weight: 400; }
.ui-kv dd { margin: 0; flex: 1 1 200px; }

/* แถบทำงานกับรายการที่เลือก */
.ui-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-gap-2); padding: 8px 12px; background: var(--ui-ink); color: #fff; }
.ui-bulk .ui-btn { background: transparent; border-color: var(--ui-text-2); color: #fff; height: 30px; }
.ui-bulk .ui-btn.go { margin-left: auto; background: var(--ui-brand); border-color: var(--ui-brand); color: var(--ui-ink); font-weight: 700; }

