:root {
    --bg: #04151d;
    --sidebar: #03131b;
    --panel: #061b24;
    --panel2: #08232d;
    --border: #13434a;
    --text: #f3f7f8;
    --muted: #8ca1aa;
    --accent: #4be0bf;
    --accent2: #19b995;
    --danger: #ff5d6c;
    --warning: #e4b252;
    --blue: #78a7ff;
    --purple: #d67bdf;
    --device: #62d7e7;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.tg-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
}

.tg-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 40px 22px 28px;
    border-right: 1px solid var(--border);
    background:
        linear-gradient(
            180deg,
            #03151d,
            #021018
        );
    display: flex;
    flex-direction: column;
}

.tg-brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.tg-logo {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    border: 1px solid #1b806f;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 22px;
    font-weight: 800;
    background: #0b3a36;
}

.tg-brand strong {
    display: block;
    font-size: 20px;
}

.tg-brand span {
    color: var(--muted);
    font-size: 13px;
}

.tg-workspace-label {
    margin: 44px 12px 18px;
    color: #66818c;
    font-size: 11px;
    letter-spacing: .18em;
    font-weight: 800;
}

.tg-nav {
    display: grid;
    gap: 8px;
}

.tg-nav-item {
    min-height: 54px;
    padding: 0 17px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #9eb0b7;
    text-decoration: none;
    font-weight: 650;
}

.tg-nav-item.active {
    background: #104b45;
    color: var(--accent);
    border: 1px solid #167665;
}

.tg-nav-item.disabled {
    cursor: default;
}

.tg-sidebar-health {
    margin-top: auto;
    padding: 17px;
    border-radius: 14px;
    border: 1px solid var(--border);
    display: grid;
    gap: 7px;
}

.tg-health-row {
    color: #829ba4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
}

.tg-health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    background: var(--warning);
}

.tg-health-dot.available {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.tg-health-dot.unavailable {
    background: var(--danger);
}

.tg-sidebar-health strong {
    font-size: 15px;
}

.tg-sidebar-health > span {
    color: var(--muted);
    font-size: 12px;
}

.tg-main {
    min-width: 0;
    padding: 38px 40px 42px;
}

.tg-header {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.tg-eyebrow,
.tg-panel-label {
    color: var(--accent);
    letter-spacing: .16em;
    font-size: 10px;
    font-weight: 850;
}

.tg-header h1 {
    margin: 7px 0 7px;
    font-size: 34px;
}

.tg-header p {
    max-width: 750px;
    margin: 0;
    color: var(--muted);
}

.tg-header-actions {
    display: flex;
    gap: 10px;
}

.tg-secondary-button,
.tg-zoom-controls button {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    border-radius: 10px;
    min-height: 40px;
    padding: 0 14px;
}

.tg-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 17px;
}

.tg-metric {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    padding: 18px;
}

.tg-metric span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    margin-bottom: 8px;
}

.tg-metric strong {
    font-size: 22px;
}

.tg-controls {
    display: grid;
    grid-template-columns:
        minmax(280px, 1fr)
        minmax(280px, 1.3fr)
        160px
        150px;
    gap: 13px;
    align-items: end;
    padding: 18px;
    margin-bottom: 17px;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 15px;
}

.tg-control {
    display: grid;
    gap: 7px;
}

.tg-control label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 750;
}

.tg-control input,
.tg-control select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #04171f;
    color: var(--text);
    padding: 0 13px;
    outline: none;
}

.tg-control input:focus,
.tg-control select:focus {
    border-color: var(--accent2);
}

.tg-load-button {
    height: 44px;
    border: 1px solid #269b85;
    border-radius: 10px;
    background: #155a4f;
    color: var(--accent);
    font-weight: 800;
}

.tg-load-button:disabled {
    opacity: .55;
    cursor: wait;
}

.tg-message {
    margin-bottom: 17px;
    padding: 13px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
}

.tg-message.error {
    border-color: #743944;
    color: #ff929d;
}

.tg-workspace {
    display: grid;
    grid-template-columns:
        minmax(250px, .8fr)
        minmax(520px, 1.7fr)
        minmax(280px, .95fr);
    gap: 14px;
    min-height: 670px;
}

.tg-panel {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 16px;
    overflow: hidden;
}

.tg-panel-header {
    min-height: 78px;
    padding: 18px 19px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tg-panel-header h2 {
    font-size: 17px;
    margin: 6px 0 0;
}

.tg-counter {
    min-width: 35px;
    min-height: 35px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--muted);
}

.tg-entity-list {
    height: 590px;
    overflow: auto;
    padding: 12px;
}

.tg-entity-item {
    width: 100%;
    text-align: left;
    padding: 13px;
    margin-bottom: 8px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: #061821;
    color: var(--text);
}

.tg-entity-item:hover,
.tg-entity-item.active {
    border-color: #278674;
    background: #0a302e;
}

.tg-entity-top {
    display: flex;
    justify-content: space-between;
    gap: 9px;
}

