html {
    font-size: 15px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* ── Focus ring — indigo accent ─────────────────────────────── */
.btn:focus-visible,
.btn:active:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--ib-accent-rgb), 0.25);
    outline: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ib-accent);
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ib-font-ui, 'Inter', system-ui, sans-serif);
    letter-spacing: -0.02em;
    font-weight: 700;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    transition: background-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
                border-color    0.18s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow      0.18s cubic-bezier(0.4, 0, 0.2, 1),
                transform       0.14s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Only lift semantic action buttons — not icon/circle/ghost ones */
.btn:not(:disabled):not(.disabled):not(.btn-light):not(.rounded-circle):not(.btn-close):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.btn:not(:disabled):not(.disabled):active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-sm {
    border-radius: 5px;
    font-size: 0.8rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
:root {
    --bs-card-border-radius: 10px;
    --bs-card-inner-border-radius: 9px;
}

.card {
    border-radius: var(--bs-card-border-radius);
}

.card-header:first-child {
    border-radius: calc(var(--bs-card-border-radius) - 1px) calc(var(--bs-card-border-radius) - 1px) 0 0;
}

.card-footer:last-child {
    border-radius: 0 0 calc(var(--bs-card-border-radius) - 1px) calc(var(--bs-card-border-radius) - 1px);
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table > :not(caption) > * > * {
    vertical-align: middle;
}

/* ── Pagination ─────────────────────────────────────────────── */
.page-link {
    font-size: 0.82rem;
    font-weight: 500;
}

/*------------------------------------------------------------- */
/* / Universe Detail By ID Start
/*------------------------------------------------------------- */


/* Tree Interaction */
.tree-hover {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

    .tree-hover:hover {
        background-color: rgba(0,0,0,0.03);
    }

/* Rotation animation for arrows */
[aria-expanded="true"] .transition-icon {
    transform: rotate(90deg);
}

.transition-icon {
    transition: transform 0.2s ease;
}

/* Custom badges */
.badge.bg-light {
    background-color: var(--ds-n50, #F8FAFC) !important;
}

/* Prevent text overflow in deep trees */
.tree-item {
    white-space: nowrap;
}

/*------------------------------------------------------------- */
/* / Universe Detail By ID End
/*------------------------------------------------------------- */
/*------------------------------------------------------------- */ 
/*File Upload CSS start*/
/*------------------------------------------------------------- */
 
.drop-zone {
    position: relative;
    border: 2px dashed #9aa4b2;
    border-radius: 12px;
    min-height: 180px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease-in-out;
}

    .drop-zone.dragover {
        background: #e0f2fe;
        border-color: var(--ds-info, #0EA5E9);
    }

.drop-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-content {
    text-align: center;
    color: #334155;
}

.file-name {
    margin-top: 8px;
    color: #0f172a;
    font-weight: 600;
}

.compare-table td, .compare-table th {
    vertical-align: middle;
    white-space: nowrap;
}

.cell-added {
    background-color: #d1fae5;
}

.cell-removed {
    background-color: #fee2e2;
}

.cell-diff-left {
    background-color: #fef3c7;
}

.cell-diff-right {
    background-color: #fdba74;
}

/*------------------------------------------------------------- */
/*File Upload CSS End*/
/*------------------------------------------------------------- */

/* ── User avatars ───────────────────────────────────────────── */
.ib-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ib-accent-bg, rgba(var(--ib-accent-rgb),.15));
    color: var(--ib-accent);
    font-family: var(--ib-font-ui, sans-serif);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .03em;
    border: 2px solid rgba(var(--ib-accent-rgb),.2);
}

.ib-list-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ib-accent-bg, rgba(var(--ib-accent-rgb),.15));
    color: var(--ib-accent);
    font-family: var(--ib-font-ui, sans-serif);
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .03em;
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD COMPONENTS
   ══════════════════════════════════════════════════════════ */

/* ── Dashboard header ──────────────────────────────────────
   Greeting and the live SAP-environment status cluster (env badge, PROD/TEST
   toggle, last-refreshed, Refresh) share one row and wrap independently on a
   narrow viewport — replaces the old stacked greeting block + full-width
   .ds-toolbar status bar, which together ate ~130px above the fold. */
.ib-dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
}

.ib-dash-head-intro { min-width: 0; }

.ib-dash-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.ib-dash-divider {
    height: 1px;
    background: var(--ds-n200, #E2E8F0);
    margin: 18px 0 22px;
}

.ib-dash-greeting {
    font-family: var(--ib-font-display);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ds-n900, #0F172A);
    letter-spacing: -0.03em;
    margin: 0 0 4px;
}

.ib-dash-sub {
    font-size: 0.875rem;
    color: var(--ds-n500, #64748B);
    margin: 0;
}

/* ── Dashboard panels (Quick actions / About / Administration) ────────
   Shared card chrome + heading styles — previously repeated verbatim as
   inline style="" on every panel, which meant the box-shadow, radius, and
   heading typography could silently drift between panels on edit. */
.ib-dash-card {
    background: var(--ds-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 0 0 1px var(--ds-n200, #E2E8F0);
    transition: box-shadow 0.2s ease;
}

/* Lift on hover signals every dashboard card is foldable, without a transform (which
   would jitter the fold-toggle hit target mid-click). */
.ib-dash-card:hover {
    box-shadow: 0 0 0 1px var(--ds-n200, #E2E8F0), 0 8px 24px -8px rgba(15, 23, 42, 0.12);
}

.ib-dash-card-title {
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ib-dash-card-sub {
    font-size: 0.8rem;
}

.ib-icon-accent {
    color: var(--ib-accent);
}

/* Colored icon chip in every dashboard card header — same --c/--cb custom-property
   pattern as .ib-nav-card-icon, reusing the app's existing per-module icon palette
   (--ib-icon-reports/-schedules/-folders/-users) so a card's module is identifiable at
   a glance instead of every header icon reading as the same flat accent color. */
.ib-card-icon-chip {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--cb);
    color: var(--c);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Sizes the 4 Dashboard KPI cards off the row's own available width instead
   of Bootstrap's col-lg-3, which keys off the viewport width — a mismatch
   here because the fixed-width sidebar (--ib-sidebar-w) permanently eats
   into that space, so a viewport just over the lg breakpoint doesn't
   actually leave 4 cards room to breathe. Flexbox rather than CSS grid on
   purpose: grid's auto-fit shares column tracks across every row, so a
   lone card wrapping onto its own row (e.g. Users & Sessions when only 3
   fit above it) would sit in column 1 and leave the other columns on that
   row visibly empty. Flex computes each wrapped line's own free space, so
   a lone trailing card instead grows to fill its whole line — no dangling
   whitespace. 240px is the narrowest a card can get before its donut +
   badges start crowding — anything tighter wraps to the next line instead. */
.ib-kpi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.ib-kpi-grid > div {
    flex: 1 1 240px;
}

/* ── Dashboard KPI visuals (donut charts + large stat typography) ──────
   The donut is a single conic-gradient background — built dynamically in
   Home/Index.cshtml's script from real, already-fetched counts (never
   hardcoded), so it needs no charting library. The center hole re-uses
   --ds-surface so it matches the card background in both themes. Every
   KPI card's hole always shows a short percentage (never a raw count,
   which can run to 4+ digits and overflow the 60px hole) — the matching
   raw total sits in .ib-kpi-value next to the donut instead. */
.ib-kpi-value {
    font-size: 2.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.ib-donut {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: conic-gradient(var(--ds-n200, #E2E8F0) 0 100%);
    transition: background 0.5s ease;
}

.ib-donut-hole {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ds-surface, #fff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ib-donut-hole-value {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.ib-donut-hole-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--ds-n500);
    margin-top: 2px;
}

/* ── KPI card — one shared anatomy across all four ─────────────────────
   chip + label header, then a value + donut row, then a wrap of status
   badges. Users & Sessions used to be a 2x2 tile grid; it now carries a
   donut (share of users currently active) like its siblings so the row
   reads as one set. */
.ib-kpi-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ds-n600, #475569);
}

.ib-kpi-card .ib-card-icon-chip {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
}

.ib-kpi-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ib-kpi-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

/* ── Node Health proportion bar ─────────────────────────────────────── */
.ib-node-health-bar { margin-bottom: 14px; }

.ib-health-track {
    display: flex;
    height: 8px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--ds-n100, #F1F5F9);
}

.ib-health-track > span { height: 100%; }

.ib-health-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 9px;
    font-size: 0.75rem;
    color: var(--ds-n600, #475569);
}

.ib-health-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ib-health-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Long node lists scroll inside the card rather than stretching the whole
   left column; the header row stays pinned. */
.ib-node-health-table {
    max-height: 480px;
    overflow-y: auto;
}

.ib-node-health-table thead th {
    position: sticky;
    top: 0;
    background: var(--ds-surface, #fff);
    z-index: 1;
}

/* ── Nav cards (top row) ───────────────────────────────── */
.ib-nav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background: var(--ds-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 0 0 1px var(--ds-n200, #E2E8F0);
    color: var(--ds-n900, #0F172A);
    transition: box-shadow 0.15s ease, transform 0.12s ease;
    height: 100%;
}

.ib-nav-card:hover {
    box-shadow: 0 4px 14px rgba(15,23,42,.08), 0 0 0 1px var(--ds-n300, #CBD5E1);
    transform: translateY(-2px);
    color: var(--ds-n900, #0F172A);
}

.ib-nav-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--cb);
    color: var(--c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ib-nav-card-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ds-n900, #0F172A);
    line-height: 1.3;
}

/* Was #94A3B8 — 2.6:1 on white, below WCAG AA for 12px text. Swapped to the
   --ds-n500 muted-text token already used for this exact purpose elsewhere
   (.ib-dash-sub, .ds-empty-sub), which measures ~4.8:1. */
.ib-nav-card-hint {
    font-size: 0.75rem;
    color: var(--ds-n500, #64748B);
    line-height: 1.3;
}

.ib-nav-card-arrow {
    color: var(--ds-n300, #CBD5E1);
    font-size: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Quick action rows ─────────────────────────────────── */
.ib-quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--ds-n50, #F8FAFC);
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid var(--ds-n200, #E2E8F0);
    color: var(--ds-n900, #0F172A);
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.ib-quick-action:hover {
    background: var(--ds-n100, #F1F5F9);
    border-color: var(--ds-n300, #CBD5E1);
    text-decoration: none;
    transform: translateX(2px);
    color: var(--ds-n900, #0F172A);
}

.ib-quick-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--cb);
    color: var(--c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ib-quick-action-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ds-n900, #0F172A);
    line-height: 1.3;
}

/* Was #94A3B8 — same 2.6:1 AA failure as .ib-nav-card-hint above, same fix. */
.ib-quick-action-sub {
    font-size: 0.75rem;
    color: var(--ds-n500, #64748B);
    line-height: 1.3;
}

/* ── About pills ───────────────────────────────────────── */
.ib-about-pill {
    font-size: 0.8rem;
    color: var(--ds-n600, #475569);
    padding: 6px 10px;
    background: var(--ds-n50, #F8FAFC);
    border-radius: 6px;
    border: 1px solid var(--ds-n100, #F1F5F9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
