/* StockInSheet Data — giao diện báo cáo */

.sis-wrap {
	--sis-line: #e5e7eb;
	--sis-soft: #f8fafc;
	--sis-ink: #0f172a;
	--sis-mut: #64748b;
	--sis-acc: #2563eb;
	--sis-up: #16a34a;
	--sis-down: #dc2626;
	color: var(--sis-ink);
	font-size: 15px;
}

/* ---------- Mục lục báo cáo ---------- */

.sis-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
	margin: 20px 0;
}

.sis-card {
	display: block;
	padding: 18px;
	border: 1px solid var(--sis-line);
	border-radius: 12px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .15s, transform .15s, border-color .15s;
}

.sis-card:hover {
	box-shadow: 0 6px 20px rgba(15, 23, 42, .08);
	transform: translateY(-2px);
	border-color: #c7d2fe;
}

.sis-card h3 { margin: 0 0 6px; font-size: 17px; }
.sis-card p { margin: 0 0 10px; color: var(--sis-mut); font-size: 14px; line-height: 1.5; }
.sis-card-go { color: var(--sis-acc); font-weight: 600; font-size: 14px; }
.sis-card-accent { background: linear-gradient(135deg, #eff6ff, #f5f3ff); border-color: #c7d2fe; }

/* ---------- Đầu trang báo cáo ---------- */

.sis-report-head h2 { margin: 0 0 4px; }
.sis-report-head p { margin: 0 0 16px; color: var(--sis-mut); }

.sis-note {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
	padding: 10px 14px;
	margin: 12px 0;
	font-size: 14px;
}

.sis-meta { color: var(--sis-mut); font-size: 13px; }
.sis-back { margin-top: 18px; }

/* ---------- Form ---------- */

.sis-form {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	background: var(--sis-soft);
	border: 1px solid var(--sis-line);
	border-radius: 10px;
	padding: 14px;
	margin-bottom: 16px;
}

.sis-form label,
.sis-b-controls label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--sis-mut);
}

.sis-form input,
.sis-b-controls input {
	padding: 8px 10px;
	border: 1px solid var(--sis-line);
	border-radius: 7px;
	font-size: 14px;
	min-width: 240px;
	font-weight: 400;
	color: var(--sis-ink);
}

.sis-btn {
	padding: 9px 18px;
	background: var(--sis-acc);
	color: #fff;
	border: 0;
	border-radius: 7px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}

