/**
 * KSeF — globalny, spójny wygląd panelu admina.
 * Ładowany na wszystkich stronach wtyczki (page=ksef-*).
 * Restyluje natywne elementy WP (wrap, button, form-table, wp-list-table,
 * nav-tab) tak, aby pasowały do nowoczesnego edytora faktur.
 */

:root {
	--ksef-primary: #d9531e;
	--ksef-primary-dark: #b8451a;
	--ksef-primary-light: #fff2eb;
	--ksef-accent: #2563eb;
	--ksef-bg: #f5f6f9;
	--ksef-card: #ffffff;
	--ksef-border: #e7eaee;
	--ksef-border-strong: #d3d7dd;
	--ksef-text: #1a1d21;
	--ksef-text-2: #5a6473;
	--ksef-text-3: #97a0ad;
	--ksef-radius: 10px;
	--ksef-radius-sm: 6px;
	--ksef-shadow-sm: 0 1px 2px rgba(16,24,40,0.04);
	--ksef-shadow: 0 1px 3px rgba(16,24,40,0.08), 0 1px 2px rgba(16,24,40,0.04);
}

/* === Tło i typografia === */
body[class*="page_ksef-"] #wpcontent,
body[class*="page_ksef-"] #wpbody-content {
	background: var(--ksef-bg);
}
body[class*="page_ksef-"] .wrap,
body[class*="page_ksef-"] .ksef-app,
body[class*="page_ksef-"] .ksef-detail {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--ksef-text);
}
body[class*="page_ksef-"] .wrap > h1 {
	font-size: 23px;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 8px 0 18px;
	color: var(--ksef-text);
}

/* === Karty: form-table opakowane jak panele === */
body[class*="page_ksef-"] .wrap form .form-table {
	background: var(--ksef-card);
	border: 1px solid var(--ksef-border);
	border-radius: var(--ksef-radius);
	box-shadow: var(--ksef-shadow-sm);
	padding: 8px 22px;
	margin-top: 12px;
}
body[class*="page_ksef-"] .form-table th {
	font-size: 13px;
	font-weight: 600;
	color: var(--ksef-text-2);
	padding: 16px 10px 16px 0;
}
body[class*="page_ksef-"] .form-table td {
	padding: 14px 10px;
}
body[class*="page_ksef-"] .wrap h2:not(.nav-tab-wrapper) {
	font-size: 15px;
	font-weight: 600;
	margin-top: 26px;
	color: var(--ksef-text);
}

/* === Inputy === */
body[class*="page_ksef-"] .wrap input[type=text],
body[class*="page_ksef-"] .wrap input[type=email],
body[class*="page_ksef-"] .wrap input[type=url],
body[class*="page_ksef-"] .wrap input[type=number],
body[class*="page_ksef-"] .wrap input[type=password],
body[class*="page_ksef-"] .wrap input[type=date],
body[class*="page_ksef-"] .wrap input[type=search],
body[class*="page_ksef-"] .wrap select,
body[class*="page_ksef-"] .wrap textarea {
	border: 1px solid var(--ksef-border-strong);
	border-radius: var(--ksef-radius-sm);
	padding: 7px 11px;
	font-size: 13px;
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
body[class*="page_ksef-"] .wrap input:focus,
body[class*="page_ksef-"] .wrap select:focus,
body[class*="page_ksef-"] .wrap textarea:focus {
	border-color: var(--ksef-primary);
	box-shadow: 0 0 0 3px rgba(217,83,30,0.12);
	outline: none;
}

/* === Przyciski === */
body[class*="page_ksef-"] .wrap .button,
body[class*="page_ksef-"] .wrap .button-secondary {
	border-radius: var(--ksef-radius-sm);
	border: 1px solid var(--ksef-border-strong);
	background: #fff;
	color: var(--ksef-text);
	font-size: 13px;
	font-weight: 500;
	padding: 4px 14px;
	height: auto;
	min-height: 34px;
	transition: all 0.15s;
}
body[class*="page_ksef-"] .wrap .button:hover {
	background: #f9fafb;
	border-color: #b9bec6;
}
body[class*="page_ksef-"] .wrap .button-primary {
	background: var(--ksef-primary) !important;
	border-color: var(--ksef-primary) !important;
	color: #fff !important;
	box-shadow: 0 1px 2px rgba(217,83,30,0.2);
	text-shadow: none;
}
body[class*="page_ksef-"] .wrap .button-primary:hover {
	background: var(--ksef-primary-dark) !important;
	border-color: var(--ksef-primary-dark) !important;
}
body[class*="page_ksef-"] .wrap .button-large {
	min-height: 40px;
	padding: 6px 20px;
	font-size: 13.5px;
}

/* === Zakładki (nav-tab) === */
body[class*="page_ksef-"] .nav-tab-wrapper {
	border-bottom: 1px solid var(--ksef-border);
	margin-bottom: 20px;
	gap: 2px;
	display: flex;
}
body[class*="page_ksef-"] .nav-tab {
	border: none;
	background: transparent;
	color: var(--ksef-text-2);
	font-size: 13px;
	font-weight: 500;
	padding: 10px 18px;
	margin: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
}
body[class*="page_ksef-"] .nav-tab:hover {
	background: var(--ksef-primary-light);
	color: var(--ksef-primary);
}
body[class*="page_ksef-"] .nav-tab-active,
body[class*="page_ksef-"] .nav-tab-active:focus {
	background: transparent;
	color: var(--ksef-primary);
	border-bottom-color: var(--ksef-primary);
	font-weight: 600;
}

/* === Tabele list (wp-list-table) === */
body[class*="page_ksef-"] .wp-list-table {
	border: 1px solid var(--ksef-border);
	border-radius: var(--ksef-radius);
	overflow: hidden;
	box-shadow: var(--ksef-shadow-sm);
	border-collapse: separate;
	border-spacing: 0;
}
body[class*="page_ksef-"] .wp-list-table thead th {
	background: var(--ksef-primary-light);
	color: var(--ksef-primary);
	font-weight: 600;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 12px 14px;
	border: none;
}
body[class*="page_ksef-"] .wp-list-table tbody td {
	padding: 12px 14px;
	font-size: 13px;
	border-top: 1px solid var(--ksef-border);
}
body[class*="page_ksef-"] .wp-list-table tbody tr:hover {
	background: #fafbfc;
}

/* === Notices === */
body[class*="page_ksef-"] .notice,
body[class*="page_ksef-"] .updated,
body[class*="page_ksef-"] .error {
	border-radius: var(--ksef-radius-sm);
	border-left-width: 4px;
	box-shadow: var(--ksef-shadow-sm);
}

/* === Linki === */
body[class*="page_ksef-"] .wrap a:not(.button):not(.nav-tab) {
	color: var(--ksef-accent);
}

/* === Spinner / drobiazgi === */
body[class*="page_ksef-"] .description {
	font-size: 12.5px;
	color: var(--ksef-text-3);
}
body[class*="page_ksef-"] code {
	background: #f3f4f6;
	border-radius: 3px;
	padding: 1px 6px;
	font-size: 12px;
}

/* === Submit button row === */
body[class*="page_ksef-"] .wrap p.submit {
	margin-top: 18px;
	padding-top: 0;
}
