/* ============================================
   CORE v2.0 – Modernized 1.x Style
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top, #141a2a 0, #050814 45%, #02030a 100%);
    color: #e8ecff;
}

/* --------------------------------------------
   HEADER
-------------------------------------------- */

.core-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 26px;
    background: linear-gradient(90deg, #060917, #090d1e);
    border-bottom: 1px solid rgba(90, 150, 255, 0.35);
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.8);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}

.core-logo {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #ffffff;
}

.core-logo span {
    background: linear-gradient(120deg, #4fb8ff, #7c6dff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.core-topmenu {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.core-topmenu a {
    text-decoration: none;
    color: #cdd9ff;
    padding: 6px 12px;
    border-radius: 999px;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.core-topmenu a:hover {
    background: rgba(120, 165, 255, 0.16);
    color: #ffffff;
    transform: translateY(-1px);
}

.core-user {
    color: #9fb2ff;
    margin-right: 4px;
}

/* --------------------------------------------
   LAYOUT
-------------------------------------------- */

.core-layout {
    display: flex;
    min-height: calc(100vh - 110px);
}

/* SIDEBAR */

.core-sidebar {
    width: 250px;
    background: linear-gradient(180deg, #090d19, #060814);
    border-right: 1px solid rgba(80, 140, 255, 0.2);
    padding: 18px 14px 22px;
}

.core-sidebar h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #8fbcff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.core-sidebar a {
    display: block;
    padding: 9px 11px;
    margin-bottom: 6px;
    border-radius: 10px;
    color: #d7e1ff;
    font-size: 0.9rem;
    text-decoration: none;
    position: relative;
    transition: background 0.16s ease, color 0.16s ease, transform 0.08s ease;
}

.core-sidebar a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    transform: translateX(2px);
}

/* klasa na przyszłość – możesz dodawać w PHP .active */
.core-sidebar a.active {
    background: linear-gradient(90deg, rgba(79,184,255,0.25), rgba(79,184,255,0.05));
    border: 1px solid rgba(79,184,255,0.5);
    color: #ffffff;
}

/* CONTENT */

.core-content {
    flex-grow: 1;
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --------------------------------------------
   PANELS / CARDS – modern glass
-------------------------------------------- */

.core-card {
    background:
        linear-gradient(135deg, rgba(90, 150, 255, 0.16), transparent 55%),
        linear-gradient(180deg, rgba(8, 11, 24, 0.94), rgba(6, 9, 20, 0.98));
    border-radius: 18px;
    padding: 20px 20px 18px;
    border: 1px solid rgba(100, 150, 255, 0.4);
    box-shadow:
        0 0 24px rgba(0, 0, 0, 0.85),
        0 0 18px rgba(60, 120, 255, 0.25);
    backdrop-filter: blur(14px);
}

.core-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.22rem;
    color: #d7e7ff;
}

.core-card p {
    font-size: 0.93rem;
    color: #c5cee7;
}

/* --------------------------------------------
   SEKCJE / LISTY
-------------------------------------------- */

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #a6c6ff;
}

.list {
    padding-left: 18px;
    margin: 0;
}

.list li {
    margin-bottom: 4px;
    font-size: 0.93rem;
    color: #dde5ff;
}

/* tag „PRZERWA TECHNICZNA” */
.tech-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 204, 102, 0.7);
    background: rgba(255, 204, 102, 0.12);
    color: #ffe8a0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --------------------------------------------
   FORMULARZE / AUTH
-------------------------------------------- */

.core-form {
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.core-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: #cfd6f0;
}

