:root {
	--black: #000;
	--white: #fff;
	--gray: #9a9a9a;
	--panel: #0c0c0c;
	--border: #1e1e1e;
}

* {
	box-sizing: border-box;
	font-family: 'Inter', system-ui, sans-serif;
}

body {
	margin: 0;
	background: var(--black);
	color: var(--white);
	min-height: 100svh;
}

/* ===== LAYOUT ===== */

.page {
	min-height: 100svh;
	display: flex;
	flex-direction: column;
}

.main {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 1rem;
}

/* ===== CARD ===== */

.card {
	width: 100%;
	max-width: 420px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 2rem;
}

/* ===== BRAND ===== */

.card-brand {
	text-align: center;
	margin-bottom: 1.5rem;
}

.card-brand h1 {
	margin: 0;
	font-size: 1.8rem;
	letter-spacing: 3px;
}

.card-brand span {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.8rem;
	color: var(--gray);
}

/* ===== FORM ===== */

form label {
	display: block;
	margin-bottom: 1rem;
}

form span {
	display: block;
	font-size: 0.75rem;
	color: var(--gray);
	margin-bottom: 0.3rem;
}

form input {
	width: 100%;
	padding: 0.75rem;
	background: #000;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--white);
}

form input:focus {
	outline: none;
	border-color: var(--white);
}

/* ===== BUTTON ===== */

.btn {
	width: 100%;
	margin-top: 0.8rem;
	padding: 0.8rem;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
}

.btn.primary {
	background: var(--white);
	color: var(--black);
	border: none;
}

.btn.primary:hover {
	transform: translateY(-1px);
}

/* ===== LINKS ===== */

.alt-link {
	display: block;
	margin-top: 1rem;
	text-align: center;
	font-size: 0.85rem;
	color: var(--gray);
	text-decoration: none;
}

.alt-link:hover {
	color: var(--white);
}
/* ===== ALERTS ===== */
.alert {
	margin: 0 0 1rem;
	padding: 0.9rem 1rem;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.04);
	color: #eaeaea;
	font-size: 0.9rem;
	line-height: 1.4;
}

.alert.error {
	border-color: rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.06);
}
/* ===== HEADER ===== */

.app-header {
	border-bottom: 1px solid var(--border);
	background: #000;
}

.header-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1rem 1.5rem;

	display: flex;
	align-items: center;
	justify-content: space-between;
}

.logo a {
	color: var(--white);
	text-decoration: none;
	font-weight: 700;
	letter-spacing: 3px;
}

/* DESKTOP NAV */

.nav-desktop {
	display: none;
	gap: 1.5rem;
}

.nav-desktop a {
	color: var(--gray);
	text-decoration: none;
	font-size: 0.9rem;
}

.nav-desktop a:hover {
	color: var(--white);
}

/* HAMBURGER */

.hamburger {
	width: 28px;
	height: 20px;
	background: none;
	border: none;
	cursor: pointer;

	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.hamburger span {
	height: 2px;
	background: var(--white);
	border-radius: 2px;
	transition: all 0.3s ease;
}

/* HAMBURGER ACTIVE (X) */

.hamburger.active span:nth-child(1) {
	transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
	opacity: 0;
}

.hamburger.active span:nth-child(3) {
	transform: translateY(-9px) rotate(-45deg);
}

/* MOBILE MENU */

.nav-mobile {
	display: none;
	flex-direction: column;
	background: #000;
	border-top: 1px solid var(--border);
}

.nav-mobile a {
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--border);
	color: var(--white);
	text-decoration: none;
}

.nav-mobile a:hover {
	background: rgba(255, 255, 255, 0.05);
}

.nav-mobile.open {
	display: flex;
}

/* FOOTER */

.app-footer {
	text-align: center;
	padding: 1rem;
	font-size: 0.75rem;
	color: var(--gray);
	border-top: 1px solid var(--border);
}

/* DESKTOP */

@media (min-width: 900px) {
	.hamburger {
		display: none;
	}

	.nav-desktop {
		display: flex;
	}

	.nav-mobile {
		display: none !important;
	}
}
/* ===== HOME / DASHBOARD ===== */

.dashboard {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1.5rem;
}

.dash-intro {
	margin-bottom: 2rem;
}

.dash-intro h1 {
	margin: 0 0 0.5rem;
	letter-spacing: 3px;
}

.dash-intro p {
	color: var(--gray);
	max-width: 600px;
}

/* GRID */

.dash-grid {
	display: grid;
	gap: 1.5rem;
}

/* PANELS */

.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 1.5rem;
}

.panel h2 {
	margin-top: 0;
}

.panel .muted {
	color: var(--gray);
	font-size: 0.9rem;
}

/* LIST */

