/* RESTART BAZOWY & KONTRASTOWA CZCIONKA */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif; }
html, body { width: 100%; height: 100%; background-color: #11141a; color: #1a202c; overflow: hidden; }

/* PANEL GÓRNY - TOPBAR */
.app-topbar {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 60px;
    background: #ffffff;
    border-bottom: 3px solid #e53e3e; /* Czerwona ostra linia przewodnia */
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 25px; z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.topbar-brand { display: flex; align-items: center; font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; }
.brand-hive { color: #1a202c; }
.brand-lock { color: #e53e3e; }
.brand-dot { width: 6px; height: 6px; background-color: #e53e3e; border-radius: 50%; margin-left: 5px; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.user-badge { background: #1a202c; color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.btn-logout-ctrl { background: none; border: 1px solid #e53e3e; color: #e53e3e; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 0.75rem; font-weight: 700; transition: all 0.2s; }
.btn-logout-ctrl:hover { background: #e53e3e; color: #fff; }

/* KONTENER ARCHITEKTURY */
.app-container {
    position: relative;
    width: 100%; height: calc(100% - 60px);
    margin-top: 60px;
}

/* TUNING MAPY - TRYB GRAFITOWY PREMUM VIA FILTRY CSS */
#map-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
    filter: grayscale(100%) invert(93%) hue-rotate(180deg) brightness(95%) contrast(100%);
}

/* LEWITUJĄCE CZUISTE BIAŁE KAFELKI */
.floating-panel {
    position: absolute; top: 20px; bottom: 20px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border: 1px solid #e2e8f0;
    border-radius: 14px; display: flex; flex-direction: column; z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-left { left: 24px; width: 330px; }
.sidebar-right {
    right: 24px; width: 360px; padding: 22px; overflow-y: auto; color: #2d3748;
    opacity: 0; transform: translateX(400px); pointer-events: none;
}
.sidebar-right.active { opacity: 1; transform: translateX(0); pointer-events: auto; }

/* NAGŁÓWKI PANELÓW */
.sidebar-header { padding: 18px 20px; border-bottom: 1px solid #edf2f7; }
.sidebar-header h3 { font-size: 0.85rem; font-weight: 700; color: #718096; letter-spacing: 1px; margin-bottom: 12px; }
.search-box input {
    width: 100%; padding: 11px 14px; background: #f7fafc; border: 1px solid #cbd5e0;
    color: #1a202c; border-radius: 8px; outline: none; font-size: 0.88rem; transition: border 0.2s;
}
.search-box input:focus { border-color: #e53e3e; background: #fff; }

/* LISTA NACZEP - SPORTOWY DESIGN */
.device-list { flex: 1; overflow-y: auto; list-style: none; padding: 5px 0; }
.device-item {
    padding: 15px 20px; border-bottom: 1px solid #f0f4f8; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; transition: all 0.15s;
}
.device-item:hover { background-color: #f7fafc; }
.device-item.active { background-color: #fff; border-left: 5px solid #e53e3e; padding-left: 15px; box-shadow: inset 0 0 10px rgba(0,0,0,0.02); }
.device-info h4 { font-size: 0.95rem; color: #1a202c; font-weight: 700; }
.device-info p { font-size: 0.75rem; color: #718096; margin-top: 2px; }

.status-dot { width: 9px; height: 9px; border-radius: 50%; }
.status-dot.online { background-color: #38a169; box-shadow: 0 0 6px #38a169; }
.status-dot.offline { background-color: #a0aec0; }

.sidebar-footer { padding: 15px; border-top: 1px solid #edf2f7; }
.btn-admin-trigger {
    width: 100%; padding: 12px; background-color: #1a202c; color: #fff;
    border: none; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.5px; transition: background 0.2s;
}
.btn-admin-trigger:hover { background-color: #e53e3e; }

/* DETALE PO PRAWEJ STRONIE */
.details-header { margin-bottom: 20px; border-bottom: 2px solid #edf2f7; padding-bottom: 12px; }
.details-header h3 { color: #1a202c; font-weight: 800; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.info-card { background: #f7fafc; padding: 12px; border-radius: 8px; border: 1px solid #edf2f7; }
.info-card label { display: block; font-size: 0.68rem; color: #718096; font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.info-card span { font-weight: 700; font-size: 0.95rem; color: #1a202c; }

/* SEKCJA RYGLA */
.lock-section { background: #fff; padding: 16px; border-radius: 10px; border: 2px solid #edf2f7; text-align: center; margin-bottom: 18px; }
.lock-label { font-size: 0.7rem; color: #718096; font-weight: 700; text-transform: uppercase; }
.lock-state { font-size: 1.2rem; font-weight: 800; display: block; margin: 10px 0; }
.lock-state.locked { color: #e53e3e; }
.lock-state.unlocked { color: #38a169; }
.btn-lock { width: 100%; padding: 12px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; color: #fff; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px; }
.btn-lock.action-open { background-color: #38a169; }
.btn-lock.action-close { background-color: #e53e3e; }

.badge { background: #e2e8f0; color: #4a5568; padding: 3px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; }

/* FORMULARZE MODALA ADMINA */
.modal-overlay, .login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(26, 32, 44, 0.8); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.login-overlay { background-color: #1a202c; z-index: 2000; }
.login-box h2 { font-size: 2.2rem; font-weight: 900; margin-bottom: 5px; }
.login-box p { color: #718096; font-size: 0.9rem; margin-bottom: 25px; }
.login-box input { width: 100%; padding: 14px; margin-bottom: 15px; background: #2d3748; border: 1px solid #4a5568; color: #fff; border-radius: 8px; }
.btn-login { width: 100%; padding: 14px; background-color: #e53e3e; color: #fff; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 1rem; letter-spacing: 1px; }

.modal-container { width: 95%; max-width: 1200px; height: 85vh; background-color: #ffffff; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.25); color: #1a202c; }
.modal-header { padding: 20px 25px; background-color: #1a202c; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.btn-modal-close { background: none; border: none; color: #a0aec0; font-size: 2rem; cursor: pointer; }
.btn-modal-close:hover { color: #e53e3e; }
.modal-tabs { display: flex; background-color: #f7fafc; border-bottom: 1px solid #e2e8f0; }
.tab-btn { padding: 15px 25px; background: none; border: none; color: #718096; cursor: pointer; font-weight: 700; font-size: 0.9rem; }
.tab-btn.active { color: #e53e3e; background-color: #fff; border-bottom: 3px solid #e53e3e; }
.modal-body { flex: 1; padding: 25px; overflow-y: auto; background: #fff; }

.admin-split { display: grid; grid-template-columns: 320px 1fr; gap: 25px; height: 100%; }
.admin-form h4 { font-size: 1rem; font-weight: 700; margin-bottom: 15px; color: #1a202c; }
.admin-form input, .admin-form select { width: 100%; padding: 11px; margin-bottom: 12px; background-color: #f7fafc; border: 1px solid #cbd5e0; color: #1a202c; border-radius: 6px; }
.admin-form input:focus { border-color: #e53e3e; }
.btn-save { background-color: #e53e3e; color: #fff; padding: 12px; border: none; border-radius: 8px; cursor: pointer; font-weight: 700; }

.admin-table-wrapper { background-color: #fff; border-radius: 8px; border: 1px solid #e2e8f0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #e2e8f0; font-size: 0.88rem; color: #2d3748; }
th { background-color: #f7fafc; color: #4a5568; font-weight: 700; }
tr:hover td { background-color: #fcfdfd; }

.checkbox-row-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background-color: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 6px; }
.checkbox-row-item label { color: #1a202c; font-weight: 600; font-size: 0.85rem; }

/* MODERNY SCROLLBAR DLA BIAŁYCH PANELI */
.floating-panel::-webkit-scrollbar { width: 5px; }
.floating-panel::-webkit-scrollbar-track { background: transparent; }
.floating-panel::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }
.floating-panel::-webkit-scrollbar-thumb:hover { background: #e53e3e; }