.core-form input[type="text"],
.core-form input[type="password"],
.core-form input[type="number"],
.core-form select,
.core-form textarea {
    background: radial-gradient(circle at top, #0b1022, #050814);
    border: 1px solid rgba(120, 150, 230, 0.6);
    padding: 9px 10px;
    border-radius: 10px;
    color: #f0f3ff;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.core-form textarea {
    min-height: 90px;
    resize: vertical;
}

.core-form input:focus,
.core-form select:focus,
.core-form textarea:focus {
    border-color: #4fb8ff;
    box-shadow: 0 0 0 1px rgba(79,184,255,0.35), 0 0 10px rgba(79,184,255,0.5);
    background: radial-gradient(circle at top, #0f1730, #050814);
}

/* BUTTONY */

.core-form button,
.core-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(120deg, #4fb8ff, #7b64ff);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(79,184,255,0.45);
    transition: transform 0.1s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.core-form button:hover,
.core-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(79,184,255,0.6);
    filter: brightness(1.05);
}

.core-form button:active,
.core-btn:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 0 10px rgba(79,184,255,0.35);
}
.core-link {
    color: #8fb4ff;
    text-decoration: none;
    border-bottom: 1px solid rgba(143,180,255,0.5);
    padding-bottom: 1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.core-link:hover {
    color: #ffffff;
    border-bottom-color: rgba(255,255,255,0.8);
}
/* ogólne selecty już masz, dokładamy opcje */
.core-form select {
    background: radial-gradient(circle at top, #0b1022, #050814);
    color: #e8ecff;
}

/* wygląd listy opcji po rozwinięciu */
.core-form select option {
    background-color: #050814;
    color: #e8ecff;
}
/* ===== FIX LINKÓW I PRZYCISKÓW ===== */

/* PRZYCISKI */
.core-btn,
.core-btn:link,
.core-btn:visited,
.core-btn:hover,
.core-btn:active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(120deg, #4fb8ff, #7b64ff);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(79,184,255,0.45);
    transition: transform 0.1s ease, box-shadow 0.16s ease, filter 0.16s ease;
    text-decoration: none !important;   /* tu jest młotek */
}

.core-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(79,184,255,0.6);
    filter: brightness(1.05);
}

/* LINKI AKCJI (tabela) */
.core-link,
.core-link:link,
.core-link:visited {
    color: #8fb4ff;
    text-decoration: none;
    border-bottom: 1px solid rgba(143,180,255,0.5);
    padding-bottom: 1px;
}

.core-link:hover {
    color: #ffffff;
    border-bottom-color: rgba(255,255,255,0.9);
    text-decoration: none;
}


/* ERROR BOX */

.core-error {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(255, 82, 82, 0.16), rgba(255, 82, 82, 0.05));
    border: 1px solid rgba(255,82,82,0.7);
    color: #ffc4c4;
    font-size: 0.85rem;
}

/* --------------------------------------------
   FOOTER
-------------------------------------------- */

.core-footer {
    padding: 14px;
    text-align: center;
    background: #060917;
    border-top: 1px solid rgba(90, 150, 255, 0.3);
    color: #8fa2d8;
    font-size: 0.8rem;
}

/* --------------------------------------------
   RESPONSIVE
-------------------------------------------- */

@media (max-width: 900px) {
    .core-layout {
        flex-direction: column;
    }

    .core-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(80,140,255,0.25);
    }

    .core-content {
        padding: 18px;
    }

    .core-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .core-topmenu {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}
/* ===== Uniwersalne przyciski w CORE v2 (mapa, edytor, itp.) ===== */

.core-card button,
.core-btn,
.core-table button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: radial-gradient(circle at top, #1c2340, #0b0f1f);
    color: #e7ecff;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;

    box-shadow: 0 0 10px rgba(0, 0, 0, 0.55);
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.08s ease,
        box-shadow 0.15s ease;
}

.core-card button:hover,
.core-btn:hover,
.core-table button:hover {
    border-color: rgba(88, 190, 255, 0.9);
    background: radial-gradient(circle at top, #24315c, #10162a);
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.8);
}

.core-card button:active,
.core-btn:active,
.core-table button:active {
    transform: translateY(0);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

/* Wersja "bezpieczna" / wtórna */
.core-btn-secondary {
    background: radial-gradient(circle at top, #151a2b, #090c16);
    border-color: rgba(255, 255, 255, 0.15);
    color: #cfd4ff;
}
.core-btn-secondary:hover {
    border-color: rgba(200, 200, 255, 0.8);
}

/* Wersja niebezpieczna (usuń, kasuj itp.) */
.core-btn-danger,
.core-table button[style*="ff6b6b"],
.core-table button[style*="ff7777"] {
    background: radial-gradient(circle at top, #511620, #2b0a0f);
    border-color: rgba(255, 107, 107, 0.75);
    color: #ffd8d8;
}
.core-btn-danger:hover,
.core-table button[style*="ff6b6b"]:hover,
.core-table button[style*="ff7777"]:hover {
    border-color: rgba(255, 140, 140, 0.95);
    background: radial-gradient(circle at top, #6b1c29, #350c12);
}

/* Przyciski w listach (np. lista pięter, narzędzia) */
.core-list button {
    width: 100%;
    justify-content: flex-start;
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Aktywny przycisk (np. aktualne piętro) */
.core-list button.active {
    border-color: rgba(255, 184, 77, 0.95);
    background: radial-gradient(circle at top, #3a2a10, #1b1408);
    color: #ffe0a3;
}

/* Małe przyciski (jeśli chcesz używać) */
.core-btn-sm {
    padding: 3px 8px;
    font-size: 0.75rem;
}

/* Ikonkowy "tag" przy filtrach itp. */
.core-chip-btn {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.18);
}
.core-chip-btn.active {
    border-color: rgba(88, 190, 255, 0.9);
    background: rgba(88, 190, 255, 0.18);
}
/* ===== MAP EDITOR – CORE V2 ===== */

.map-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.map-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
}

.map-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.map-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 12px;
}

@media (max-width: 900px) {
    .map-layout {
        grid-template-columns: 1fr;
    }
}

.map-sidebar {
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-sidebar h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.map-sidebar-section {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.map-floor-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
}

.map-floor-item {
    padding: 6px 8px;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid transparent;
}

.map-floor-item:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.7);
}

.map-floor-item.active {
    border-color: rgba(255, 184, 77, 0.9);
    background: radial-gradient(circle at top, #3a2a10, #120d05);
    color: #ffe2a8;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.map-hint {
    font-size: 0.78rem;
    opacity: 0.7;
}

/* płótno mapy */

.map-canvas-wrapper {
    border-radius: 12px;
    background: radial-gradient(circle at top, #141720, #05060c);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px;
    overflow: auto;
    max-height: 70vh;
}

.map-grid {
    position: relative;
    background: repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.02),
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 24px
    ),
    repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.02),
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 24px
    );
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.7);
}

