/* MEGA Dokümanlar — Excel görünümlü doküman tablosu
   Kurumsal: lacivert #2D2E83, kırmızı #E30613, font Noto Sans */

.mega-dok {
	--mega-navy: #2d2e83;
	--mega-red: #e30613;
	--mega-text: #1f2330;
	--mega-muted: #6b7280;

	/* Cizgiler koyu lacivert yerine acik gri-mavi: tablo nefes alsin */
	--mega-line: #d5d8e8;
	--mega-line-strong: #b9bdd6;
	--mega-zebra: #f8f9fc;
	--mega-hover: #eef0f9;
	--mega-radius: 0px;

	font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--mega-text);
	font-size: 14px;
	line-height: 1.5;
	max-width: 100%;
	margin: 0 0 32px;
	box-sizing: border-box;
}

.mega-dok *,
.mega-dok *::before,
.mega-dok *::after {
	box-sizing: inherit;
}

/* Genislik: sayfanin kendi kabina uyar (header ile ayni hizada durur).
   Tasma yapmaz; Elementor bolum genisligi neyse onu kullanir. */
.mega-dok-full {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
	padding: 0;
}

/* Tema ezmelerine karsi koruma: bazi temalar SVG'ye genel kurallar uygular
   (fill, width:100%, max-width vb.) ve ikonlar dev sekillere donusur.
   Asagidaki kurallar eklenti kapsaminda bunu engeller. */

.mega-dok svg {
	display: inline-block;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
	vertical-align: middle;
	fill: none;
	stroke: currentColor;
	box-sizing: content-box;
}

.mega-dok svg circle,
.mega-dok svg path,
.mega-dok svg rect,
.mega-dok svg line,
.mega-dok svg polyline {
	fill: none;
	stroke: currentColor;
}

/* ---------- Üst lacivert bar ---------- */

.mega-dok-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	background: linear-gradient(135deg, #2d2e83 0%, #23246a 100%);
	color: #fff;
	padding: 10px 14px;
	border-radius: 0;
}

.mega-dok-bar-title {
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Baslik yaninda kirmizi aksan cizgisi */
.mega-dok-bar-title::before {
	content: "";
	width: 4px;
	height: 15px;
	background: var(--mega-red);
}

.mega-dok-search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 220px;
	max-width: 320px;
	min-height: 34px;
}

.mega-dok-search svg {
	position: absolute;
	display: block !important;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1;
	width: 14px !important;
	height: 14px !important;
	max-width: 14px !important;
	max-height: 14px !important;
	flex: 0 0 14px;
	fill: none !important;
	stroke: var(--mega-muted);
	stroke-width: 2;
	stroke-linecap: round;
	pointer-events: none;
}

.mega-dok-input {
	width: 100%;
	padding: 8px 12px 8px 32px;
	border: 0;
	border-radius: 0;
	font: inherit;
	font-size: 13px;
	color: var(--mega-text);
	background: #fff;
	outline: 2px solid transparent;
	outline-offset: -2px;
}

.mega-dok-input:focus {
	outline-color: var(--mega-red);
}

/* ---------- Kırmızı başlık satırı + filtreler ---------- */

.mega-dok-head {
	display: grid;
	grid-template-columns: 1fr 1.5fr 1.2fr 0.9fr 2.6fr;
	background: var(--mega-red);
	border-bottom: 3px solid #b8050f;
}

.mega-dok-head-cell {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 7px 9px;
	border-right: 1px solid rgba(255, 255, 255, 0.28);
	min-width: 0;
}

.mega-dok-head-cell:last-child {
	border-right: 0;
}

.mega-dok-head-label {
	color: #fff;
	font-weight: 700;
	font-size: 10.5px;
	letter-spacing: 0.06em;
	text-align: center;
}

.mega-dok-select {
	width: 100%;
	max-width: 100%;
	padding: 5px 8px;
	font: inherit;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--mega-text);
	background: #fff;
	border: 1px solid #fff;
	border-radius: 0;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%232d2e83' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 10px;
	padding-right: 24px;
	text-overflow: ellipsis;
}

.mega-dok-select:focus {
	outline: 2px solid var(--mega-navy);
	outline-offset: 1px;
}

.mega-dok-head-docs {
	justify-content: space-between;
}

.mega-dok-reset {
	align-self: center;
	padding: 5px 12px;
	font: inherit;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--mega-red);
	background: #fff;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.mega-dok-reset:hover {
	background: #ffe9ea;
}

/* ---------- Gövde: ürün grubu satırları ---------- */

.mega-dok-body {
	border: 1px solid var(--mega-line);
	border-top: 0;
	background: #fff;
}

.mega-dok-row {
	display: grid;
	grid-template-columns: 1fr 1.5fr 1.2fr 0.9fr 2.6fr;
	border-bottom: 1px solid var(--mega-line);
	transition: background-color 0.15s ease;
}

.mega-dok-row:hover {
	background: var(--mega-hover);
}

.mega-dok-row:last-child {
	border-bottom: 0;
}

.mega-dok-row:nth-child(even) {
	background: var(--mega-zebra);
}

.mega-dok-row[hidden] {
	display: none;
}

.mega-dok-cell {
	padding: 9px 8px;
	border-right: 1px solid var(--mega-line);
	display: flex;
	flex-direction: column;
	gap: 3px;
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	min-width: 0;
	overflow-wrap: anywhere;
}

.mega-dok-cell:last-child {
	border-right: 0;
}

.mega-dok-urun {
	font-weight: 700;
	font-size: 13px;
	color: var(--mega-navy);
	letter-spacing: 0.02em;
	line-height: 1.3;
}