.tg-entity-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tg-entity-meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

.tg-risk {
    flex: none;
    font-size: 10px;
    font-weight: 850;
    padding: 4px 7px;
    border-radius: 20px;
}

.tg-risk.high {
    color: #ff9aa3;
    background: #522029;
}

.tg-risk.medium {
    color: #f2c875;
    background: #43351c;
}

.tg-risk.low {
    color: #79e5cb;
    background: #123b34;
}

.tg-zoom-controls {
    display: flex;
    gap: 6px;
}

.tg-zoom-controls button {
    padding: 0;
    min-width: 39px;
}

.tg-viewport {
    position: relative;
    height: 590px;
    background-color: #041820;
    background-image:
        linear-gradient(
            rgba(43, 98, 107, .13) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(43, 98, 107, .13) 1px,
            transparent 1px
        );
    background-size: 50px 50px;
    overflow: hidden;
}

#tg-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tg-graph-empty {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    pointer-events: none;
    color: var(--muted);
    text-align: center;
}

.tg-graph-empty strong {
    color: var(--text);
    font-size: 19px;
    margin: 8px 0 4px;
}

.tg-empty-icon {
    font-size: 36px;
    color: var(--accent);
}

.tg-edge {
    stroke: #315765;
    stroke-width: 2;
    opacity: .72;
}

.tg-edge.suspicious {
    stroke: var(--danger);
    stroke-width: 2.5;
}

.tg-node {
    cursor: pointer;
}

.tg-node circle {
    stroke: #d7fff6;
    stroke-width: 2;
}

.tg-node text {
    fill: #dce8eb;
    font-size: 12px;
    text-anchor: middle;
    pointer-events: none;
}

.tg-node.selected circle {
    stroke: #fff;
    stroke-width: 4;
}

.tg-legend {
    height: 52px;
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 0 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
}

.tg-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tg-legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.tg-legend .company {
    background: var(--accent);
}

.tg-legend .supplier {
    background: var(--blue);
}

.tg-legend .account {
    background: var(--purple);
}

.tg-legend .payment {
    background: var(--warning);
}

.tg-legend .device {
    background: var(--device);
}

.tg-legend .risk {
    background: var(--danger);
}

.tg-inspector {
    padding: 18px;
    height: 590px;
    overflow: auto;
}

.tg-panel-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    padding: 30px;
}

.tg-inspector-title {
    margin: 0 0 4px;
    font-size: 20px;
    overflow-wrap: anywhere;
}

.tg-inspector-type {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.tg-inspector-grid {
    margin-top: 20px;
    display: grid;
    gap: 10px;
}

.tg-inspector-field {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px;
}

.tg-inspector-field span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-bottom: 4px;
}

.tg-inspector-field strong,
.tg-inspector-field code {
    overflow-wrap: anywhere;
}

.tg-inspector-field code {
    color: #c8dade;
    font-size: 11px;
}

@media (max-width: 1250px) {

    .tg-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .tg-workspace {
        grid-template-columns: 260px minmax(450px, 1fr);
    }

    .tg-inspector-panel {
        grid-column: 1 / -1;
    }

}

@media (max-width: 900px) {

    .tg-shell {
        display: block;
    }

    .tg-sidebar {
        position: relative;
        height: auto;
    }

    .tg-metrics,
    .tg-controls,
    .tg-workspace {
        grid-template-columns: 1fr;
    }

    .tg-main {
        padding: 20px;
    }

}

/* FREQUENCELAB LIVE FRAUD GRAPH START */

#fl-live-graph-stage {
    position: relative;
    width: 100%;
    min-height: 520px;
    margin-top: 12px;
    overflow: hidden;
    border-top: 1px solid rgba(80, 220, 190, .10);
    background:
        linear-gradient(rgba(63, 176, 167, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(63, 176, 167, .055) 1px, transparent 1px);
    background-size: 62px 62px;
}

.fl-network-svg {
    width: 100%;
    height: 540px;
    display: block;
    overflow: visible;
    cursor: grab;
}

.fl-network-svg:active {
    cursor: grabbing;
}

.fl-edge {
    stroke: rgba(138, 164, 176, .55);
    stroke-width: 1.6;
    transition: .18s ease;
}

.fl-edge.risk-high {
    stroke: rgba(255, 86, 102, .92);
    stroke-width: 2.4;
}

.fl-edge.risk-medium {
    stroke: rgba(255, 184, 74, .76);
}

.fl-edge-group {
    cursor: pointer;
}

.fl-edge-group:hover .fl-edge {
    stroke-width: 3.2;
    filter: drop-shadow(0 0 5px rgba(72, 231, 197, .35));
}

.fl-edge-label {
    fill: rgba(202, 220, 226, .72);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .045em;
    paint-order: stroke;
    stroke: #061b21;
    stroke-width: 4px;
    stroke-linejoin: round;
}

#fl-arrow path {
    fill: rgba(130, 175, 182, .8);
}