.list {
	list-style: none;
	padding: 0;
	margin: 1rem 0 0;
}

.list li {
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--border);
	font-size: 0.9rem;
}

/* BUTTON */

.btn.full {
	width: auto; /* nie na całą szerokość */
	display: inline-block;
	text-align: center;

	margin-top: 1.5rem; /* więcej oddechu od treści */
	align-self: center; /* WYŚRODKOWANIE */
	padding-left: 2rem;
	padding-right: 2rem;
}

/* WIDE PANEL */

.panel.wide {
	grid-column: 1 / -1;
}

/* DESKTOP */

@media (min-width: 900px) {
	.dash-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
/* ===== LIST LINKS ===== */

.list.links li a {
	display: block;
	padding: 0.6rem 0;
	color: var(--white);
	text-decoration: none;
	font-size: 0.9rem;
}

.list.links li a:hover {
	text-decoration: underline;
}
a,
a:visited {
	color: var(--white);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}
/* ===== COMPANY VIEW ===== */

.company-header {
	margin-bottom: 2rem;
}

.company-grid {
	display: grid;
	gap: 1.5rem;
}

.card-block {
	background: #0d0d0d;
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 1.5rem;
}

.card-block h3 {
	margin-top: 0;
}

/* key-value */
.kv {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.6rem 1rem;
	font-size: 0.9rem;
}

/* roles */
.role {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: 0.8rem;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--border);
}

.role:last-child {
	border-bottom: none;
}

/* buttons */
.btn.small {
	padding: 0.4rem 0.9rem;
	font-size: 0.75rem;
}

/* platoons */
.platoons {
	margin-top: 3rem;
}

.platoon-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.platoon-card {
	background: #0d0d0d;
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 1.5rem;
}

.platoon-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* squads */
.squads {
	margin-top: 1rem;
	padding-left: 1rem;
	border-left: 2px solid var(--border);
}

.squad {
	margin-bottom: 1rem;
}

.squad-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* desktop */
@media (min-width: 900px) {
	.company-grid {
		grid-template-columns: 1fr 1fr;
	}
}
/* company layout wide */
.dashboard {
	max-width: 1400px;
}
.company-layout {
	display: grid;
	gap: 1.5rem;
}
@media (min-width: 1000px) {
	.company-layout {
		grid-template-columns: 1fr 1fr;
	}
}

.form-compact label span {
	display: block;
	font-size: 0.75rem;
	color: var(--gray);
	margin-bottom: 0.35rem;
}
.grid-2 {
	display: grid;
	gap: 1rem;
}
@media (min-width: 700px) {
	.grid-2 {
		grid-template-columns: 1fr 1fr;
	}
}

.modal::backdrop {
	background: rgba(0, 0, 0, 0.65);
}
.modal {
	border: none;
	padding: 0;
	background: transparent;
}
.modal-box {
	width: min(520px, calc(100vw - 2rem));
	margin: auto;
	background: #0d0d0d;
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 1.25rem;
	color: var(--white);
}
.select {
	width: 100%;
	background: #000;
	border: 1px solid var(--border);
	color: var(--white);
	border-radius: 10px;
	padding: 0.75rem;
	margin-top: 0.75rem;
}
.modal-actions {
	display: flex;
	gap: 0.75rem;
	justify-content: flex-end;
	flex-wrap: wrap;
	margin-top: 1rem;
}
.nav-mobile {
	display: none;
}

.nav-mobile.open {
	display: flex;
	flex-direction: column;
}
/* =========================================================
   LAYOUT – ODSTĘPY I RYTM STRONY
   ========================================================= */

.dashboard {
	display: flex;
	flex-direction: column;
	gap: 3.5rem;
}

.dash-intro {
	margin-bottom: 1rem;
}

.dash-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 2.5rem;
}

/* =========================================================
   PANELE – BAZA
   ========================================================= */

.panel {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	padding: 2rem;
	transition:
		background 0.25s ease,
		border-color 0.25s ease,
		box-shadow 0.25s ease,
		transform 0.25s ease;
}

/* SZERSZY PANEL (opis) */
.panel.wide {
	grid-column: 1 / -1;
}

/* =========================================================
   STATUSY (STAT BOXES)
   ========================================================= */

.panel.stat {
	text-align: left;
}

.panel.stat h2 {
	font-size: 1.6rem;
	margin-bottom: 0.25rem;
}

.panel.stat p {
	opacity: 0.65;
	font-size: 0.9rem;
}

/* =========================================================
   MODUŁY – EFEKTY ZIELONE (SUBTELNE)
   ========================================================= */

.panel.action {
	cursor: pointer;
	text-decoration: none;
	color: inherit;
}

