/* ============================================================
   Organizasyon Şeması — orgchart.css  (v6)
   ============================================================

   Çizgi mantığı:

   ┌─────────────┐
   │  Üst Node   │         ← .oc-node
   └─────────────┘
   ┌─────────────────────────────┐  ← li > ul  (padding-top: 32px)
   │  ul::before: top:0, h:32px │    Üst node altından başlar, 32px iner
   └──────────────┬──────────────┘
   ───────────────┼───────────────  ← yatay çubuk: li::after (top:0 of li)
                  │                   li starts here (inside ul content area)
         li::before top:0, h:32px  ← bar'dan child'a dikey çizgi
   ┌─────────────┐
   │  Alt Node   │         ← .oc-node (starts at li's padding-top: 32px)
   └─────────────┘

   Neden çalışır:
   - ul { padding-top: 32px } → içerik alanı 32px aşağıdan başlar
   - ul::before { top:0; h:32px } → ul'ün üst kenarından (= parent node altı)
     tam 32px aşağı iner, padding bitişine (= yatay çubuk seviyesi) ulaşır
   - li flex item olarak ul content alanında başlar (= y:32 from ul top)
   - li::after (yatay çubuk) top:0 of li → ul::before'un bittiği yer
   - li::before (dikey) top:0 of li, h:32px → padding-top alanını doldurur
   - .oc-node, li'nin padding-top sonrası başlar (y:32 from li top)
   ============================================================ */

/* ── Wrappers ─────────────────────────────────────────────── */
.oc-preview-wrapper,
.oc-embed {
    overflow-x: auto;
    padding: 48px 32px;
    border-radius: 16px;
    min-height: 200px;
}

/* ── Tree skeleton ────────────────────────────────────────── */
.oc-tree,
.oc-tree ul {
    padding: 0;
    margin: 0;
    list-style: none;
    text-align: center;
}

.oc-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: max-content;
}

.oc-tree ul {
    display: flex;
    flex-direction: row;
    justify-content: center;
    position: relative;
}

/* Children wrapper: padding-top creates space for parent→bar line */
.oc-tree li > ul {
    padding-top: 32px;
}

/* ── List items ───────────────────────────────────────────── */
.oc-tree li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

/* Root li: no decoration above */
.oc-tree > li::before {
    display: none;
}

/* ── Connector: parent node bottom → horizontal bar ──────── */
/*
 * Starts at top:0 of ul = bottom edge of parent .oc-node.
 * Height matches ul's padding-top → reaches horizontal bar level exactly.
 */
.oc-tree li > ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 32px; /* must equal li > ul { padding-top } */
    background: var(--oc-line-color, #94a3b8);
}

/* ── Children: padding-top creates space for bar→child line ── */
.oc-tree li > ul > li {
    padding-top: 32px;
}

/* ── Connector: horizontal bar → child node ─────────────── */
/*
 * top:0 of li = horizontal bar level (ul::before ends here).
 * height: 32px fills the padding-top gap down to the .oc-node.
 */
.oc-tree li > ul > li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 32px; /* must equal li > ul > li { padding-top } */
    background: var(--oc-line-color, #94a3b8);
}

/* ── Horizontal bar: connects sibling nodes ─────────────── */
/*
 * top:0 of li = same y-level as ul::before bottom = horizontal bar.
 * Full width for middle siblings; trimmed at 50% for first and last.
 */
.oc-tree li > ul > li:not(:only-child)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--oc-line-color, #94a3b8);
}

/* First child: starts from own center, extends right */
.oc-tree li > ul > li:first-child:not(:only-child)::after {
    left: 50%;
    width: 50%;
}

/* Last child: starts from left edge, ends at own center */
.oc-tree li > ul > li:last-child:not(:only-child)::after {
    left: 0;
    right: auto;
    width: 50%;
}

/* ── Node ─────────────────────────────────────────────────── */
.oc-node {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 160px;
    max-width: 240px;
    cursor: default;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--nc, #1a6b8a);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);

    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.2s ease;
    will-change: transform;
}

.oc-node:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Pozisyon / Unvan — renkli üst bant */
.oc-node-title {
    background: var(--nc, #1a6b8a);
    color: var(--tc, #fff);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Kişi / Birim adı — beyaz alt bant */
.oc-node-subtitle {
    background: #ffffff;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}


/* ── Admin tree panel ─────────────────────────────────────── */
.oc-admin-node {
    margin-bottom: 4px;
}

.oc-admin-node-inner {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #f1f1f4;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.oc-admin-node-inner:hover {
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transform: translateX(2px);
}

.oc-admin-node-line {
    display: inline-block;
    width: 12px;
    height: 2px;
    background: #d1d5db;
    margin-right: 6px;
    flex-shrink: 0;
}

.oc-admin-node-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.oc-admin-node-label {
    font-size: 13px;
    color: #374151;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oc-admin-node-en {
    font-size: 11px;
    color: #9ca3af;
}

.oc-admin-node-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.btn-xs {
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
}

.btn-xs i {
    font-size: 10px;
}