.sis-btn:hover { background: #1d4ed8; }
.sis-btn-ghost { background: #fff; color: var(--sis-mut); border: 1px solid var(--sis-line); }
.sis-btn-ghost:hover { background: var(--sis-soft); }

/* ---------- Bảng ---------- */

.sis-table-wrap { overflow-x: auto; margin: 14px 0; }

.sis-table {
	border-collapse: collapse;
	width: 100%;
	font-size: 14px;
	background: #fff;
}

.sis-table th,
.sis-table td {
	border: 1px solid var(--sis-line);
	padding: 9px 12px;
	text-align: right;
	white-space: nowrap;
}

.sis-table thead th {
	background: var(--sis-soft);
	font-weight: 600;
	position: sticky;
	top: 0;
}

.sis-table td.sis-label,
.sis-table th:first-child {
	text-align: left;
	white-space: normal;
	min-width: 180px;
}

.sis-table tbody tr:hover { background: #f9fafb; }
.sis-unit { color: var(--sis-mut); font-size: 12px; text-align: center !important; }

/* ---------- Quy ước màu sàn chứng khoán Việt Nam ---------- */
/* Tăng = xanh lá · Giảm = đỏ · Sàn = xanh dương · Trần = tím · Tham chiếu = vàng */

.sis-up { color: var(--sis-up); font-weight: 600; }
.sis-down { color: var(--sis-down); font-weight: 600; }
.sis-floor { color: #2563eb; font-weight: 700; }
.sis-ceiling { color: #a855f7; font-weight: 700; }
.sis-ref { color: #ca8a04; font-weight: 600; }

.sis-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 4px;
	vertical-align: middle;
	color: #fff;
}

.sis-badge-ce { background: #a855f7; }
.sis-badge-fl { background: #2563eb; }
.sis-gr-h { font-weight: 400; color: var(--sis-mut); font-size: 12px; }
.sis-sym-title { margin: 18px 0 2px; }

/* ---------- Tổng quan ---------- */

.sis-profile {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	border: 1px solid var(--sis-line);
	border-radius: 12px;
	padding: 18px;
	background: #fff;
	margin-bottom: 16px;
}

.sis-profile h3 { margin: 0 0 8px; }
.sis-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.sis-tag {
	background: #eff6ff;
	color: #1d4ed8;
	border-radius: 999px;
	padding: 3px 12px;
	font-size: 13px;
	font-weight: 600;
}

.sis-tag-soft { background: var(--sis-soft); color: var(--sis-mut); }
.sis-price { text-align: right; }
.sis-price-v { font-size: 30px; font-weight: 700; line-height: 1.1; }
.sis-price-src { color: var(--sis-mut); font-size: 12px; margin-top: 4px; }

.sis-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 12px;
	margin: 16px 0;
}

.sis-kpi {
	border: 1px solid var(--sis-line);
	border-radius: 10px;
	padding: 14px;
	background: #fff;
}

.sis-kpi-l { color: var(--sis-mut); font-size: 13px; margin-bottom: 6px; }
.sis-kpi-v { font-size: 20px; font-weight: 700; }
.sis-kpi-v small { font-size: 12px; color: var(--sis-mut); font-weight: 400; }

/* ---------- Trình tùy biến ---------- */

.sis-b-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	background: var(--sis-soft);
	border: 1px solid var(--sis-line);
	border-radius: 10px;
	padding: 14px;
	margin-bottom: 16px;
}

.sis-b-main {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

/* Cho phép ô lưới co lại để bảng rộng không đẩy tràn cả trang.
   Lưu ý: KHÔNG đặt overflow trên .sis-wrap — nó sẽ cắt mất menu gợi ý mã
   đang thả xuống. Bảng đã có khung cuộn riêng (.sis-table-wrap). */
.sis-b-main > * { min-width: 0; }
.sis-wrap { max-width: 100%; }
.sis-table-wrap { max-width: 100%; }

.sis-b-pool {
	border: 1px solid var(--sis-line);
	border-radius: 10px;
	padding: 14px;
	background: #fff;
	max-height: 640px;
	overflow-y: auto;
}

.sis-b-pool h4,
.sis-b-canvas h4 { margin: 0 0 10px; font-size: 15px; }
.sis-b-pool h5 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; color: var(--sis-mut); letter-spacing: .04em; }

#sis-search {
	width: 100%;
	padding: 7px 10px;
	border: 1px solid var(--sis-line);
	border-radius: 7px;
	margin-bottom: 8px;
	font-size: 14px;
}

.sis-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--sis-soft);
	border: 1px solid var(--sis-line);
	border-radius: 7px;
	padding: 6px 10px;
	margin: 0 4px 6px 0;
	font-size: 13px;
	cursor: grab;
	user-select: none;
}

.sis-chip:hover { border-color: var(--sis-acc); background: #eff6ff; }
.sis-chip-sel { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; font-weight: 600; cursor: default; }

.sis-chip-x {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font-size: 17px;
	line-height: 1;
	padding: 0 0 0 2px;
	opacity: .6;
}

.sis-chip-x:hover { opacity: 1; }

.sis-drop {
	border: 2px dashed #cbd5e1;
	border-radius: 10px;
	padding: 14px;
	min-height: 92px;
	background: #fff;
}

.sis-drop-over { border-color: var(--sis-acc); background: #eff6ff; }
.sis-drop-hint { color: #94a3b8; margin: 0; text-align: center; padding: 20px 0; }
.sis-loading { color: var(--sis-mut); padding: 16px 0; }

.sis-chart-box {
	margin-top: 20px;
	border: 1px solid var(--sis-line);
	border-radius: 10px;
	padding: 14px;
	background: #fff;
	height: 380px;
}

.sis-chart-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.sis-chart-head h4 { margin: 0; }

#sis-chart-type {
	padding: 6px 10px;
	border: 1px solid var(--sis-line);
	border-radius: 7px;
	font-size: 14px;
}

/* ---------- Thông báo lỗi ---------- */

.sis-errbox {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 8px;
	padding: 12px 14px;
	margin: 12px 0;
	font-size: 14px;
}

.sis-error { color: var(--sis-down); }
.sis-na { color: #9ca3af; }

/* ---------- Màn hình nhỏ ---------- */

@media (max-width: 860px) {
	.sis-b-main { grid-template-columns: 1fr; }
	.sis-b-pool { max-height: 320px; }
	.sis-form input,
	.sis-b-controls input { min-width: 0; width: 100%; }
	.sis-form label,
	.sis-b-controls label { width: 100%; }
	.sis-price { text-align: left; }
}

/* ---------- Trang chủ: tổng quan thị trường ---------- */

.sis-idx-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
	margin-bottom: 18px;
}

.sis-idx {
	border: 1px solid var(--sis-line);
	border-radius: 12px;
	padding: 16px;
	background: #fff;
}

.sis-idx-l { color: var(--sis-mut); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.sis-idx-v { font-size: 28px; font-weight: 700; line-height: 1.15; }
.sis-idx-c { font-size: 14px; margin-top: 2px; }
.sis-spark { width: 100%; height: 48px; margin-top: 8px; display: block; }

.sis-breadth { display: flex; gap: 14px; margin-top: 6px; font-weight: 600; }
.sis-muted { color: var(--sis-mut); font-weight: 400; }
.sis-tiny { font-size: 12px; }

.sis-dash-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
	gap: 16px;
}

.sis-panel {
	border: 1px solid var(--sis-line);
	border-radius: 12px;
	padding: 16px;
	background: #fff;
	min-width: 0;
}

.sis-panel h3 { margin: 0 0 10px; font-size: 16px; }
.sis-table-sm { font-size: 13px; }
.sis-table-sm th, .sis-table-sm td { padding: 6px 8px; }
.sis-table-sm td.sis-label { min-width: 0; }

.sis-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 18px 0 10px;
	font-size: 13px;
	font-weight: 600;
}

.sis-dash-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sis-dash-cta .sis-btn { text-decoration: none; display: inline-block; }

/* Giao diện Nhà Đầu Tư Việt đã dùng cột nội dung 1180px nên không cần kéo
   tràn mép nữa; chỉ cần không để bảng rộng đẩy vỡ trang. */
.sis-dash,
.sis-builder,
.sis-stock {
	max-width: 100%;
	box-sizing: border-box;
}

/* ---------- Bộ chọn mã & kỳ ---------- */

.sis-field { display: flex; flex-direction: column; gap: 5px; min-width: 260px; flex: 1 1 260px; }
.sis-field-l { font-size: 13px; font-weight: 600; color: var(--sis-mut); }
.sis-field-l em { font-weight: 400; font-style: normal; opacity: .75; }
.sis-field-actions { flex-direction: row; align-items: flex-end; gap: 8px; flex: 0 0 auto; min-width: 0; }

.sis-pick { position: relative; }

.sis-pick-box {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	min-height: 40px;
	padding: 5px 8px;
	background: #fff;
	border: 1px solid var(--sis-line);
	border-radius: 7px;
	cursor: text;
}

.sis-pick-box:focus-within { border-color: var(--sis-acc); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.sis-pick-chips { display: contents; }

.sis-pick-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	color: #1d4ed8;
	border-radius: 6px;
	padding: 2px 7px;
	font-size: 13px;
	font-weight: 700;
}

.sis-pick-x {
	background: none; border: 0; color: inherit; cursor: pointer;
	font-size: 15px; line-height: 1; padding: 0; opacity: .6;
}
.sis-pick-x:hover { opacity: 1; }

.sis-pick-input {
	flex: 1 1 110px;
	min-width: 110px;
	border: 0 !important;
	outline: none;
	padding: 3px 2px !important;
	font-size: 14px;
	background: transparent;
}

.sis-pick-menu {
	position: absolute;
	z-index: 50;
	top: calc(100% + 4px);
	left: 0; right: 0;
	max-height: 290px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--sis-line);
	border-radius: 9px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, .13);
}

.sis-pick-opt { padding: 7px 11px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.sis-pick-opt:last-child { border-bottom: 0; }
.sis-pick-opt:hover, .sis-pick-opt.is-on { background: #eff6ff; }
.sis-pick-opt strong { font-size: 14px; }
.sis-pick-ex { font-size: 11px; color: var(--sis-mut); margin-left: 7px; }
.sis-pick-nm { font-size: 12px; color: var(--sis-mut); margin-top: 1px; }

.sis-per-tabs { display: flex; gap: 4px; margin-bottom: 6px; }

.sis-per-tab {
	background: #fff; border: 1px solid var(--sis-line); color: var(--sis-mut);
	border-radius: 7px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sis-per-tab.is-on { background: var(--sis-acc); border-color: var(--sis-acc); color: #fff; }

.sis-per-years, .sis-per-quarters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }

.sis-per-btn {
	background: #fff; border: 1px solid var(--sis-line); color: var(--sis-ink);
	border-radius: 6px; padding: 4px 11px; font-size: 13px; cursor: pointer;
}
.sis-per-btn:hover { border-color: var(--sis-acc); }
.sis-per-btn.is-on { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 700; }

.sis-per-sel { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }

/* ---------- Trang chi tiết cổ phiếu ---------- */

.sis-sym-link { font-weight: 700; text-decoration: none; color: var(--sis-acc); }
.sis-sym-link:hover { text-decoration: underline; }

.sis-st-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 16px;
	border: 1px solid var(--sis-line);
	border-radius: 12px;
	padding: 18px;
	background: #fff;
	margin-bottom: 14px;
}

.sis-st-id h2 { margin: 0 0 8px; font-size: 26px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sis-st-name { font-size: 15px; font-weight: 400; color: var(--sis-mut); }
.sis-st-price { text-align: right; }
.sis-st-p { font-size: 32px; font-weight: 700; line-height: 1.1; }

.sis-st-chart {
	border: 1px solid var(--sis-line);
	border-radius: 12px;
	padding: 14px;
	background: #fff;
	height: 300px;
	margin-bottom: 14px;
}

.sis-st-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 8px;
}

.sis-st-modes { display: flex; gap: 5px; }
.sis-st-modes .sis-per-tab { text-decoration: none; display: inline-block; }

.sis-st-sec { margin-bottom: 20px; }
.sis-st-sec h3 { margin: 0 0 6px; font-size: 17px; }

.sis-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 20px; }
.sis-chip-row .sis-chip { text-decoration: none; color: inherit; gap: 8px; }

.sis-ttm {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	background: #f1f5f9;
	color: var(--sis-mut);
	border-radius: 4px;
	padding: 1px 5px;
	margin-left: 5px;
	vertical-align: middle;
	cursor: help;
}

/* =================================================================
   Bộ thành phần dùng chung — chuẩn hoá bảng, thẻ, ô tìm kiếm
   ================================================================= */

/* ---------- Ô tìm mã gọn trên đầu trang ---------- */

.sis-search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 1 260px;
	min-width: 0;
	margin: 0;
}

.sis-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	color: #94a3b8;
	font-size: 16px;
	pointer-events: none;
	line-height: 1;
}

