/* ══════════════════════════════════════════════
   Mass Analytica — Material 3 Tree License UI
   ══════════════════════════════════════════════ */
.malt *, .malt { font-family: "Roboto", sans-serif !important; box-sizing: border-box; }

/* Force Material Icons font even inside <code>/<pre> wrappers */
.malt .material-icons-outlined,
.malt-branch-icon .material-icons-outlined,
code .material-icons-outlined,
strong .material-icons-outlined {
    font-family: 'Material Icons Outlined' !important;
    font-style: normal !important;
    font-weight: normal !important;
    display: inline-block !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-wrap: normal !important;
    white-space: nowrap !important;
    direction: ltr !important;
    -webkit-font-feature-settings: 'liga' !important;
    -webkit-font-smoothing: antialiased !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
}

/* ── Card Surface ── */
.malt-card {
    background: #fff; border-radius: 16px; margin-bottom: 24px; overflow: hidden;
    box-shadow: 0 1px 3px 1px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.1);
    transition: box-shadow 280ms cubic-bezier(.4,0,.2,1);
}
.malt-card:hover { box-shadow: 0 2px 6px 2px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.08); }

/* ── Header ── */
.malt-header { background: #1e6f77; padding: 20px 24px; position: relative; overflow: hidden; }
.malt-header::after {
    content: ""; position: absolute; top: -60px; right: -30px; width: 160px; height: 160px;
    background: rgba(255,255,255,.05); border-radius: 50%; pointer-events: none;
}
.malt-header h2 {
    color: #fff !important; font-size: 20px !important; font-weight: 500 !important;
    margin: 0 !important; padding: 0 !important; line-height: 28px !important;
    border: none !important; background: none !important; text-transform: none !important;
    letter-spacing: .15px !important;
}

/* ── Meta Row ── */
.malt-meta {
    display: flex; flex-wrap: wrap; gap: 0;
    border-bottom: 1px solid rgba(0,0,0,.08); background: #fafafa;
}
.malt-meta-item {
    flex: 1 1 180px; padding: 14px 24px;
    border-right: 1px solid rgba(0,0,0,.06);
    display: flex; flex-direction: column; gap: 2px;
}
.malt-meta-item:last-child { border-right: none; }
.malt-meta-label {
    font-size: 11px !important; font-weight: 500 !important; text-transform: uppercase !important;
    letter-spacing: .8px !important; color: rgba(0,0,0,.45) !important; line-height: 16px !important;
}
.malt-meta-value {
    font-size: 14px !important; font-weight: 500 !important; color: rgba(0,0,0,.87) !important;
    line-height: 20px !important;
}
.malt-meta-value.malt-count {
    font-size: 22px !important; font-weight: 700 !important; color: #1e6f77 !important;
}
.malt-meta-value a.malt-dl {
    display: inline-flex !important; align-items: center !important; gap: 6px !important;
    color: #1e6f77 !important; font-weight: 500 !important; text-decoration: none !important;
    font-size: 13px !important; padding: 4px 14px 4px 10px !important; border-radius: 8px !important;
    background: rgba(30,111,119,.08) !important; transition: background 200ms cubic-bezier(.4,0,.2,1) !important;
    border: none !important;
}
.malt-meta-value a.malt-dl:hover { background: rgba(30,111,119,.14) !important; text-decoration: none !important; }
.malt-meta-value a.malt-dl .material-icons-outlined { font-size: 18px !important; }

/* ═════════════════════════════
   TREE STRUCTURE
   ═════════════════════════════ */
.malt-tree { padding: 20px 24px 24px; }
.malt-tree-title {
    font-size: 12px !important; font-weight: 500 !important; text-transform: uppercase !important;
    letter-spacing: 1px !important; color: rgba(0,0,0,.45) !important;
    margin: 0 0 16px !important; padding: 0 0 12px !important;
    border-bottom: 1px solid rgba(0,0,0,.08) !important;
    line-height: 16px !important; background: none !important; border-top: none !important;
}

/* Branch container */
.malt-branch { position: relative; padding-left: 28px; margin-bottom: 4px; }
.malt-branch:last-child { margin-bottom: 0; }

/* Vertical trunk line */
.malt-branch::before {
    content: ""; position: absolute; left: 10px; top: 0; bottom: 0;
    width: 2px; background: rgba(0,0,0,.1);
}
.malt-branch:last-child::before { bottom: 50%; }

/* Branch header row */
.malt-branch-head {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 10px 0; cursor: default;
}
/* Horizontal connector to branch head */
.malt-branch-head::before {
    content: ""; position: absolute; left: -18px; top: 50%;
    width: 16px; height: 2px; background: rgba(0,0,0,.1);
}
/* Branch icon circle */
.malt-branch-icon {
    width: 32px; height: 32px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.malt-branch-icon .material-icons-outlined { font-size: 18px !important; color: #fff; }
.malt-branch-icon.malt-ic-approved { background: #2e7d32; }
.malt-branch-icon.malt-ic-pending { background: #f57f17; }
.malt-branch-icon.malt-ic-request { background: #1565c0; }

.malt-branch-label {
    font-size: 13px !important; font-weight: 500 !important;
    text-transform: uppercase !important; letter-spacing: .5px !important;
    color: rgba(0,0,0,.6) !important;
}
.malt-branch-count {
    font-size: 11px !important; font-weight: 500 !important; color: rgba(0,0,0,.38) !important;
    background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: 10px; margin-left: auto;
}

/* Leaf items (individual licenses) */
.malt-leaves { padding-left: 0; margin: 0; }
.malt-leaf {
    position: relative; padding: 12px 16px; margin-left: 16px; margin-bottom: 2px;
    border-radius: 10px; transition: background 200ms cubic-bezier(.4,0,.2,1);
}
.malt-leaf:hover { background: rgba(0,0,0,.03); }

/* Leaf connector (L shape) */
.malt-leaf::before {
    content: ""; position: absolute; left: -22px; top: 0;
    width: 2px; height: 50%; background: rgba(0,0,0,.08);
}
.malt-leaf::after {
    content: ""; position: absolute; left: -22px; top: 50%;
    width: 20px; height: 2px; background: rgba(0,0,0,.08);
}
/* Remove top connector for first leaf */
.malt-leaf:first-child::before { top: 50%; height: 0; }
/* Extend line for middle leaves */
.malt-leaf:not(:first-child):not(:last-child)::before { height: 100%; top: 0; }
/* Last leaf: line only to midpoint */
.malt-leaf:last-child::before { height: 50%; top: 0; }
/* Single leaf: no top line */
.malt-leaf:only-child::before { display: none; }

.malt-leaf-num {
    font-size: 11px !important; font-weight: 500 !important; color: rgba(0,0,0,.4) !important;
    text-transform: uppercase !important; letter-spacing: .5px !important; margin-bottom: 6px;
}
.malt-leaf-row {
    display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px;
}
.malt-leaf-row .malt-lbl {
    font-size: 11px !important; font-weight: 500 !important; text-transform: uppercase !important;
    letter-spacing: .4px !important; color: rgba(0,0,0,.4) !important; min-width: 100px; flex-shrink: 0;
}
.malt-leaf-row .malt-val {
    font-size: 14px !important; color: rgba(0,0,0,.8) !important; font-weight: 400 !important;
}
.malt-leaf-row code {
    font-family: "Roboto Mono", monospace !important; font-size: 13px !important;
    background: rgba(0,0,0,.05) !important; padding: 3px 10px !important; border-radius: 6px !important;
    border: none !important; color: rgba(0,0,0,.87) !important; word-break: break-all !important;
    letter-spacing: .4px !important;
}

/* ── Form inside leaf ── */
.malt-leaf-form { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.malt-leaf-form label {
    font-size: 11px !important; font-weight: 500 !important; text-transform: uppercase !important;
    letter-spacing: .5px !important; color: rgba(0,0,0,.5) !important; margin: 0 !important; padding: 0 !important;
    width: 100% !important; flex-basis: 100% !important;
}
.malt-leaf-form input[type="text"] {
    flex: 1 1 0% !important; min-width: 200px !important; padding: 12px 16px !important;
    border: none !important; border-bottom: 2px solid rgba(0,0,0,.2) !important;
    border-radius: 4px 4px 0 0 !important; font-size: 14px !important;
    font-family: "Roboto Mono", monospace !important; color: rgba(0,0,0,.87) !important;
    background: rgba(0,0,0,.04) !important; height: auto !important; margin: 0 !important;
    outline: none !important; line-height: 20px !important; box-sizing: border-box !important;
    transition: border-color 200ms cubic-bezier(.4,0,.2,1), background 200ms cubic-bezier(.4,0,.2,1) !important;
}
.malt-leaf-form input[type="text"]:hover { background: rgba(0,0,0,.06) !important; }
.malt-leaf-form input[type="text"]:focus {
    border-bottom-color: #1e6f77 !important; background: rgba(0,0,0,.06) !important;
    box-shadow: none !important; outline: none !important;
}
.malt-leaf-form input[type="text"]::placeholder { color: rgba(0,0,0,.35) !important; }

.malt-leaf-form button {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    gap: 6px !important; padding: 0 24px !important; height: 40px !important; min-width: 64px !important;
    border-radius: 20px !important; border: none !important; background: #1e6f77 !important;
    color: #fff !important; font-size: 14px !important; font-weight: 500 !important;
    letter-spacing: .1px !important; cursor: pointer !important; margin: 0 !important;
    text-transform: none !important; line-height: 40px !important; flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.2) !important;
    transition: box-shadow 280ms cubic-bezier(.4,0,.2,1), background 280ms cubic-bezier(.4,0,.2,1) !important;
}
.malt-leaf-form button:hover { background: #237e87 !important; box-shadow: 0 2px 6px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.2) !important; }

/* ── Empty branch message ── */
.malt-empty {
    font-size: 13px !important; color: rgba(0,0,0,.35) !important; font-style: italic;
    padding: 8px 16px; margin-left: 16px;
}

/* ── Contact card (no_manager) ── */
.malt-card .malt-contact {
    padding: 20px 24px; font-size: 14px !important; line-height: 22px; color: rgba(0,0,0,.7) !important;
}
.malt-card .malt-contact a {
    color: #1e6f77 !important; font-weight: 500 !important; text-decoration: none !important;
}
.malt-card .malt-contact a:hover { text-decoration: underline !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .malt-meta { flex-direction: column; }
    .malt-meta-item { border-right: none !important; border-bottom: 1px solid rgba(0,0,0,.06); }
    .malt-tree { padding: 16px 20px; }
    .malt-leaf-row { flex-direction: column; gap: 2px; }
    .malt-leaf-row .malt-lbl { min-width: auto; }
    .malt-header { padding: 16px 20px; }
}
