﻿/* ══════════════════════════════════════════════════════════════
   StarCat Core — Asset Dashboard + List Page
   ══════════════════════════════════════════════════════════════ */

/* ── Page Layout ─────────────────────────────────────────────── */
.at-page        { display:flex; flex-direction:column; height:calc(100vh - var(--sc-header-h,60px)); overflow:hidden; padding:20px; box-sizing:border-box; }
.at-layout      { display:flex; flex:1; overflow:hidden; border:1px solid var(--sc-border); border-radius:12px; min-height:0; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.at-sidebar {
    width: 220px; flex-shrink:0;
    background: var(--sc-surface);
    border-right: 1px solid var(--sc-border);
    display: flex; flex-direction:column;
    overflow-y: auto; padding: 12px 8px;
}
.at-sidebar-title {
    display:flex; align-items:center; gap:10px;
    padding: 8px 10px 14px;
    border-bottom: 1px solid var(--sc-border);
    margin-bottom: 8px;
}
.at-sidebar-title-icon {
    width:32px; height:32px; border-radius:8px;
    background: color-mix(in srgb,var(--sc-success) 15%,transparent);
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.at-sidebar-title-name { font-size:13px; font-weight:700; color:var(--sc-text-1); }
.at-sidebar-title-sub  { font-size:11px; color:var(--sc-text-3); }
.at-nav-item {
    display:flex; align-items:center; gap:9px;
    padding: 9px 12px; border-radius:8px;
    font-size:13px; color:var(--sc-text-2);
    cursor:pointer; transition: background 0.15s, color 0.15s;
    margin-bottom:2px;
}
.at-nav-item:hover  { background:var(--sc-surface-2); color:var(--sc-text-1); }
.at-nav-item.active { background:var(--sc-primary-light,#dbeafe); color:var(--sc-primary); font-weight:600; }
.at-nav-icon        { width:15px; height:15px; opacity:0.7; }
.at-nav-item.active .at-nav-icon { opacity:1; }

/* ── Report view tabs (แนวนอน แทน OpsSubNav aside เดิม — กัน nav ซ้อน sidebar)
   ใช้ .ops-tab เดียวกับ Patch Management (/patchmanagement .pm-tabrow) และ Dashboard หลัก (/dashboard
   .ops-tab-bar) และ ITSM (HelpdeskDashboard .hd-tabrow) เพื่อให้ style ตรงกันทุกโมดูล ── */
.at-tabrow { display:flex; align-items:flex-end; flex-wrap:wrap; padding:0 20px; background:var(--sc-surface); border-bottom:1px solid var(--sc-border); flex-shrink:0; }
.at-tabrow .ops-tab { margin-right:22px; }
.at-tabrow .ops-tab svg { flex-shrink:0; }

/* ── Content ─────────────────────────────────────────────────── */
.at-content {
    flex:1; overflow-y:auto;
    padding: 16px 20px;
    background:var(--sc-surface);
    display:flex; flex-direction:column; gap:12px;
}

/* ── Cards ───────────────────────────────────────────────────── */
.at-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg,12px);
    padding: 0;
    overflow: hidden;
}
.at-card-hdr {
    display:flex; align-items:center; gap:10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sc-border);
}
.at-card-hdr-icon {
    width:32px; height:32px; border-radius:8px;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.at-card-title  { font-size:13px; font-weight:700; color:var(--sc-text-1); flex:1; }
.at-card-badge  {
    font-size:11px; padding:3px 10px; border-radius:99px;
    background:var(--sc-surface-2); color:var(--sc-text-2);
    font-weight:600;
}
.at-card-body { padding:14px 16px; }

/* การ์ดในคอลัมน์ห้ามถูกบีบให้เตี้ยกว่าเนื้อหาตัวเอง
   .at-content เป็น flex column ที่ overflow-y: auto อยู่แล้ว แต่การ์ดทุกใบ flex-shrink เป็น 1
   ตามค่าปริยาย flex จึงเลือก "บีบการ์ดให้พอดีกล่อง" แทนที่จะปล่อยให้ล้นแล้วให้แม่เลื่อน — พอบีบ
   แล้ว overflow: hidden ของ .at-card (ซึ่งมีไว้ตัดมุมโค้ง) ก็ตัดส่วนที่เกินทิ้งเงียบ ๆ
   การ์ด "การใช้สิทธิ์การใช้งาน" มี 8 แถวแต่เห็น 4 · ซ่อนไว้ 151px ไม่มีแถบเลื่อนให้ตามไปดู */
.at-content > .at-card { flex-shrink: 0; }

/* ── KPI Row ─────────────────────────────────────────────────── */
.at-kpi-row { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; }
.at-kpi {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg,12px);
    padding: 14px 16px;
    position:relative; overflow:hidden;
}
.at-kpi-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.at-kpi-icon { font-size:18px; }
.at-kpi-trend { font-size:11px; font-weight:700; padding:2px 8px; border-radius:99px; }
.at-kpi-trend.up   { background:rgba(22,163,74,.12); color:var(--ops-success, #16a34a); }
.at-kpi-trend.down { background:rgba(220,38,38,.12); color:var(--ops-danger, #dc2626); }
.at-kpi-trend.neu  { background:var(--sc-surface-2); color:var(--sc-text-3); }
.at-kpi-val  { font-size:26px; font-weight:800; color:var(--sc-text-1); line-height:1.1; }
.at-kpi-label{ font-size:11px; color:var(--sc-text-2); margin-top:4px; }
.at-kpi.kc-blue   { border-left:3px solid var(--sc-primary); }
.at-kpi.kc-green  { border-left:3px solid var(--sc-success); }
.at-kpi.kc-orange { border-left:3px solid var(--sc-warning); }
.at-kpi.kc-red    { border-left:3px solid var(--sc-error); }
.at-kpi.kc-teal   { border-left:3px solid #0891b2; }
.at-kpi.kc-yellow { border-left:3px solid #ca8a04; }

/* ── Mid Row (3 panels) ──────────────────────────────────────── */
.at-mid-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
@media(max-width:900px) { .at-mid-row { grid-template-columns:1fr 1fr; } }
@media(max-width:600px) { .at-mid-row { grid-template-columns:1fr; } }

/* ── Donut ───────────────────────────────────────────────────── */
.at-donut-wrap { display:flex; gap:16px; align-items:center; flex-wrap:wrap; }
.at-legend-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; font-size:12px; }
.at-legend-dot  { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.at-legend-name { flex:1; color:var(--sc-text-2); }
.at-legend-val  { font-weight:700; color:var(--sc-text-1); min-width:36px; text-align:right; }
.at-legend-pct  { font-size:11px; color:var(--sc-text-3); min-width:30px; text-align:right; }

/* ── Bar row ─────────────────────────────────────────────────── */
.at-bar-row { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.at-bar-name { font-size:12px; color:var(--sc-text-2); min-width:80px; }
.at-bar-track { flex:1; height:6px; background:var(--sc-surface-2); border-radius:99px; overflow:hidden; }
.at-bar-fill  { height:100%; border-radius:99px; transition:width .4s; }
.at-bar-count { font-size:12px; font-weight:700; color:var(--sc-text-1); min-width:36px; text-align:right; }

/* ── Clickable numbers: each opens the list it counts ─────────── */
a.at-link { color:inherit; text-decoration:none; cursor:pointer; border-radius:6px; }
a.at-bar-row.at-link { margin-left:-6px; margin-right:-6px; padding:2px 6px; }
a.at-link:hover { background:var(--sc-surface-2); }
a.at-status-cell.at-link { display:block; }
a.at-status-cell.at-link:hover { border-color:var(--ops-primary, #4f46e5); }
a.at-link:focus-visible { outline:2px solid var(--ops-primary, #4f46e5); outline-offset:2px; }
tr.at-link-row { cursor:pointer; }
tr.at-link-row:hover td { background:var(--sc-surface-2); }

/* ── Bottom table ────────────────────────────────────────────── */
.at-bot-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}
@media(max-width:900px) { .at-bot-row { grid-template-columns:1fr; } }

/* ── Status grid ─────────────────────────────────────────────── */
.at-status-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.at-status-cell {
    border-radius:8px; padding:10px 12px; text-align:center;
    border: 1px solid var(--sc-border);
}
.at-status-val { font-size:20px; font-weight:800; }
.at-status-lbl { font-size:11px; color:var(--sc-text-2); margin-top:2px; }

/* ── Table ───────────────────────────────────────────────────── */
.at-tbl-wrap { overflow-x:auto; }
.at-tbl { width:100%; border-collapse:collapse; font-size:12px; }
.at-tbl th {
    background: var(--sc-surface-2); color:var(--sc-text-2);
    padding: 8px 12px; text-align:left; font-weight:600;
    border-bottom: 1px solid var(--sc-border);
    white-space:nowrap;
}
.at-tbl td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--sc-border-2,var(--sc-border));
    color: var(--sc-text-1);
}
.at-tbl tbody tr:hover { background:var(--sc-surface-2); }
.at-asset-id { font-family:var(--sc-font-mono); font-size:11px; color:var(--sc-primary); font-weight:700; }
.at-asset-name { font-weight:600; font-size:12px; }
.at-asset-spec { font-size:10px; color:var(--sc-text-3); }
.at-type-chip {
    display:inline-flex; gap:4px; align-items:center;
    font-size:11px; padding:2px 8px; border-radius:99px;
    background:var(--sc-surface-2); color:var(--sc-text-2);
}
.at-badge {
    display:inline-block; font-size:10px; font-weight:700;
    padding:2px 8px; border-radius:99px;
}
.at-badge-active  { background:rgba(22,163,74,.12); color:var(--ops-success, #16a34a); }
.at-badge-repair  { background:rgba(217,119,6,.12); color:var(--ops-warning, #d97706); }
.at-badge-lend    { background:rgba(139,92,246,.12); color:#7c3aed; }
.at-badge-retired { background:rgba(100,116,139,.12); color:var(--ops-text-2, #475569); }
.at-badge-new     { background:rgba(37,99,235,.12); color:var(--ops-accent, #2563eb); }

/* ── Age bar ─────────────────────────────────────────────────── */
.at-age-bar-wrap { flex:1; height:5px; background:var(--sc-surface-2); border-radius:99px; overflow:hidden; display:inline-block; width:60px; }
.at-age-bar { height:100%; border-radius:99px; }

/* ── Warranty ring ───────────────────────────────────────────── */
.at-warranty-ring { position:relative; display:inline-block; }
.at-warranty-ring-center {
    position:absolute; inset:0; display:flex; flex-direction:column;
    align-items:center; justify-content:center;
}
.at-warranty-ring-val { font-size:16px; font-weight:800; color:var(--sc-primary); }
.at-warranty-ring-lbl { font-size:10px; color:var(--sc-text-3); }

/* ── Expiry list ─────────────────────────────────────────────── */
.at-expiry-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--sc-border-2,var(--sc-border)); }
.at-expiry-item:last-child { border-bottom:none; }
.at-expiry-dot  { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.at-expiry-detail { flex:1; }
.at-expiry-name { font-size:12px; font-weight:600; color:var(--sc-text-1); }
.at-expiry-sub  { font-size:10px; color:var(--sc-text-3); }
.at-expiry-days { font-family:var(--sc-font-mono); font-size:12px; font-weight:700; white-space:nowrap; }
.at-days-critical { color:var(--ops-danger, #dc2626); }
.at-days-warn     { color:var(--ops-warning, #d97706); }

/* ── Total Asset grid ────────────────────────────────────────── */
.at-eqp-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.at-eqp-item {
    background:var(--sc-surface);
    border:1px solid var(--sc-border);
    border-radius:10px; padding:14px;
    cursor:pointer; transition:all .15s;
    display:flex; flex-direction:column; align-items:center; gap:6px;
}
.at-eqp-item:hover { border-color:var(--sc-primary); box-shadow:0 0 0 2px var(--sc-primary-light,#dbeafe); }
.at-eqp-name  { font-size:12px; font-weight:600; color:var(--sc-text-2); text-align:center; }
.at-eqp-count { font-size:24px; font-weight:800; color:var(--sc-text-1); }
.at-eqp-icon  { width:40px; height:40px; display:flex; align-items:center; justify-content:center; }
.at-eqp-img   { width:36px; height:36px; object-fit:contain; }

/* ── Skel ────────────────────────────────────────────────────── */
.at-skel {
    background: linear-gradient(90deg, var(--sc-surface-2) 25%, var(--sc-border) 50%, var(--sc-surface-2) 75%);
    background-size:200% 100%;
    animation: at-shimmer 1.4s infinite;
    border-radius:6px;
}
@keyframes at-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Filter row ──────────────────────────────────────────────── */
.at-filter-row {
    display:flex; align-items:center; gap:8px; flex-wrap:wrap;
    padding: 10px 16px;
    border-bottom: 1px solid var(--sc-border);
}
.at-select {
    background: var(--sc-surface); color:var(--sc-text-1);
    border: 1px solid var(--sc-border); border-radius:6px;
    font-size:12px; padding:5px 10px; outline:none;
}
.at-select:focus { border-color:var(--sc-primary); }

/* ── Modal ───────────────────────────────────────────────────── */
.at-modal-overlay {
    position:fixed; inset:0; z-index:1000;
    background:rgba(0,0,0,.45);
    display:flex; align-items:center; justify-content:center;
}
.at-modal {
    background:var(--sc-surface);
    border:1px solid var(--sc-border);
    border-radius:var(--sc-radius-lg,12px);
    width:min(800px,95vw);
    max-height:90vh;
    display:flex; flex-direction:column;
    box-shadow:0 20px 60px rgba(0,0,0,.3);
}
.at-modal-hdr {
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 18px;
    border-bottom:1px solid var(--sc-border);
}
.at-modal-title { font-size:14px; font-weight:700; color:var(--sc-text-1); }
.at-modal-close {
    width:28px; height:28px; border:none; border-radius:6px;
    background:var(--sc-surface-2); color:var(--sc-text-2);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer; font-size:14px;
}
.at-modal-footer {
    padding:10px 18px;
    border-top:1px solid var(--sc-border);
    text-align:right; font-size:11px; color:var(--sc-text-3);
}

/* ── Asset List Page ─────────────────────────────────────────── */
/* Wrapper matches .db-page / .csp-page: 20px-margin rounded card, so
   the Asset List feels consistent with Dashboard and Configurations. */
.at-list-page {
    display: flex; flex-direction: column;
    margin: 20px;
    border: 1px solid var(--sc-border);
    border-radius: 12px;
    overflow: hidden;
    height: calc(100vh - var(--sc-header-h, 60px) - 40px);
    background: var(--sc-surface);
    box-sizing: border-box;
}
.at-list-toolbar {
    display:flex; align-items:center; gap:8px; flex-wrap:wrap;
    padding:12px 20px;
    background:var(--sc-surface);
    border-bottom:1px solid var(--sc-border);
}
.at-list-title { font-size:15px; font-weight:700; color:var(--sc-text-1); flex:1; }
.at-search-input {
    height:34px; padding:0 12px;
    background:var(--sc-surface-2);
    border:1px solid var(--sc-border); border-radius:6px;
    font-size:12px; color:var(--sc-text-1); outline:none; width:200px;
}
.at-search-input:focus { border-color:var(--sc-primary); background:var(--sc-surface); }
.at-list-btn {
    height:34px; padding:0 14px; border-radius:6px;
    border:none; font-size:12px; font-weight:600; cursor:pointer;
    display:flex; align-items:center; gap:6px;
}
.at-list-btn-primary { background:var(--sc-primary); color:#fff; }
.at-list-btn-ghost   { background:var(--sc-surface-2); color:var(--sc-text-2); border:1px solid var(--sc-border); }
.at-list-btn-ghost:hover { background:var(--sc-border); color:var(--sc-text-1); }
.at-list-body { flex:1; overflow-y:auto; padding:16px 20px; }
.at-list-footer {
    padding:10px 20px;
    background:var(--sc-surface);
    border-top:1px solid var(--sc-border);
    display:flex; align-items:center; justify-content:space-between;
    font-size:12px; color:var(--sc-text-2);
}
.at-page-btns { display:flex; gap:4px; }
.at-page-btn {
    height:30px; padding:0 10px; border-radius:6px;
    border:1px solid var(--sc-border); background:var(--sc-surface);
    font-size:12px; color:var(--sc-text-2); cursor:pointer;
}
.at-page-btn:disabled { opacity:.4; cursor:not-allowed; }
.at-page-btn.active { background:var(--sc-primary); color:#fff; border-color:var(--sc-primary); }

/* ── แถบสลับมุมมองของงานเดียวกัน (AssetWorkspaceTabs, 2026-09-15) ──────────────
   ใช้กับคู่หน้าที่ยุบเหลือทางเข้าเดียวในแถบซ้าย: ยืม+รับคืน · โอน+รับโอน · จำหน่าย+หลักฐาน
   วางใต้ .csp-header จึงจับ padding 20px ให้ตรงกับหัวเรื่อง และคง .ops-tab ชุดกลางไว้เหมือน
   .at-tabrow ด้านบน (เจตนาเดิม: tab ทุกโมดูลหน้าตาตรงกัน) ── */
.itam-wsrow { display:flex; align-items:flex-end; flex-wrap:wrap; padding:0 20px; background:var(--sc-surface); border-bottom:1px solid var(--sc-border); flex-shrink:0; }
.itam-wsrow .ops-tab { margin-right:22px; text-decoration:none; }
.itam-wsrow .ops-tab svg { flex-shrink:0; }

/* ── Embedded mode (rendered as a tab inside the main Dashboard) ── */
.at-page.embedded { height: auto; overflow: visible; padding: 0; }
.at-page.embedded .at-layout { height: auto; border: none; border-radius: 0; overflow: visible; gap: 14px; background: transparent; }
.at-page.embedded .at-content { background: transparent; padding: 0; overflow: visible; }

/* ═══ หน้า Overview ของ ITAM แบบหน้า Overview ของ SLM (user 2026-10-09) ═══════════════════════════
   เฉพาะหน้า AssetDashboard (คลาส .at-ov บนกล่องนอก) — .at-card/.at-content ใช้ร่วมกับหน้าคลังวัสดุด้วย
   · พื้นเทาของโครงหน้าอยู่หลังการ์ด · แถวแท็บเป็นแถบไล่สีติดหัว (แบบหน้า ITSM) · การ์ดมุม 16 + เงาจาง
   · KPI: ไอคอนวงกลมพาสเทลคู่ชื่อแถวบน ตัวเลขใหญ่ข้างล่าง · หัวการ์ด: ไอคอนวงกลม + ชื่อ ไม่มีเส้นใต้ */
.at-page.at-ov .at-content { background:transparent; padding:0 24px 24px; gap:20px; }
.at-page.at-ov:not(.embedded) .at-tabrow {
    margin:0 -24px; padding:6px 24px 0; flex-wrap:wrap;
    position:sticky; top:0; z-index:3;
    background:linear-gradient(to bottom, var(--sc-bg), var(--ops-bg, #f6f7f9));
    border-bottom:0; box-shadow:inset 0 -1px 0 var(--sc-border);
}
.at-page.at-ov .at-tabrow .ops-tab::after { background:var(--sc-accent); height:2px; border-radius:0; }
.at-page.at-ov .at-tabrow .ops-tab.active { color:var(--sc-accent); }

/* กะทัดรัด (user 2026-10-09 "ปรับหน่อย" — สองแถวสามใบสูงราว 330px): ระยะขอบ/ตัวเลขเล็กลง · พื้นที่เนื้อหากว้าง
   พอเรียงหกใบแถวเดียว · วัดจากความกว้างเนื้อหา (container) ไม่ใช่จอ เพราะแถบซ้ายกาง/ย่อได้ */
.at-page.at-ov .at-content { container-type:inline-size; }
.at-page.at-ov .ops-kpi-strip { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px; }
@container (min-width: 1080px) { .at-page.at-ov .ops-kpi-strip { grid-template-columns:repeat(6, minmax(0, 1fr)); } }
@container (max-width: 640px)  { .at-page.at-ov .ops-kpi-strip { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
.at-page.at-ov .ops-kpi {
    display:grid; grid-template-columns:auto minmax(0, 1fr); grid-template-areas:"top lbl" "val val" "sub sub";
    column-gap:10px; align-items:center;
    padding:14px 18px; background:var(--sc-bg2);
    border:1px solid var(--sc-border); border-radius:16px;
    box-shadow:0 1px 2px rgba(17,24,39,.04), 0 4px 16px rgba(17,24,39,.04);
}
.at-page.at-ov .ops-kpi-top { grid-area:top; min-height:0; }
.at-page.at-ov .ops-kpi-ico { width:32px; height:32px; background:color-mix(in srgb, var(--kpi-c) 12%, transparent); color:var(--kpi-c); }
.at-page.at-ov .ops-kpi-ico svg { width:16px; height:16px; }
.at-page.at-ov .ops-kpi-label { grid-area:lbl; margin-top:0; font-size:12.5px; font-weight:500; color:var(--sc-text-2); white-space:normal; }
.at-page.at-ov .ops-kpi-vals { grid-area:val; margin-top:8px; }
.at-page.at-ov .ops-kpi-val { font-size:24px; font-weight:700; line-height:1.15; }
.at-page.at-ov .ops-kpi-sub { grid-area:sub; margin-top:2px; font-size:11.5px; line-height:1.4; color:var(--sc-text-2); }

.at-page.at-ov .at-mid-row { gap:20px; }
.at-page.at-ov .at-card {
    background:var(--sc-bg2); border-radius:16px;
    box-shadow:0 1px 2px rgba(17,24,39,.04), 0 4px 16px rgba(17,24,39,.04);
}
.at-page.at-ov .at-card-hdr { padding:18px 22px 12px; border-bottom:0; gap:12px; }
.at-page.at-ov .at-card-hdr-icon { width:36px; height:36px; border-radius:50%; }
.at-page.at-ov .at-card-title { font-size:14px; font-weight:600; color:var(--sc-text); min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.at-page.at-ov .at-card-badge { flex-shrink:0; white-space:nowrap; }
.at-page.at-ov .at-card-badge { display:inline-flex; align-items:center; height:22px; padding:0 10px; font-size:11.5px; font-weight:500; }
.at-page.at-ov .at-card-body { padding:4px 22px 20px; }

/* ── หน้ารายการ ITAM แบบหัวไล่สี (user 2026-10-09 · เริ่มที่ใบขอซื้อ PR) ─────────────────────
   ใช้คู่กับ class="csp-page itam-list" · หัว (ชื่อ + จำนวน + ปุ่ม) กับแถวค้นหาเป็นแถบเดียวกันที่ไล่จาก
   สีพื้นลงมาเป็นขาว แบบหน้ารายการใบงาน ITSM · ไอคอนหน้าชื่อเป็นตัวเดียวกับในแถบซ้าย */
.csp-page.itam-list > .csp-header {
    padding:14px 20px 6px;
    background:linear-gradient(to bottom, var(--sc-bg), var(--sc-surface));
    border-bottom:0;
}
.csp-page.itam-list .csp-title { display:inline-flex; align-items:center; gap:10px; font-size:15px; font-weight:700; }
.itam-list-ic {
    display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
    width:32px; height:32px; border-radius:50%;
    background:color-mix(in srgb, var(--sc-primary) 12%, var(--sc-surface)); color:var(--sc-primary);
}
.itam-list-badge {
    display:inline-block; font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:99px;
    background:color-mix(in srgb, var(--sc-primary) 10%, transparent); color:var(--sc-primary);
}
.csp-page.itam-list .csp-table-toolbar { padding:8px 20px 12px; gap:8px; }
.csp-page.itam-list .csp-search { flex:1 1 260px; max-width:420px; height:34px; background:var(--sc-surface); }
.csp-page.itam-list .csp-chip-filter { height:34px; padding:0 12px; border-radius:7px; background:var(--sc-surface); }
.csp-page.itam-list .csp-count { margin-left:auto; }
/* คอลัมน์แรกเริ่มที่ 20px ตรงกับชื่อหน้าและช่องค้นหา (เดิม 14px) */
.csp-page.itam-list .csp-table th:first-child,
.csp-page.itam-list .csp-table td:first-child { padding-left:20px; }
.csp-page.itam-list .csp-table td { vertical-align:top; }
.csp-page.itam-list .csp-table td.act { vertical-align:middle; }

/* เลขที่เอกสารเต็มบรรทัดเดียว + สถานะใต้เลข (แบบรายการใบงาน) — สถานะจึงไม่ต้องมีคอลัมน์ของตัวเอง */
/* เลขที่ยาวผิดปกติ (มีสัญญาที่กรอกชื่อบริษัทลงช่องเลขที่) ตัดด้วย … ไม่ให้ดันคอลัมน์จนตารางล้นจอ · ค่าเต็มอยู่ใน title */
.itam-doc-no { display:block; white-space:nowrap; max-width:132px; overflow:hidden; text-overflow:ellipsis; font-family:var(--sc-font-mono); font-size:12.5px; font-weight:600; }
/* ป้ายยาว (เช่นประเภทสัญญา "สัญญาอนุญาตซอฟต์แวร์") ตัดด้วย … ไม่ให้ดันคอลัมน์จนตารางล้นจอ · ค่าเต็มอยู่ใน title */
.csp-page.itam-list .itam-under { display:inline-block; margin-top:5px; max-width:142px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:top; }
/* หัวเรื่องเป็นเนื้อหาหลักของแถว — ได้ที่ที่เหลือทั้งหมด · ยาวเกินตัดที่ 2 บรรทัด คำอธิบายตัดที่ 1 บรรทัด */
.itam-subj { min-width:200px; }
.itam-subj-t {
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;
    font-weight:500; color:var(--sc-text-1); line-height:1.45;
}
.itam-subj .sub { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:520px; }
/* วันที่ขึ้นบรรทัดบน เวลาเป็นบรรทัดล่างตัวจาง (เดิม "03/07/2024 16:57:47" ทำให้คอลัมน์กว้าง 167px) */
.itam-dt { display:block; white-space:nowrap; }
.itam-tm { display:block; font-size:11px; color:var(--sc-text-3); margin-top:1px; }
/* วันหมดอายุ + วันที่เหลือ (หน้าสัญญา) — สีมาจาก RemStyle ของหน้า */
.itam-rem { display:block; font-family:var(--sc-font-sans); font-size:11.5px; font-weight:600; margin-top:2px; white-space:nowrap; }
.itam-clamp2 { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
/* หน้าที่มีแถวตัวกรองของตัวเองนอกตาราง (สัญญา: .csp-filterbar) — ต่อจากหัวไล่สีเป็นแถบเดียวกัน
   (สไตล์ในหน้าเดิมไม่มี padding ซ้าย-ขวา แถวตัวกรองจึงชิดขอบ) */
.csp-page.itam-list .csp-filterbar {
    padding:4px 20px 12px; gap:8px;
    background:var(--sc-surface); border-bottom:1px solid var(--sc-border);
}
/* หน้าที่ช่องค้นหาอยู่บนหัว (สัญญา) — ให้กว้างพอเห็นคำแนะนำเต็ม */
.csp-page.itam-list .csp-header .csp-search { flex:0 1 320px; width:320px; }
/* สถานะ + ใกล้หมดอายุ + ประเภท ให้อยู่แถวเดียว — หดปุ่ม/ช่องเลือกของหน้าเดิมลงเล็กน้อย */
.csp-page.itam-list .csp-filterbar .csp-seg-btn { padding:5px 10px; }
.csp-page.itam-list .csp-filterbar .csp-expiry-ctl { padding:2px 4px 2px 10px; }
.csp-page.itam-list .csp-filterbar .csp-expiry-ctl .csp-filter-select { padding:4px 6px; }
.csp-page.itam-list .csp-filterbar > .csp-filter-select { height:34px; padding-top:0; padding-bottom:0; max-width:160px; }