.fl-node {
    cursor: pointer;
}

.fl-node-halo {
    fill: transparent;
    stroke: rgba(67, 226, 193, .15);
    stroke-width: 7;
    transition: .18s ease;
}

.fl-node-circle {
    fill: #173847;
    stroke: #7f9db3;
    stroke-width: 2;
    transition: .18s ease;
}

.fl-node.risk-high .fl-node-circle {
    fill: #54232a;
    stroke: #ff6574;
}

.fl-node.risk-medium .fl-node-circle {
    fill: #493821;
    stroke: #e7b55c;
}

.fl-node.risk-low .fl-node-circle {
    fill: #123c36;
    stroke: #42d4b1;
}

.fl-node.risk-high .fl-node-halo {
    stroke: rgba(255, 88, 105, .18);
}

.fl-node.selected .fl-node-halo,
.fl-node:hover .fl-node-halo {
    stroke: rgba(72, 231, 197, .42);
    stroke-width: 11;
}

.fl-node.selected .fl-node-circle {
    stroke: #53efd0;
    stroke-width: 3.4;
    filter: drop-shadow(0 0 8px rgba(72, 231, 197, .45));
}

.fl-node-risk {
    fill: #ffffff;
    font-size: 10px;
    font-weight: 900;
}

.fl-node-type {
    fill: #55e2c2;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .08em;
}

.fl-node-label {
    fill: rgba(232, 242, 245, .88);
    font-size: 9px;
    font-weight: 600;
}

.fl-live-status {
    margin: 18px 0;
    padding: 15px 18px;
    border: 1px solid rgba(66, 211, 181, .25);
    border-radius: 12px;
    background: rgba(7, 31, 38, .72);
    color: rgba(215, 231, 235, .82);
    font-size: 14px;
}

.fl-live-status.success {
    border-color: rgba(67, 218, 177, .48);
    color: #6de4c6;
}

.fl-live-status.loading {
    border-color: rgba(83, 155, 224, .40);
}

.fl-live-status.error {
    border-color: rgba(255, 91, 108, .55);
    color: #ff7887;
}

#fl-live-entity-list {
    padding: 14px;
    max-height: 570px;
    overflow-y: auto;
}

.fl-entity-card {
    width: 100%;
    display: block;
    margin: 0 0 10px;
    padding: 13px 14px;
    text-align: left;
    color: #dfecee;
    background: rgba(9, 39, 44, .72);
    border: 1px solid rgba(85, 191, 173, .22);
    border-radius: 12px;
    cursor: pointer;
    transition: .18s ease;
}

.fl-entity-card:hover {
    transform: translateY(-1px);
    border-color: rgba(72, 231, 197, .58);
    background: rgba(11, 56, 55, .85);
}

.fl-entity-card.risk-high {
    border-left: 3px solid #ff6474;
}

.fl-entity-card.risk-medium {
    border-left: 3px solid #e4b357;
}

.fl-entity-card.risk-low {
    border-left: 3px solid #47d8b4;
}

.fl-entity-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    justify-content: space-between;
}

.fl-entity-top strong {
    font-size: 13px;
    line-height: 1.25;
}

.fl-risk-chip {
    min-width: 34px;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    background: rgba(71, 214, 180, .13);
}

.fl-entity-type {
    margin-top: 8px;
    color: #54ddbd;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

.fl-entity-id {
    margin-top: 4px;
    color: rgba(185, 205, 210, .63);
    font-size: 10px;
    word-break: break-all;
}

.fl-entity-connections {
    margin-top: 8px;
    color: rgba(221, 234, 237, .65);
    font-size: 10px;
}

#fl-live-inspector {
    padding: 18px;
}

.fl-inspector-eyebrow {
    color: #50dfbe;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
}

#fl-live-inspector h3 {
    margin: 5px 0 18px;
    color: #f3f7f8;
    font-size: 20px;
    line-height: 1.2;
}

.fl-inspector-field {
    margin-bottom: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(76, 177, 169, .19);
    border-radius: 10px;
    background: rgba(8, 35, 41, .55);
}

.fl-inspector-field span {
    display: block;
    margin-bottom: 5px;
    color: rgba(181, 201, 205, .67);
    font-size: 10px;
}

.fl-inspector-field strong {
    display: block;
    color: #eaf3f4;
    font-size: 12px;
    word-break: break-word;
}

.fl-inspector-section-title {
    margin: 20px 0 10px;
    color: #50dfbe;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.fl-relation-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(84, 164, 160, .12);
    font-size: 10px;
}

.fl-relation-row span {
    color: #57d9bb;
}

.fl-relation-row strong {
    color: rgba(231, 240, 242, .78);
    text-align: right;
}

.fl-graph-empty,
.fl-entity-empty {
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    padding: 25px;
    text-align: center;
    color: rgba(193, 210, 214, .62);
}

/* FREQUENCELAB LIVE FRAUD GRAPH END */