.panel.action:hover {
	background: rgba(60, 255, 122, 0.06);
	border-color: rgba(60, 255, 122, 0.45);
	box-shadow: 0 0 0 1px rgba(60, 255, 122, 0.25);
	transform: translateY(-3px);
}

/* NIEAKTYWNE */
.panel.disabled {
	opacity: 0.45;
	pointer-events: none;
}

/* =========================================================
   TAG MODUŁU
   ========================================================= */

.module-tag {
	display: inline-block;
	margin-bottom: 0.75rem;
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	color: #7dffb3;
	opacity: 0.85;
}

/* =========================================================
   RESPONSYWNOŚĆ
   ========================================================= */

@media (max-width: 640px) {
	.panel {
		padding: 1.5rem;
	}

	.dashboard {
		gap: 2.5rem;
	}
}
/* =====================================================
   Create company – poprawa centrowania i proporcji
   ===================================================== */

/* zawężamy dashboard tylko dla formularzy */
body:has(.dash-intro) .dashboard {
	max-width: 520px;
	margin: 0 auto;
}

/* usuwamy wrażenie „pustej planszy” */
body:has(.dash-intro) .dash-grid {
	display: block;
}

/* karta formularza dokładnie na środku */
body:has(.dash-intro) .dash-grid > * {
	margin: 0 auto;
}
/* =====================================================
   DOWÓDZTWO KOMPANII – PRESTIŻ
   ===================================================== */

.company-command {
	margin: 32px auto 40px;
	max-width: 680px;
	padding: 24px 28px;
	border-radius: 18px;
	background:
		linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
	border: 1px solid rgba(255,255,255,0.12);
	text-align: center;
}

/* tytuł sekcji */
.company-command h2 {
	margin: 0 0 18px;
	font-size: 20px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #ffd98a;
	font-weight: 700;
}

/* dowódca – NAJWAŻNIEJSZY */
.company-command .commander {
	font-size: 22px;
	font-weight: 700;
	color: #ffffff;
	margin-bottom: 6px;
}

/* stopień */
.company-command .rank {
	display: block;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9fb6ff;
	margin-bottom: 10px;
}

/* zastępca */
.company-command .deputy {
	font-size: 14px;
	opacity: 0.7;
}
/* =====================================================
   PLUTONY – SEKCJE STRUKTURY (KROK 2)
   ===================================================== */

/* kontener plutonów */
.platoons-accordion {
	max-width: 820px;
	margin: 0 auto 40px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* pluton jako sekcja */
.platoon-card {
	background: none;
	border: none;
	box-shadow: none;
	border-radius: 0;
	padding: 0;
}

/* nagłówek plutonu */
.platoon-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* strzałka */
.platoon-arrow {
	font-size: 13px;
	opacity: 0.6;
	transition: transform 0.25s ease;
}

.platoon-card.is-open .platoon-arrow {
	transform: rotate(90deg);
	opacity: 1;
}

/* ciało plutonu */
.platoon-body {
	margin-top: 10px;
	padding-left: 12px;
	border-left: 2px solid rgba(255,255,255,0.08);
}
/* ===== WYRÓŻNIENIE PRZYCISKU WRÓĆ (BEZ ZMIAN HTML) ===== */

a.btn.ghost:last-of-type {
    background: #020617;
    border: 1px solid #475569;
    color: #e5e7eb;
}

a.btn.ghost:last-of-type:hover {
    border-color: #60a5fa;
    color: #ffffff;
}
/* ===== WYRAŹNY PRZYCISK WRÓĆ ===== */

/* celujemy w ostatni przycisk akcji */
.company-actions a.btn.ghost,
.structure-actions a.btn.ghost,
a.btn.ghost[href*="company"],
a.btn.ghost:last-of-type {
    background: linear-gradient(180deg, #111827, #020617);
    border: 1px solid #64748b;
    color: #f8fafc;
    box-shadow:
        0 6px 20px rgba(0,0,0,.6),
        inset 0 0 0 1px rgba(255,255,255,.05);
}

/* HOVER – MUSI BYĆ WIDOCZNY */
.company-actions a.btn.ghost:hover,
.structure-actions a.btn.ghost:hover,
a.btn.ghost[href*="company"]:hover,
a.btn.ghost:last-of-type:hover {
    background: linear-gradient(180deg, #1e293b, #020617);
    border-color: #ef4444;          /* czerwony akcent */
    color: #ffffff;
    box-shadow:
        0 10px 30px rgba(239,68,68,.25);
}
/* =====================================================
   GLOBAL: BRAK PODKREŚLEŃ LINKÓW (CAŁY SYSTEM)
   ===================================================== */

a,
a:visited,
a:hover,
a:active,
a:focus {
	text-decoration: none !important;
}
