/* =====================================================================
   modern.css — moderns izskats visām lapām, kas izmanto begin.php.
   Tikai vizuāli pārrakstījumi virs boo.css; loģika netiek mainīta.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
	--bg: #f3f5f9;
	--card: #ffffff;
	--border: #e6e9f0;
	--border-soft: #f0f2f6;
	--text: #1a2238;
	--muted: #6b7489;
	--faint: #9aa2b4;
	--accent: #3b5bdb;
	--accent-dark: #2f4ac0;
	--accent-soft: #edf1ff;
	--hover-row: #f5f7ff;
	--warn-row: #fff1f0;
	--green: #12a150;
	--red: #e03131;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
}

html { background: var(--bg); }
body {
	background: var(--bg);
	color: var(--text);
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	line-height: 1.5;
}
td { font-family: inherit; color: var(--text); font-size: 15px; }
a, a:visited, a:hover { color: var(--accent); }
p { line-height: 1.65; }

/* ---------- Galvenais konteiners ---------- */
table.vidus {
	width: 100% !important;
	max-width: 1120px;
	margin: 64px auto 24px;
	padding: 0 16px;
	box-sizing: border-box;
}

/* ---------- Augšējā josla: ielogošanās + meklēšana (tikai ja ir formas) ---------- */
table.vidusvidus > tbody > tr:first-child > td > table:first-child:has(form) {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	margin-bottom: 16px;
}
table.vidusvidus > tbody > tr:first-child > td > table:first-child td {
	color: var(--muted);
	font-size: 14px;
	padding: 4px 8px;
}
table.vidusvidus > tbody > tr:first-child > td > table:first-child form { margin: 12px !important; }

/* ---------- Formu elementi ---------- */
input.ailes,
input[type=text], input[type=password], input[type=email], input:not([type]),
select, textarea {
	font-family: inherit;
	font-size: 14px !important;
	color: var(--text) !important;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 8px 12px;
	margin: 2px 4px;
	outline: none;
	box-sizing: border-box;
	transition: border-color .15s, box-shadow .15s;
}
select { padding: 7px 10px; cursor: pointer; }
textarea { max-width: 100%; line-height: 1.5; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px !important; }
input.ailes:focus, input[type=text]:focus, input[type=password]:focus, input:not([type]):focus,
select:focus, textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(59, 91, 219, .15);
}
input[type=file] { font-family: inherit; font-size: 14px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

INPUT.submit, input[type=submit], input[type=button] {
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: var(--accent);
	border: 0;
	border-radius: 8px;
	padding: 9px 16px;
	margin: 2px 4px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .1);
	cursor: pointer;
	transition: background .15s, transform .05s;
}
INPUT.submit:hover, input[type=submit]:hover, input[type=button]:hover { background: var(--accent-dark); }
INPUT.submit:active, input[type=submit]:active, input[type=button]:active { transform: translateY(1px); }

a[href="aizmirsu.php"] { color: var(--faint) !important; font-size: 12px !important; }
a[href="aizmirsu.php"]:hover { color: var(--accent) !important; }

/* ---------- Navigācija ---------- */
table.central {
	width: auto !important;
	margin: 0 auto 16px;
	padding: 6px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 999px;
	box-shadow: var(--shadow);
	border-collapse: separate;
	border-spacing: 4px 0;
}
table.central td[width] { display: none; }   /* tukšās atstarpju šūnas */
table.central td.fade { display: none; }

table.central td.navhilite2,
table.central td.nav2,
table.central td.navhilite22 {
	font-size: 14px;
	font-weight: 500;
	padding: 8px 18px;
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background .15s, color .15s;
}
table.central td.navhilite2 { background: transparent; color: var(--muted); }
table.central td.nav2       { background: var(--accent-soft); color: var(--accent); }
table.central td.navhilite22 { background: transparent; color: var(--red); }
table.central td.navhilite22:hover { background: var(--warn-row); }

/* ---------- Satura kartītes ---------- */
table.vidusvidus > tbody > tr:nth-child(2) > td,
td.vidus2, table.vidus2 {
	background: var(--card) !important;
	border: 1px solid var(--border);
	border-radius: var(--radius) !important;
	box-shadow: var(--shadow);
	padding: 16px !important;
}
table.vidus2 { margin: 0 auto; }
table:has(> tbody > tr > td.vidus2) { border-collapse: separate; border-spacing: 0 16px; }

