/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 28%),
                radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.08), transparent 32%),
                #f8fafc;
    color: #0f172a;
    line-height: 1.6;
}

img,
button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ===== SITE HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
    max-width: 1220px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.brand a {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: white;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.site-nav a {
    color: #cbd5e1;
    padding: 10px 16px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.site-nav a:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: translateY(-1px);
}

.site-nav .admin-button {
    background: #2563eb;
    color: #ffffff;
    border-radius: 16px;
    padding: 10px 18px;
}

.site-nav .admin-button:hover {
    background: #1d4ed8;
}

.site-nav .logout-link {
    background: rgba(239, 68, 68, 0.15);
    color: #f8fafc;
}

/* ===== MAIN LAYOUT ===== */
.page-panel {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 24px 56px;
}

.hero {
    max-width: 900px;
    margin: 80px auto 48px;
    padding: 42px 32px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(241,245,249,0.95));
    border: 1px solid rgba(148,163,184,0.18);
    box-shadow: 0 24px 70px rgba(15,23,42,0.08);
}

.hero h1 {
    font-size: clamp(2.5rem, 3vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    margin-top: 18px;
    color: #475569;
    font-size: 1.05rem;
}

/* ===== CARDS ===== */
.grid-branze {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto 72px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    padding: 0 20px;
}

.branza-card,
.card {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(148,163,184,0.18);
    box-shadow: 0 18px 40px rgba(15,23,42,0.06);
    padding: 28px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
}

.branza-card:hover,
.card:hover {
    transform: translateY(-6px);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 28px 60px rgba(37, 99, 235, 0.12);
}

.branza-card {
    min-height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 190px;
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.card-meta {
    margin-top: 8px;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.card button {
    background: #2563eb;
    color: white;
    padding: 12px 18px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.card button:hover {
    background: #1d4ed8;
}

/* ===== FORM CARDS ===== */
.form-card,
.saved-card,
.kierunek {
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 28px;
    box-shadow: 0 24px 50px rgba(15,23,42,0.08);
    padding: 36px;
}

.form-card {
    max-width: 560px;
    margin: 60px auto;
}

.form-card h1,
.saved-card h1,
.kierunek h1 {
    font-size: 2.15rem;
    margin-bottom: 20px;
    letter-spacing: -0.04em;
}

.form-card form {
    display: grid;
    gap: 18px;
}

.form-card label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.form-card input {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid rgba(148,163,184,0.35);
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-card input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

.form-card button {
    width: 100%;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 18px;
    border-radius: 16px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.button:hover {
    background: #1d4ed8;
}

.button-secondary {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid rgba(148,163,184,0.35);
}

.button-secondary:hover {
    background: #e2e8f0;
}

.button-danger {
    background: #ef4444;
    color: #ffffff;
}

.button-danger:hover {
    background: #dc2626;
}

.admin-block {
    margin-top: 32px;
}

.admin-form .filter-field {
    min-width: 100%;
}

.admin-table-wrap {
    margin-top: 32px;
}

.admin-table {
    width: 100%;
    border-radius: 24px;
    border: 1px solid rgba(148,163,184,0.18);
    overflow: hidden;
    background: rgba(255,255,255,0.95);
}

.admin-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(120px, 120px) minmax(260px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(148,163,184,0.12);
}

.admin-row.admin-header {
    background: rgba(15,23,42,0.05);
    font-weight: 700;
}

.admin-row:last-child {
    border-bottom: none;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-banner {
    max-width: 1120px;
    margin: 0 auto 32px;
    padding: 22px 24px;
    border-radius: 24px;
    background: linear-gradient(90deg, rgba(37,99,235,0.08), rgba(59,130,246,0.06));
    border: 1px solid rgba(37,99,235,0.18);
}

.admin-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.admin-banner h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.admin-banner p {
    color: #334155;
}

@media (max-width: 720px) {
    .admin-banner-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 900px) {
    .admin-row {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .admin-actions {
        justify-content: flex-start;
    }
}

.form-error {
    color: #dc2626;
    background: rgba(254, 226, 226, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.18);
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 600;
}

/* ===== SAVED ITEMS ===== */
.saved-card h1 {
    margin-bottom: 28px;
}

.saved-item {
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid rgba(148,163,184,0.18);
}

.saved-item:last-child {
    border-bottom: none;
}

.saved-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.saved-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button-secondary,
.button-danger {
    min-width: 108px;
}

/* ===== DIRECTION DETAILS ===== */
.kierunek p {
    font-size: 1rem;
}

.status-message {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #065f46;
    font-weight: 600;
}

.info-text {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #831843;
    font-weight: 600;
}

.action-form {
    margin-top: 24px;
}

.filter-panel {
    margin-bottom: 28px;
    padding: 22px 24px;
    border-radius: 24px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(148,163,184,0.18);
    box-shadow: 0 18px 38px rgba(15,23,42,0.06);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    flex: 1;
}

.filter-field label {
    font-weight: 700;
    color: #334155;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.35);
    background: #f8fafc;
    color: #0f172a;
}

.filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title {
    margin-bottom: 24px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.kierunek .kwalifikacja {
    padding: 22px 24px;
    margin-top: 24px;
}

.kierunek .kwalifikacja h3 {
    font-size: 1.05rem;
}

.kierunek ul {
    margin-top: 12px;
}

/* ===== FOOTER ===== */
.stopka {
    margin-top: 40px;
    padding: 28px 22px;
    text-align: center;
    color: #64748b;
    font-size: 0.98rem;
}

.stopka h1 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-panel,
    .hero,
    .form-card,
    .saved-card,
    .kierunek {
        padding: 28px 18px;
    }
}

@media (max-width: 720px) {
    .site-nav {
        width: 100%;
    }

    .hero {
        margin-top: 56px;
    }

    .saved-item,
    .card {
        padding: 20px;
    }

    .saved-item {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }
}

@media (max-width: 520px) {
    .hero,
    .form-card,
    .saved-card,
    .kierunek {
        border-radius: 22px;
        padding: 22px;
    }

    .form-card h1,
    .saved-card h1,
    .kierunek h1 {
        font-size: 2rem;
    }
}

.nav-links a:hover {
    color: #ffffff;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    margin-top: 60px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 38px;
    font-weight: 700;
}

.hero p {
    margin-top: 8px;
    color: #6b7280;
    font-size: 16px;
}

/* ===== GRID BRANŻ (CENTROWANIE) ===== */
.grid-branze {
    width: 100%;
    max-width: 1100px;

    margin: 0 auto 80px auto;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;

    padding: 0 20px;

    justify-content: center;
    align-items: center;
}

/* ===== KAFEL BRANŻY ===== */
.branza-card {
    background: white;

    border-radius: 20px;
    border: 1px solid #e5e7eb;

    min-height: 120px;

    display: flex;
    justify-content: center;
    align-items: center;

    text-align: center;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    box-shadow: 0 6px 18px rgba(0,0,0,0.06);

    transition: all 0.25s ease;
}

/* ===== HOVER (MOCNY EFEKT) ===== */
.branza-card:hover {
    transform: translateY(-10px) scale(1.03);

    background: linear-gradient(135deg, #eef2ff, #ffffff);

    border-color: #2563eb;

    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.25);
}

/* ===== LISTA (strona lista.php) ===== */
.container {
    width: 100%;
    max-width: 1100px;

    margin: 0 auto;
    padding: 20px;
}

/* SEARCH CENTER */
.search-center {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.search-center input {
    width: 60%;
    max-width: 600px;

    padding: 16px;
    font-size: 16px;

    border-radius: 14px;
    border: 1px solid #d1d5db;

    text-align: center;
}

/* GRID ZAWODÓW */
.grid {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

/* KARTA ZAWODU */
.card {
    background: white;

    border-radius: 16px;
    border: 1px solid #e5e7eb;

    padding: 18px;

    cursor: pointer;

    transition: 0.2s;

    box-shadow: 0 4px 10px rgba(0,0,0,0.04);

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.10);
}

/* BUTTON */
.card button {
    background: #2563eb;
    color: white;

    border: none;
    border-radius: 10px;

    padding: 8px 12px;

    cursor: pointer;
    font-size: 13px;

    align-self: flex-start;

    transition: 0.2s;
}

.card button:hover {
    background: #1d4ed8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 28px;
    }

    .search-center input {
        width: 90%;
    }

    .grid-branze {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}