.map-grid-cell {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.02);
    box-sizing: border-box;
}

/* PUNKTY */

.map-point {
    position: absolute;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    margin-top: -5px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

/* ===== POKOJE ===== */

.map-room {
    position: absolute;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: radial-gradient(circle at top, rgba(255,255,255,0.08), rgba(0,0,0,0.65));
    box-shadow: 0 0 10px rgba(0,0,0,0.55);
    overflow: hidden;
    pointer-events: auto;
}

.map-room-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(255, 255, 255, 0.25);
}

.map-room-label {
    position: absolute;
    left: 4px;
    top: 4px;
    right: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f5f5ff;
    text-shadow: 0 0 3px rgba(0,0,0,0.9);
    pointer-events: none;
    line-height: 1.2;
}

.map-room--selected {
    border-color: rgba(255, 184, 77, 0.95);
    box-shadow: 0 0 14px rgba(255, 184, 77, 0.6);
}

/* aktywny przycisk "pokój" */

.map-tool-room.active,
.map-toolbar .core-btn.active {
    border-color: rgba(255, 184, 77, 0.95);
    background: radial-gradient(circle at top, #3a2a10, #1b1408);
    color: #ffe0a3;
}

.core-form input[type="email"]{
    background: radial-gradient(circle at top, #0b1022, #050814);
    border: 1px solid rgba(120, 150, 230, 0.6);
    padding: 9px 10px;
    border-radius: 10px;
    color: #f0f3ff;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.core-form input[type="email"]:focus{
    border-color: #4fb8ff;
    box-shadow: 0 0 0 1px rgba(79,184,255,0.35), 0 0 10px rgba(79,184,255,0.5);
    background: radial-gradient(circle at top, #0f1730, #050814);
}

.core-form input::placeholder,
.core-form textarea::placeholder{
    color: rgba(232, 236, 255, 0.45);
}

.core-form input:-webkit-autofill,
.core-form textarea:-webkit-autofill,
.core-form select:-webkit-autofill{
    -webkit-text-fill-color: #f0f3ff;
    box-shadow: 0 0 0px 1000px #050814 inset;
    border: 1px solid rgba(120, 150, 230, 0.6);
    transition: background-color 5000s ease-in-out 0s;
}

.core-form .core-checkrow{
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.core-form .core-check{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(120, 150, 230, 0.22);
    background: rgba(0, 0, 0, 0.28);
}

.core-form input[type="checkbox"]{
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(120, 150, 230, 0.55);
    background: radial-gradient(circle at top, #0b1022, #050814);
    box-shadow: 0 0 10px rgba(0,0,0,0.55);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.08s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.core-form input[type="checkbox"]:hover{
    border-color: rgba(79,184,255,0.9);
    box-shadow: 0 0 0 1px rgba(79,184,255,0.22), 0 0 12px rgba(79,184,255,0.35);
}

.core-form input[type="checkbox"]:active{
    transform: scale(0.96);
}

.core-form input[type="checkbox"]::after{
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(120deg, #4fb8ff, #7b64ff);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.core-form input[type="checkbox"]:checked{
    border-color: rgba(79,184,255,0.95);
    box-shadow: 0 0 0 1px rgba(79,184,255,0.22), 0 0 14px rgba(79,184,255,0.55);
}

.core-form input[type="checkbox"]:checked::after{
    opacity: 1;
    transform: scale(1);
}

.core-form input[type="checkbox"]:focus{
    outline: none;
    box-shadow: 0 0 0 2px rgba(79,184,255,0.25), 0 0 14px rgba(79,184,255,0.55);
}

.core-form label:has(input[type="checkbox"]){
    user-select: none;
}

.core-form button{
    min-height: 38px;
}

.core-form .core-btn-wide{
    width: 100%;
    max-width: 380px;
}