.sis-search .sis-pick { flex: 1 1 auto; min-width: 0; }

.sis-search .sis-pick-box {
	min-height: 34px;
	padding: 3px 12px 3px 31px;
	border-radius: 999px;
	background: #f1f5f9;
	border-color: #e2e8f0;
}

.sis-search .sis-pick-box:focus-within {
	background: #fff;
	border-color: var(--sis-acc);
}

.sis-search .sis-pick-input { font-size: 13px; }
.sis-search .sis-pick-menu { left: auto; right: 0; width: 340px; max-width: 86vw; }

/* ---------- Bảng số liệu ---------- */

/* Bo góc và viền đặt ở KHUNG CUỘN, không đặt trên <table>: overflow:hidden
   trên bảng sẽ vô hiệu hoá position:sticky của cột chỉ tiêu. */
.sis-table {
	font-variant-numeric: tabular-nums;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
}

/* Kẻ ngang là đủ; kẻ ô vuông làm bảng rối mắt. */
.sis-table th,
.sis-table td {
	border: 0;
	border-bottom: 1px solid var(--sis-line);
	padding: 9px 12px;
}

.sis-table tbody tr:last-child td { border-bottom: 0; }

.sis-table thead th {
	background: var(--sis-soft);
	border-bottom: 1px solid #cbd5e1;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--sis-mut);
	z-index: 2;
}