.mega-dok-cell-urun {
	position: relative;
	background: linear-gradient(180deg, #fafbfe 0%, #f3f5fb 100%);
	justify-content: center;
}

.mega-dok-cell-urun::after {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--mega-red);
}

.mega-dok-item {
	display: inline-block;
	padding: 2px 7px;
	background: #eef0f8;
	border-radius: 0;
	font-size: 11px;
	font-weight: 600;
	color: #3a3d60;
	white-space: nowrap;
}

/* ---------- Belge listesi ---------- */

.mega-dok-cell-docs {
	align-items: stretch;
	justify-content: flex-start;
	text-align: left;
	gap: 0;
}

.mega-dok-doc[hidden] {
	display: none;
}

.mega-dok-link {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	padding: 3px 5px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--mega-navy);
	text-decoration: none;
	border-radius: 0;
	line-height: 1.35;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

a.mega-dok-link:hover,
a.mega-dok-link:focus-visible {
	background: rgba(45, 46, 131, 0.08);
	color: var(--mega-red);
	transform: translateX(2px);
}

.mega-dok-link svg {
	flex: 0 0 13px;
	width: 13px !important;
	height: 13px !important;
	max-width: 13px !important;
	max-height: 13px !important;
	margin-top: 2px;
	fill: none !important;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mega-dok-link-off {
	color: var(--mega-muted);
	cursor: default;
}

.mega-dok-note {
	display: block;
	margin: 3px 0 4px;
	padding: 5px 9px;
	background: #fdeaec;
	border-left: 3px solid var(--mega-red);
	border-radius: 0;
	color: #a8040f;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.45;
}

/* ---------- Alt bilgi ---------- */

.mega-dok-empty {
	margin: 18px 0 0;
	padding: 16px;
	text-align: center;
	color: var(--mega-muted);
	background: var(--mega-zebra);
	border: 1px dashed #c9cbe0;
}

.mega-dok-count {
	margin: 10px 0 0;
	font-size: 12px;
	color: var(--mega-muted);
}

/* ---------- Tablet ---------- */

@media (max-width: 900px) {

	.mega-dok-head,
	.mega-dok-row {
		grid-template-columns: 0.9fr 1.3fr 1fr 0.8fr 2fr;
	}

	.mega-dok-head-label {
		font-size: 11px;
	}

	.mega-dok-select {
		font-size: 11px;
	}
}

/* ---------- Mobil: kart görünümü ---------- */

@media (max-width: 720px) {

	.mega-dok-full {
		padding: 0;
	}

	.mega-dok-bar {
		display: block;
		padding: 10px 12px;
	}

	.mega-dok-bar-title {
		margin-bottom: 9px;
		font-size: 12px;
	}

	.mega-dok-search {
		display: flex;
		width: 100%;
		max-width: none;
		min-height: 36px;
	}

	.mega-dok-body {
		border-left: 0;
		border-right: 0;
	}

	.mega-dok-search {
		max-width: none;
	}

	/* Başlık satırı filtre paneline dönüşür */
	.mega-dok-head {
		grid-template-columns: 1fr 1fr;
		gap: 0;
	}

	.mega-dok-head-cell {
		border-right: 1px solid rgba(255, 255, 255, 0.35);
		border-bottom: 1px solid rgba(255, 255, 255, 0.35);
	}

	.mega-dok-head-cell:nth-child(2n) {
		border-right: 0;
	}

	.mega-dok-head-docs {
		grid-column: 1 / -1;
		border-bottom: 0;
	}

	.mega-dok-head-docs .mega-dok-head-label {
		display: none;
	}

	.mega-dok-reset {
		width: 100%;
		padding: 7px;
	}

	/* Satırlar kart olur */
	.mega-dok-row {
		display: block;
		border-bottom: 6px solid #e8eaf4;
	}

	.mega-dok-row:hover {
		background: transparent;
	}

	.mega-dok-cell {
		display: block;
		text-align: left;
		border-right: 0;
		border-bottom: 1px solid var(--mega-line);
		padding: 9px 12px;
	}

	.mega-dok-cell:last-child {
		border-bottom: 0;
	}

	.mega-dok-cell::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 4px;
		font-size: 9.5px;
		font-weight: 700;
		letter-spacing: 0.08em;
		color: var(--mega-red);
	}

	.mega-dok-cell-urun {
		background: linear-gradient(135deg, #2d2e83 0%, #23246a 100%);
	}

	.mega-dok-cell-urun::after {
		width: 4px;
	}

	.mega-dok-cell-urun::before {
		color: rgba(255, 255, 255, 0.7);
	}

	.mega-dok-urun {
		color: #fff;
		font-size: 14px;
	}

	.mega-dok-item {
		margin: 0 5px 5px 0;
	}

	.mega-dok-link {
		padding: 8px 6px;
		font-size: 13px;
	}

	a.mega-dok-link:hover {
		transform: none;
	}

	.mega-dok-cell-docs {
		gap: 3px;
	}
}

/* Cok dar ekranlar (<=340px): filtreler tek sutuna duser */
@media (max-width: 340px) {

	.mega-dok-head {
		grid-template-columns: 1fr;
	}

	.mega-dok-head-cell {
		border-right: 0;
	}

	.mega-dok-bar-title {
		font-size: 12.5px;
	}
}

/* ---------- Yazdırma ---------- */

@media print {

	.mega-dok-search,
	.mega-dok-select,
	.mega-dok-reset {
		display: none;
	}

	.mega-dok-row {
		break-inside: avoid;
	}
}
