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

body{
    background:#eef2f5;
    color:#0f172a;
}

/* HEADER */
.app-header,
header{
    background:#151827;
    color:#fff;
    padding:16px 24px;
    min-height:64px;
    font-size:24px;
    font-weight:800;
    display:flex;
    justify-content:space-between;
    align-items:center;
    box-shadow:0 2px 10px rgba(0,0,0,.18);
}

.header-user{
    font-size:15px;
    font-weight:600;
}

.header-user a{
    color:#c4b5fd;
    margin-left:14px;
}

/* MAIN LAYOUT */
.studio-layout{
    display:grid;
    grid-template-columns:300px minmax(0,1fr);
    gap:18px;
    padding:18px;
    height:calc(100vh - 64px);
}

.left-panel{
    min-width:0;
}

.main-panel{
    background:#fff;
    border-radius:16px;
    box-shadow:0 4px 18px rgba(15,23,42,.12);
    padding:18px;
    min-width:0;
    overflow:hidden;
}

/* OLD NEW_PROJECT COMPAT */
.wrapper{
    display:grid;
    grid-template-columns:340px 1fr;
    gap:20px;
    padding:20px;
    min-height:calc(100vh - 70px);
}

.sidebar{
    display:flex;
    flex-direction:column;
    gap:15px;
}

/* CARDS */
.card{
    background:#fff;
    border-radius:14px;
    padding:16px;
    box-shadow:0 3px 14px rgba(15,23,42,.10);
}

.card h2{
    font-size:19px;
    margin-bottom:14px;
}

/* FORMS */
.card label{
    display:block;
    margin-top:10px;
    margin-bottom:5px;
    font-weight:700;
}

.card input,
.card select{
    width:100%;
    padding:9px;
}

/* PROJECT LIST */
.project-card{
    display:block;
    text-decoration:none;
    color:#111827;
    padding:12px;
    border-radius:12px;
    margin-bottom:10px;
    transition:.2s;
    border:1px solid #e5e7eb;
    background:#fff;
}

.project-card:hover,
.project-card.active{
    background:#ede9fe;
    border-color:#7c3aed;
    box-shadow:0 4px 12px rgba(124,58,237,.18);
}

.project-card strong{
    display:block;
    font-size:16px;
    margin-bottom:5px;
}

.project-card span{
    font-size:13px;
    color:#475569;
}

.new-project-link{
    display:block;
    margin-top:12px;
    padding:12px;
    border-radius:12px;
    text-align:center;
    background:#2563eb;
    color:#fff;
    text-decoration:none;
    font-weight:800;
}

.limit-box{
    margin-top:12px;
    background:#fff7ed;
    border:1px solid #fed7aa;
    padding:12px;
    border-radius:10px;
}

/* PROJECT TOP */
.project-header-box{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:14px;
    padding-bottom:12px;
    border-bottom:1px solid #e5e7eb;
}

.project-header-box h1{
    font-size:28px;
    margin-bottom:5px;
}

.project-header-box p{
    color:#64748b;
    font-size:14px;
}

/* MAP + STATS */
.project-content{
    display:grid;
    grid-template-columns:minmax(0,1fr) 300px;
    gap:16px;
    align-items:stretch;
}

.map-box{
    border-radius:14px;
    overflow:hidden;
    border:1px solid #e5e7eb;
    box-shadow:0 2px 10px rgba(15,23,42,.10);
    min-height:390px;
}

#map{
    width:100%;
    height:390px;
}

.stats-box{
    border:1px solid #e5e7eb;
    border-radius:14px;
    overflow:hidden;
    background:#f8fafc;
}

.stats-box h2{
    padding:14px;
    font-size:19px;
    background:#f1f5f9;
}

.stat-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding:13px 14px;
    border-top:1px solid #e5e7eb;
}

.stat-row span{
    color:#475569;
    font-weight:700;
    font-size:14px;
}

.stat-row strong{
    text-align:right;
    font-size:15px;
}