/* virsraksti satura sadaļās */
font.subnos, .subnos {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--accent);
	background: var(--accent-soft);
	padding: 5px 12px;
	border-radius: 999px;
	margin-bottom: 8px;
}
.srakans { color: var(--accent); }
.vraksts { color: var(--text); font-weight: 600; }
.vairak { color: var(--green); font-weight: 600; }
.mazak  { color: var(--red); font-weight: 600; }

/* pārslēgšanas pogas (rādīt/slēpt) */
a.show, a.show:visited {
	display: inline-block;
	padding: 5px 12px;
	margin: 2px;
	font-size: 13px;
	font-weight: 500;
	color: var(--muted);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 999px;
	transition: all .15s;
}
a.show:hover { color: var(--accent); background: var(--accent-soft); border-color: #cdd7fb; }

a.cipari, a.cipari:visited {
	display: inline-block;
	min-width: 18px;
	padding: 6px 10px;
	margin: 2px;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: 8px;
	text-align: center;
}
a.cipari:hover { color: var(--accent); background: var(--accent-soft); }

/* informācijas bloks (stats.php) */
div.info {
	position: static !important;
	opacity: 1 !important;
	width: auto !important;
	max-width: 520px;
	margin: 12px 0;
	padding: 14px 16px !important;
	color: var(--muted) !important;
	background: #f8f9fc !important;
	border: 1px solid var(--border) !important;
	border-radius: 12px !important;
	font-size: 13px !important;
	line-height: 1.6;
}
div.info font[color=black], div.info strong { color: var(--text); }
/* rindas ar peldošiem (float) elementiem — lai fons aptver visu saturu */
div.info { display: flow-root; }
div.info > div {
	display: flex !important;
	gap: 12px;
	height: auto !important;
	margin: 6px 0;
}
div.info > div > div { float: none !important; }
div.info > div > div:first-child { flex: 0 0 39%; }
div.info > div > div:last-child  { flex: 1 1 auto; }

/* joslu diagrammas */
div.bar {
	background: linear-gradient(90deg, var(--accent), #6a85ff) !important;
	border-radius: 999px !important;
	box-shadow: none;
	height: 20px;
	line-height: 20px;
	font-size: 0;
	min-width: 3px;
}
/* rezerve bez JS: josla nekad neiziet ārpus šūnas (modern.js pārrēķina proporcionāli) */
div.bar, div[style*="background-color: #acacac"], div.mbar-any { max-width: 100%; box-sizing: border-box; }
div[style*="background-color: #acacac"], div.mbar-gray {
	background: #c9cfdd !important;
	border-radius: 999px !important;
	height: 20px;
	line-height: 20px;
	font-size: 0;
}

.referer, .referer:visited { color: var(--faint); font-size: 13px; }
.referer:hover { color: var(--accent); }

/* komentāri (zoom-disc.php) */
td.komments {
	background: #f8f9fc !important;
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 10px 14px;
	font-size: 14px;
	color: var(--text);
}
font.niki { color: var(--accent); font-weight: 600; }

/* pelēkie bloki ar inline fonu (register.php u.c.) */
td[style*="background-color: #eaeaea"] {
	background: #f8f9fc !important;
	border: 1px solid var(--border);
	border-radius: 12px;
}

/* ---------- Datu tabulas ---------- */
table.sortable {
	border-collapse: separate;
	border-spacing: 0;
	padding: 0;
	background: transparent;
}
#trua3 { width: 100% !important; }
table.sortable > tbody > tr > td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--border-soft);
	font-size: 14px;
	vertical-align: middle;
}
/* iekšējās tabulas šūnās bez papildu atstarpēm */
table.sortable td table td { padding: 1px 0; border: 0; }

/* galvene (pirmā rinda) */
table.sortable > tbody > tr:first-child > td {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--card);
	color: var(--faint);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding-top: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border);
}
table.sortable > tbody > tr:first-child > td b { font-weight: 600; }
/* tukšā noslēguma rinda */
table.sortable tr.darkened:last-child:not(:first-child) td { border: 0; padding: 4px; }

