/* ── GeoStack iş sahəsi: lent (ribbon), tooltip, status zolağı, panellər ──
   Geodeziya və Peyk Analiz səhifələri tərəfindən paylaşılır.
   Vurğu rəngi səhifədə --acc dəyişənləri ilə təyin olunur. */

:root {
    --acc: #2f81f7;
    --acc-rgb: 47,129,247;
    --acc-hover: #4493f8;
    --acc-text: #58a6ff;
    --ribbon-h: 92px;
    --status-h: 28px;
}


.cad-ribbon {
    position: fixed;
    top: 64px; left: 0; right: 0;
    height: var(--ribbon-h);
    background: linear-gradient(180deg, #161b22 0%, #11151c 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    z-index: 2600;
    display: flex;
    align-items: stretch;
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
.rb-group {
    display: flex;
    flex-direction: column;
    padding: 6px 6px 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.rb-items { flex: 1; display: flex; align-items: flex-start; gap: 2px; }
.rb-label {
    height: 20px; line-height: 20px;
    text-align: center;
    font-size: 9.5px; font-weight: 500; color: #6e7681;
    letter-spacing: .04em;
    border-top: 1px solid rgba(255,255,255,0.03);
    margin-top: 2px;
}
.rb-btn {
    width: 58px; height: 62px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    border-radius: 6px; border: 1px solid transparent;
    background: transparent; color: #c9d1d9;
    cursor: pointer; transition: background .12s, border-color .12s, color .12s;
    position: relative;
}
.rb-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.rb-btn span { font-size: 10px; font-weight: 500; line-height: 1.1; color: #adbac7; text-align: center; white-space: nowrap; }
.rb-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.10); }
.rb-btn:hover span { color: #fff; }
.rb-btn:active { background: rgba(var(--acc-rgb),0.18); }
.rb-btn.active, .cad-tool-icon-btn.active {
    background: rgba(var(--acc-rgb),0.20);
    border-color: var(--acc);
    box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb),0.35);
}
.rb-btn.active span { color: #fff; }
.rb-btn.danger:hover { background: rgba(244,63,94,0.12); border-color: rgba(244,63,94,0.35); }
.rb-btn.danger:hover svg { color: #fb7185; }

/* Kiçik (üfüqi) ribbon düymələri */
.rb-stack { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.rb-sm {
    height: 19px; padding: 0 8px 0 4px;
    display: flex; align-items: center; gap: 6px;
    border-radius: 4px; border: 1px solid transparent;
    background: transparent; color: #adbac7;
    font-size: 10px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.rb-sm svg { width: 15px; height: 15px; }
.rb-sm:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.10); color: #fff; }
.rb-sm.active { background: rgba(var(--acc-rgb),0.20); border-color: var(--acc); color: #fff; }

/* İkon rəngləri */
.ic-blue   { color: #58a6ff; }
.ic-amber  { color: #f2cc60; }
.ic-green  { color: #3fb950; }
.ic-red    { color: #f85149; }
.ic-violet { color: #bc8cff; }
.ic-slate  { color: #8b949e; }

/* AutoCAD üslubunda zəngin tooltip */
#cad-tip {
    position: fixed; z-index: 99999;
    max-width: 280px;
    background: #1c2128;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.55);
    padding: 10px 12px;
    pointer-events: none;
    opacity: 0; transform: translateY(-4px);
    transition: opacity .12s, transform .12s;
}
#cad-tip.show { opacity: 1; transform: translateY(0); }
#cad-tip .tt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#cad-tip .tt-title { font-size: 12px; font-weight: 700; color: #fff; }
#cad-tip .tt-key {
    font-family: ui-monospace, Consolas, monospace; font-size: 10px; font-weight: 700;
    color: #c9d1d9; background: #2d333b; border: 1px solid #444c56; border-bottom-width: 2px;
    border-radius: 4px; padding: 0 6px; line-height: 16px;
}
#cad-tip .tt-desc { font-size: 11px; color: #9da7b3; line-height: 1.45; margin-top: 6px; }
#cad-tip .tt-desc:empty { display: none; }

/* ── Status zolağı (AutoCAD) ─────────────────────────────────── */
.cad-statusbar {
    position: fixed; left: 0; right: 0; bottom: 0;
    height: var(--status-h);
    background: #0d1117;
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 2600;
    display: flex; align-items: center;
    font-size: 11px; color: #adbac7;
    font-variant-numeric: tabular-nums;
    padding-left: var(--status-pad, 0px);
}
.sb-cell {
    height: 100%; display: flex; align-items: center; gap: 6px;
    padding: 0 12px; border-right: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}
.sb-k { font-size: 9.5px; font-weight: 700; color: #6e7681; letter-spacing: .06em; text-transform: uppercase; }
.sb-v { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: #e6edf3; min-width: 92px; }
.sb-v.z { color: #58a6ff; min-width: 60px; }
.sb-cmd { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, Consolas, monospace; color: #7d8590; }
.sb-cmd b { color: #f2cc60; font-weight: 700; }
.sb-btn { cursor: pointer; }
.sb-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* ── Panel dizayn sistemi ─────────────────────────────────────── */
.custom-scroll { scrollbar-width: thin; scrollbar-color: #30363d transparent; }
.custom-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: #30363d; border-radius: 8px; border: 2px solid #0d1117; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #484f58; }

.pn-head {
    padding: 14px 16px 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgba(0,0,0,0.2); flex-shrink: 0;
}
.pn-title { display: flex; align-items: center; gap: 10px; }
.pn-title-ic {
    width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.pn-title h2 { font-size: 12.5px; font-weight: 700; color: #e6edf3; letter-spacing: .01em; line-height: 1.2; }
.pn-title p { font-size: 10.5px; color: #6e7681; margin-top: 1px; }
.pn-close {
    width: 28px; height: 28px; border-radius: 6px; color: #6e7681; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; transition: .15s;
}
.pn-close:hover { color: #fff; background: rgba(255,255,255,0.06); }

.pn-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 22px; }
.pn-sec { display: flex; flex-direction: column; gap: 8px; }
.pn-sec + .pn-sec { padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.05); }
.pn-sec-h { display: flex; align-items: center; justify-content: space-between; min-height: 18px; }
.pn-h { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7d8590; }
.pn-meta { font-size: 10px; color: #6e7681; }
.pn-link { font-size: 10.5px; font-weight: 600; color: var(--acc-text); cursor: pointer; background: none; border: none; }
.pn-link:hover { color: #fff; }
.pn-link.danger { color: #f85149; }

.pn-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 12px; }
.pn-lbl { display: block; font-size: 10.5px; color: #8b949e; margin-bottom: 5px; }
.pn-grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.pn-grid2 > * { min-width: 0; }
.pn-row { display: flex; gap: 8px; align-items: flex-end; }
.pn-row > .grow { flex: 1; min-width: 0; }

.pn-input {
    width: 100%; height: 32px; background: #0a0d12;
    border: 1px solid rgba(255,255,255,0.10); border-radius: 6px;
    padding: 0 10px; font-size: 12px; color: #e6edf3; outline: none;
    font-family: inherit; transition: border-color .15s, box-shadow .15s;
    min-width: 0;
}
.pn-input::placeholder { color: #545d68; }
.pn-input:hover { border-color: rgba(255,255,255,0.18); }
.pn-input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(var(--acc-rgb),0.15); }
select.pn-input {
    appearance: none; cursor: pointer; padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237d8590' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
select.pn-input option { background: #161b22; }

.pn-btn {
    height: 32px; padding: 0 12px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
    background: #21262d; color: #c9d1d9; border: 1px solid rgba(255,255,255,0.10);
    transition: background .15s, border-color .15s, color .15s;
}
.pn-btn i { font-size: 11px; }
.pn-btn:hover { background: #30363d; border-color: rgba(255,255,255,0.18); color: #fff; }
.pn-btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.pn-btn.primary:hover { background: var(--acc-hover); border-color: var(--acc-hover); }
.pn-btn.success { background: #238636; border-color: #2ea043; color: #fff; }
.pn-btn.success:hover { background: #2ea043; }
.pn-btn.orange { background: #bd561d; border-color: #db6d28; color: #fff; }
.pn-btn.orange:hover { background: #db6d28; }
.pn-btn.ghost { background: transparent; }
.pn-btn.ghost:hover { background: rgba(255,255,255,0.05); }
.pn-btn.danger:hover { color: #f85149; border-color: rgba(248,81,73,0.4); background: rgba(248,81,73,0.08); }
.pn-btn.wide { width: 100%; }
.pn-btn.tall { height: 36px; }

.pn-drop {
    border: 1px dashed rgba(255,255,255,0.14); border-radius: 8px; background: rgba(0,0,0,0.2);
    padding: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: .15s;
}
.pn-drop:hover { border-color: rgba(var(--acc-rgb),0.6); background: rgba(var(--acc-rgb),0.06); }
.pn-drop-ic { width: 36px; height: 36px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pn-drop b { display: block; font-size: 11.5px; font-weight: 600; color: #e6edf3; }
.pn-drop small { display: block; font-size: 10px; color: #6e7681; margin-top: 1px; word-break: break-all; }

.pn-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pn-toggle-row b { display: block; font-size: 11.5px; font-weight: 600; color: #e6edf3; }
.pn-toggle-row small { display: block; font-size: 10px; color: #6e7681; }
.pn-switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; cursor: pointer; }
.pn-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pn-switch span { position: absolute; inset: 0; background: #30363d; border-radius: 20px; transition: .2s; }
.pn-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: .2s; }
.pn-switch input:checked + span { background: var(--acc); }
.pn-switch input:checked + span::after { transform: translateX(14px); }

.pn-status {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    font-size: 10.5px; color: #8b949e; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 999px; padding: 4px 10px;
}
.pn-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #3fb950; flex-shrink: 0; }
.pn-note { font-size: 10.5px; color: #8b949e; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; padding: 8px 10px; }
.pn-note.edit { color: #f2cc60; background: rgba(242,204,96,0.06); border-color: rgba(242,204,96,0.25); }
.pn-count { font-size: 10px; font-weight: 600; color: #8b949e; background: rgba(255,255,255,0.06); border-radius: 999px; padding: 0 7px; line-height: 17px; }

/* Siyahı elementləri (layihə və qatlar) */
.pn-item {
    display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
    border-radius: 6px; border: 1px solid transparent; cursor: pointer; transition: .12s;
    font-size: 12px; color: #adbac7;
}
.pn-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.pn-item.active { background: rgba(var(--acc-rgb),0.12); border-color: rgba(var(--acc-rgb),0.45); color: #fff; }
.pn-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-item .sw { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3); }
.pn-item .ck { font-size: 10px; color: var(--acc-text); }
.pn-empty { font-size: 11px; color: #545d68; text-align: center; padding: 10px 0; }

/* Altlıq xəritə seçimi */
.bm-opt { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.bm-opt .bm-thumb { height: 52px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,0.10); transition: .15s; }
.bm-opt .bm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bm-opt .bm-label { font-size: 10.5px; color: #7d8590; text-align: center; }
.bm-opt:hover .bm-thumb { border-color: rgba(255,255,255,0.3); }
.bm-opt.active .bm-thumb { border-color: var(--acc); box-shadow: 0 0 0 2px rgba(var(--acc-rgb),0.35); }
.bm-opt.active .bm-label { color: #fff; font-weight: 600; }

.pn-color { width: 32px; height: 32px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.10); background: #0a0d12; padding: 3px; cursor: pointer; flex-shrink: 0; }
.pn-color::-webkit-color-swatch-wrapper { padding: 0; }
.pn-color::-webkit-color-swatch { border: none; border-radius: 3px; }

.pn-foot { padding: 10px 20px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 10px; color: #545d68; text-align: center; flex-shrink: 0; }

.kbd {
    font-family: ui-monospace, Consolas, monospace; font-size: 9.5px; font-weight: 700;
    color: #c9d1d9; background: #21262d; border: 1px solid #30363d; border-bottom-width: 2px;
    border-radius: 4px; padding: 0 5px; line-height: 15px; min-width: 18px; text-align: center;
}

/* ── Yığıla bilən bölmələr (gs-panels.js) ─────────────────────────── */
.pn-sec[data-sec] > .pn-sec-h { cursor: pointer; user-select: none; justify-content: flex-start; gap: 8px; }
.pn-sec[data-sec] > .pn-sec-h > .pn-h { flex: 1; display: flex; align-items: center; gap: 6px; }
.pn-sec[data-sec] > .pn-sec-h:hover .pn-h,
.pn-sec[data-sec] > .pn-sec-h:hover .pn-chev { color: #c9d1d9; }
.pn-chev { font-size: 8px; color: #545d68; width: 10px; transition: transform .15s, color .15s; }
.pn-sec.closed > .pn-sec-h .pn-chev { transform: rotate(-90deg); }
.pn-sec.closed > :not(.pn-sec-h) { display: none !important; }

.pn-iconbtn {
    width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: var(--acc-text); border: 1px solid rgba(var(--acc-rgb),0.3); background: rgba(var(--acc-rgb),0.06); transition: .15s;
}
.pn-iconbtn:hover { color: #04130d; background: var(--acc); border-color: var(--acc); }

/* ── Panel enini dəyişmə tutacağı ─────────────────────────────────── */
.gs-resize { position: absolute; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 5; }
.gs-resize.edge-right { right: -3px; }
.gs-resize.edge-left { left: -3px; }
.gs-resize::after { content: ''; position: absolute; left: 2px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.gs-resize:hover::after, body.gs-resizing .gs-resize::after { background: var(--acc); }
body.gs-resizing { cursor: col-resize; user-select: none; }
body.gs-resizing .leaflet-container { pointer-events: none; }

/* ── Yığılmış paneli açmaq üçün kənar düyməsi ─────────────────────── */
.gs-reopen {
    position: absolute; top: 50%; z-index: 1000; display: none; transform: translateY(-50%);
    width: 22px; height: 44px; align-items: center; justify-content: center;
    background: rgba(13,17,23,0.94); color: #8b949e; font-size: 11px;
    border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 4px 16px rgba(0,0,0,0.4); transition: .15s;
}
.gs-reopen:hover { color: #fff; background: rgba(var(--acc-rgb),0.2); border-color: rgba(var(--acc-rgb),0.5); }
.gs-reopen.at-left { left: 0; border-left: none; border-radius: 0 8px 8px 0; }
.gs-reopen.at-right { right: 0; border-right: none; border-radius: 8px 0 0 8px; }