/* STATUS + ACTIONS */
.download-panel{
    margin-top:14px;
    padding:16px 18px;
    border-radius:14px;
    background:#f8fafc;
    border:1px solid #e5e7eb;
}

.download-panel h2{
    margin:0;
    font-size:22px;
}

.download-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:14px;
}

.status-badge{
    display:inline-block;
    padding:8px 14px;
    border-radius:999px;
    font-weight:800;
    background:#dbeafe;
    color:#1d4ed8;
}

.progress-line{
    width:100%;
    height:12px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
    margin:12px 0 8px;
}

.progress-line div{
    height:100%;
    background:#2563eb;
}

.action-row{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:14px;
}

.btn{
    display:inline-block;
    padding:12px 18px;
    border-radius:10px;
    border:0;
    background:#2563eb;
    color:white;
    text-decoration:none;
    font-weight:800;
    cursor:pointer;
}

.btn.disabled,
button.btn:disabled{
    background:#d1d5db;
    color:#6b7280;
    cursor:not-allowed;
}

.btn.danger{
    background:#fee2e2;
    color:#dc2626;
}

/* EMPTY */
.empty-panel{
    padding:40px;
    text-align:center;
}

/* FOOTER */
body::after{
    content:"SecuCanis Map Studio © 2025";
    display:block;
    text-align:center;
    color:#64748b;
    padding:8px;
    font-size:13px;
}

/* MOBILE */
@media(max-width:1000px){
    .studio-layout,
    .wrapper,
    .project-content{
        grid-template-columns:1fr;
        height:auto;
    }

    #map{
        height:360px;
    }

    .app-header,
    header{
        flex-direction:column;
        align-items:flex-start;
        gap:8px;
    }
}
/* ZWARCIE WIDOKU DASHBOARDU */

.studio-layout{
    height:auto;
    min-height:calc(100vh - 64px);
}

.main-panel{
    padding:16px;
}

.project-header-box{
    margin-bottom:10px;
    padding-bottom:10px;
}

.project-header-box h1{
    font-size:26px;
}

.project-content{
    grid-template-columns:1fr 285px;
    gap:14px;
}

.map-box{
    min-height:330px;
}

#map{
    height:330px;
}

.stats-box h2{
    padding:12px;
    font-size:18px;
}

.stat-row{
    padding:11px 13px;
}

.download-panel{
    margin-top:12px;
    padding:16px 18px;
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:14px;
}

.download-panel h2{
    margin:0;
    font-size:22px;
}

.download-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:14px;
}

.action-row{
    margin-top:10px;
}

.btn{
    padding:10px 16px;
}

/* STRONA 1 — NOWA MAPA: DUŻA MAPA I PODSUMOWANIE POD MAPĄ */

.wrapper{
    grid-template-columns:330px 1fr;
    align-items:start;
}

.wrapper .map-panel{
    min-height:720px;
}

.wrapper .map-panel #map{
    height:720px;
    min-height:720px;
}

.sidebar .card{
    margin-bottom:16px;
}

.sidebar .card:nth-last-child(3),
.sidebar .card:nth-last-child(2){
    margin-top:0;
}

/* lepsze checkboxy nakładek */
.sidebar .card label input[type="checkbox"]{
    width:auto;
    margin-right:8px;
}

.sidebar .card label{
    line-height:1.6;
}

/* statystyki w JS */
#tileStats .stat-row{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:10px 0;
    border-top:1px solid #e5e7eb;
}

#tileStats .stat-row:first-child{
    border-top:0;
}

/* STRONA 1 — FINALNY UKŁAD TWORZENIA MAPY */

.create-layout{
    display:grid;
    grid-template-columns:330px minmax(0,1fr);
    gap:18px;
    padding:18px;
    min-height:calc(100vh - 64px);
}