.sis-table tbody tr:nth-child(even) { background: #fcfdfe; }
.sis-table tbody tr:hover { background: #f1f5f9; }

/* Cột chỉ tiêu dính lại khi cuộn ngang trên màn hình hẹp. */
.sis-table td.sis-label,
.sis-table thead th:first-child {
	position: sticky;
	left: 0;
	background: inherit;
	z-index: 1;
}

/* Vạch ngăn để khi cuộn ngang còn phân biệt được cột chỉ tiêu với phần số. */
.sis-table td.sis-label,
.sis-table thead th:first-child { box-shadow: 1px 0 0 var(--sis-line); }

.sis-table thead th:first-child { background: var(--sis-soft); z-index: 3; }
.sis-table tbody tr td.sis-label { background: #fff; }
.sis-table tbody tr:nth-child(even) td.sis-label { background: #fcfdfe; }
.sis-table tbody tr:hover td.sis-label { background: #f1f5f9; }

.sis-table-wrap {
	border: 1px solid var(--sis-line);
	border-radius: 10px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ---------- Thẻ & bảng điều khiển ---------- */

.sis-panel,
.sis-kpi,
.sis-idx,
.sis-card,
.sis-st-head,
.sis-st-chart,
.sis-profile {
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.sis-panel h3,
.sis-st-sec h3 {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--sis-line);
}

/* ---------- Nhãn sàn giao dịch ---------- */

.sis-pick-ind {
	font-size: 11px;
	color: var(--sis-mut);
	margin-left: 7px;
}

.sis-pick-ex {
	font-size: 10px;
	font-weight: 700;
	padding: 1px 5px;
	border-radius: 4px;
	background: #f1f5f9;
	color: var(--sis-mut);
}

.sis-ex-hose { background: #eff6ff; color: #1d4ed8; }
.sis-ex-hnx { background: #f0fdf4; color: #15803d; }
.sis-ex-upcom { background: #fefce8; color: #a16207; }

/* ---------- Khối giá đầu trang cổ phiếu ---------- */

.sis-st-head { padding: 20px 22px; }
.sis-st-id h2 { font-size: 22px; }

.sis-st-p { font-size: 34px; letter-spacing: -0.02em; }

/* Dải thông số phiên, gắn liền ngay dưới thẻ giá. */
.sis-st-head { margin-bottom: 0; border-radius: 12px 12px 0 0; }

.sis-st-range {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	padding: 10px 22px;
	margin-bottom: 14px;
	background: var(--sis-soft);
	border: 1px solid var(--sis-line);
	border-top: 0;
	border-radius: 0 0 12px 12px;
	font-size: 12.5px;
	color: var(--sis-mut);
}

.sis-st-range b { font-weight: 700; color: var(--sis-ink); }
.sis-st-range b.sis-ref,
.sis-st-range b.sis-ceiling,
.sis-st-range b.sis-floor { color: inherit; }
.sis-st-range b.sis-ref { color: #ca8a04; }
.sis-st-range b.sis-ceiling { color: #a855f7; }
.sis-st-range b.sis-floor { color: #2563eb; }

/* ---------- Màn hình nhỏ ---------- */

@media (max-width: 782px) {
	.sis-table th,
	.sis-table td { padding: 8px 10px; font-size: 13px; }
	.sis-table td.sis-label { min-width: 140px; }
	.sis-st-p { font-size: 28px; }
	.sis-st-head { padding: 16px; }
	.sis-kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
	.sis-kpi { padding: 11px; }
	.sis-kpi-v { font-size: 17px; }
}