/* rindas */
table.sortable tr.top, table.sortable tr.gaishaks { background: var(--card); }
table.sortable tr.gaishaks { background: #fbfcfe; }
table.sortable tr.tophilite { background: var(--hover-row); border: 0; }
table.sortable tr.uzmanibu { background: var(--warn-row); }
table.sortable tr { transition: background .12s; }

/* skaitļi */
table.sortable td[align=center], table.sortable td[align=right] {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* ---------- Galvenās lapas saraksts (index.php / counter.php) ---------- */
#trua3 td[align=center] { color: var(--muted); }
#trua3 td[align=center] font[color=black] { color: var(--text); font-weight: 600; }

#trua3 tr:not(.darkened) td:first-child {
	width: 1%;
	color: var(--faint);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}
#trua3 tr:nth-child(2) td:first-child,
#trua3 tr:nth-child(3) td:first-child,
#trua3 tr:nth-child(4) td:first-child { color: var(--accent); font-weight: 700; }

#trua3 td:nth-child(2) { width: 1%; padding-right: 0; }
#trua3 td img {
	float: none;
	display: block;
	width: 18px;
	height: 18px;
	border-radius: 4px;
	object-fit: cover;
}

/* lapas nosaukums (melns = maksāts, pelēks = nemaksāts) */
#trua3 a[target="_blank"] { font-weight: 500; }
#trua3 a[target="_blank"][style*="black"] { color: var(--text) !important; }
#trua3 a[target="_blank"][style*="gray"]  { color: var(--muted) !important; }
#trua3 a[target="_blank"]:hover { color: var(--accent) !important; }

/* sadaļa kā "chip" */
#trua3 a[href^="?sad="] {
	display: inline-block;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: middle;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 500;
	color: var(--muted) !important;
	background: #f1f3f8;
	border-radius: 999px;
}
#trua3 a[href^="?sad="]:hover { background: var(--accent-soft); color: var(--accent) !important; }

/* detalizētās statistikas lupa */
#trua3 a[href^="stats.php"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	color: var(--faint);
	transition: background .15s, color .15s;
}
#trua3 a[href^="stats.php"]:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- Sīkdatņu josla un valodas pārslēgs ---------- */
div[style*="positon: absolute"] {
	box-sizing: border-box;
	background: var(--text) !important;
	color: #fff !important;
	font-size: 14px;
	padding: 10px 16px !important;
}
div[style*="positon: absolute"] a { color: #c7d2fe; margin: 0 8px; }

div[style*="width: 10%"] {
	width: auto !important;
	top: 14px !important;
	left: 16px !important;
	padding: 6px 12px !important;
	font-size: 13px;
	font-weight: 600;
	color: var(--faint) !important;
	background: var(--card) !important;
	border: 1px solid var(--border);
	border-radius: 999px;
	box-shadow: var(--shadow);
}
div[style*="width: 10%"] a { color: var(--muted); padding: 0 4px; }
div[style*="width: 10%"] a:hover { color: var(--accent); }

/* ---------- Kājene ---------- */
a[href="http://www.tupunturies.lv"] { color: var(--faint); font-size: 13px; }
a[href="http://www.tupunturies.lv"]:hover { color: var(--accent); }

/* ---------- Mobilais ---------- */
@media (max-width: 760px) {
	table.vidus { margin-top: 56px; padding: 0 8px; }
	table.vidusvidus > tbody > tr:first-child > td > table:first-child td {
		display: block;
		text-align: center;
	}
	table.central {
		display: block;
		overflow-x: auto;
		border-radius: 12px;
		-webkit-overflow-scrolling: touch;
	}
	table.sortable { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	table.sortable > tbody > tr > td { padding: 9px 8px; font-size: 13px; }
	#trua3 a[href^="?sad="] { max-width: 120px; }
	textarea { width: 100%; }
}

/* joslu šūnas — josla vertikāli centrā pret skaitli */
td:has(> div.bar), td:has(> div.mbar-any), td:has(> div[style*="background-color: #acacac"]) {
	vertical-align: middle !important;
	padding-top: 4px;
	padding-bottom: 4px;
}