.create-sidebar{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.create-main{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.create-map-panel{
    height:620px;
}

.create-map-panel #map{
    height:620px;
    min-height:620px;
}

.create-bottom{
    display:grid;
    grid-template-columns:260px 1fr 220px;
    gap:16px;
    align-items:stretch;
}

.save-card{
    display:flex;
    align-items:center;
    justify-content:center;
}

.save-btn{
    width:100%;
    font-size:18px;
    padding:16px 20px;
}

/* wyłącza stare reguły mapy dla strony new_project */
.create-layout .map-panel{
    min-height:0;
}

.create-layout .map-panel #map{
    min-height:0;
}

.leaflet-tooltip.district-label{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #ff7a00 !important;
    font-size: 14px;
    font-weight: 900;
    font-family: Segoe UI, Arial, sans-serif;
    text-shadow:
        -1px -1px 0 #ffffff,
         1px -1px 0 #ffffff,
        -1px  1px 0 #ffffff,
         1px  1px 0 #ffffff,
         0px  0px 3px #ffffff;
}

.leaflet-tooltip-left.district-label:before,
.leaflet-tooltip-right.district-label:before,
.leaflet-tooltip-top.district-label:before,
.leaflet-tooltip-bottom.district-label:before{
    display:none !important;
}

.leaflet-tooltip.district-label{
    background:none !important;
    background-color:rgba(0,0,0,0) !important;
    border:0 !important;
    box-shadow:none !important;
    padding:0 !important;
    margin:0 !important;
    color:#ff7a00 !important;
    font-size:14px !important;
    font-weight:900 !important;
    line-height:1 !important;
    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff,
         0 0 4px #fff !important;
}

.leaflet-tooltip.district-label:before,
.leaflet-tooltip.district-label::before{
    display:none !important;
    border:0 !important;
    background:none !important;
}

.leaflet-tooltip.forest-label{
    background:none !important;
    background-color:transparent !important;
    border:0 !important;
    box-shadow:none !important;
    padding:0 !important;
    margin:0 !important;

    color:#16a34a !important;
    font-size:11px !important;
    font-weight:800 !important;
    line-height:1 !important;

    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff;
}

.leaflet-tooltip.forest-label:before,
.leaflet-tooltip.forest-label::before{
    display:none !important;
}

.hunting-device-icon{
    font-size:22px;
    line-height:26px;
    text-align:center;
    background:rgba(255,255,255,.85);
    border:1px solid #dc2626;
    border-radius:50%;
    width:28px !important;
    height:28px !important;
    box-shadow:0 2px 6px rgba(0,0,0,.25);
}

body{
    margin:0;
    font-family:Segoe UI,Arial,sans-serif;
    background:#f3f5f7;
}

.app-header{
    background:#2f4050;
    color:#fff;
    padding:18px 30px;
    font-size:24px;
    font-weight:bold;
    box-shadow:0 2px 10px rgba(0,0,0,.2);
}

.login-wrapper{
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:calc(100vh - 70px);
}

.login-card{
    width:420px;
    background:#fff;
    border-radius:12px;
    padding:35px;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
}

.login-card h1{
    margin-top:0;
    margin-bottom:10px;
}

.login-subtitle{
    color:#666;
    margin-bottom:25px;
}

.login-card label{
    display:block;
    margin-top:15px;
    margin-bottom:6px;
    font-weight:600;
}

.login-card input{
    width:100%;
    box-sizing:border-box;
    padding:12px;
    border:1px solid #ccc;
    border-radius:8px;
    font-size:15px;
}

.btn{
    background:#2f4050;
    color:#fff;
    border:none;
    border-radius:8px;
    padding:13px;
    cursor:pointer;
    font-size:16px;
    margin-top:22px;
}

.btn:hover{
    background:#41576c;
}

.full{
    width:100%;
}

.login-links{
    text-align:center;
    margin-top:25px;
}

.login-links a{
    text-decoration:none;
    color:#2f4050;
    font-weight:600;
}

.login-error{
    background:#ffe4e4;
    color:#b40000;
    padding:12px;
    border-radius:8px;
    margin-bottom:20px;
}