/* ==========================================================================
   My Apps  (03 · Inner pages / screens/my-apps.jsx)

   Loaded after dashboard.css + inner-pages.css, so the .vd-dash token block
   and shared .vd-btn / .vd-card rules are already in scope.

   Family colour coding follows the comp: FHIR reads as blueberry, Unity as
   plum, so the list isn't a wall of navy.
   ========================================================================== */

.vd-fam--FHIR  { --fam: #6282C1; --fam-soft: rgba(98, 130, 193, .14); }
.vd-fam--Unity { --fam: #7A3578; --fam-soft: rgba(122, 53, 120, .13); }

/* ---------- Page header ---------- */

.vd-pagehead {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 24px 32px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.vd-pagehead-main { flex: 1 1 auto; min-width: 0; }

.vd-pagehead-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--indigo);
    margin-bottom: 6px;
}

.vd-pagehead h1 {
    font-size: 26px;
    line-height: 36px;
    font-weight: 600;
    letter-spacing: -.3px;
    color: var(--blackberry);
    margin: 0;
}

/* Used when a page passes PageHeadViewModel.TitleTrailingHtml (e.g. a tier
   badge on APIReference/Details) to sit inline next to the title instead of
   below it. */
.vd-pagehead-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.vd-pagehead p { font-size: 13px; color: #3D3654; margin: 6px 0 0; max-width: 640px; }
.vd-pagehead-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Buttons ---------- */

.vd-page .vd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.vd-page .vd-btn--sm { font-size: 12px; padding: 7px 13px; }
.vd-page .vd-btn--dark { background: var(--blackberry); color: #fff; }
.vd-page .vd-btn--dark:hover { background: #3D2F6B; color: #fff; text-decoration: none; }
.vd-page .vd-btn--plum { background: var(--plum); color: #fff; }
.vd-page .vd-btn--plum:hover { background: #6A2D69; color: #fff; text-decoration: none; }
.vd-page .vd-btn--outline { background: #fff; color: var(--plum); border-color: var(--line); }
.vd-page .vd-btn--outline:hover { border-color: var(--plum); text-decoration: none; }
/* VCO-1294: My Apps "Edit" button - Veradigm Gold so it stands out on the
   app header. Dark text: white on #FAB554 fails contrast. */
.vd-page .vd-btn--gold { background: #FAB554; color: var(--blackberry); }
.vd-page .vd-btn--gold:hover { background: #F0A43A; color: var(--blackberry); text-decoration: none; }
.vd-page .vd-btn--link { background: none; border: 0; color: var(--plum); padding: 0; font-size: 12px; }
.vd-page .vd-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Empty state ---------- */

.vd-apps-empty { padding: 64px 32px; text-align: center; }
.vd-apps-empty h2 { font-size: 20px; color: var(--blackberry); margin: 0 0 6px; }
.vd-apps-empty p { font-size: 13.5px; color: #3D3654; margin: 0 0 20px; }

/* ---------- Master / detail ---------- */

.vd-apps-split { display: grid; grid-template-columns: 384px minmax(0, 1fr); align-items: start; }

.vd-apps-list {
    border-right: 1px solid var(--line);
    background: #FAF9FD;
    padding: 14px;
    position: sticky;
    top: 56px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}

.vd-apps-filters { display: flex; gap: 4px; padding: 2px 2px 14px; }

.vd-apps-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 99px;
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #3D3654;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.vd-apps-filter:hover { background: #F1EEF7; }

.vd-apps-filter.is-on {
    background: #fff;
    color: var(--blackberry);
    border-color: #E2DEEC;
    box-shadow: 0 1px 3px rgba(29, 23, 60, .08);
}

.vd-apps-filter span {
    font-size: 11px;
    font-weight: 700;
    color: #3D3654;
    background: #F1EEF7;
    border-radius: 99px;
    padding: 0 7px;
}

.vd-apps-filter.is-on span { background: var(--primary-light); color: var(--blackberry); }

.vd-apps-tiles { display: flex; flex-direction: column; gap: 8px; }

.vd-apps-tile {
    display: flex;
    gap: 13px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.vd-apps-tile:hover {
    background: #fff;
    box-shadow: 0 6px 18px -10px rgba(29, 23, 60, .28);
    text-decoration: none;
}

.vd-apps-tile.is-sel {
    background: #fff;
    border-color: var(--blackberry);
    box-shadow: 0 8px 22px -12px rgba(29, 23, 60, .34);
}

.vd-apps-glyph {
    width: 46px; height: 46px;
    border-radius: 13px;
    background: var(--fam, var(--grape));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 6px 14px -6px rgba(29, 23, 60, .45);
}

.vd-apps-body { flex: 1 1 auto; min-width: 0; }

.vd-apps-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--blackberry);
    letter-spacing: -.2px;
    margin-bottom: 5px;
}

.vd-apps-cert { width: 13px; height: 13px; color: #3E9E62; flex: 0 0 13px; }

.vd-apps-meta { display: flex; gap: 6px; }

.vd-fam-pill {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 99px;
    background: var(--fam-soft, #EEE);
    color: var(--fam, var(--ink));
}

.vd-status-pill {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 99px;
}

.vd-status-pill.is-prod { background: #3E9E62; color: #fff; }
.vd-status-pill.is-test { background: #FCF9EC; color: #8A6100; border: 1px solid #F59D11; }

/* ---------- Detail pane ---------- */

.vd-apps-detail {
    background: #FAF9FD;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.vd-card {
    background: #fff;
    border: 1px solid #ECE9F2;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(29, 23, 60, .04), 0 14px 36px -22px rgba(29, 23, 60, .28);
    overflow: hidden;
}

.vd-card-head {
    padding: 16px 22px;
    border-bottom: 1px solid #F3F0F8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vd-card-head-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 700;
    color: var(--blackberry);
}

.vd-card-ico {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--fam-soft, #F1EEF7);
    color: var(--fam, var(--blackberry));
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.vd-card-ico svg { width: 14px; height: 14px; }
.vd-card-pad { padding: 18px 22px; }

.vd-muted-note { font-size: 12.5px; color: #3D3654; line-height: 1.6; margin: 0; }
.vd-muted-note a { color: var(--plum); font-weight: 600; }
.vd-muted { color: #4A4460; }
.vd-right { text-align: right; }
.vd-mono { font-family: var(--mono, ui-monospace, 'SF Mono', Menlo, monospace); }

/* certification strip */

.vd-cert-strip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: linear-gradient(120deg, #FCF9EC, #fff);
    border-color: #F2DE7A;
}

.vd-cert-ico {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: #FCF9EC;
    color: #8A6100;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.vd-cert-ico svg { width: 20px; height: 20px; }
.vd-cert-strip > div { flex: 1 1 auto; min-width: 0; }
.vd-cert-title { font-size: 13.5px; font-weight: 700; color: var(--blackberry); }
.vd-cert-sub { font-size: 12px; color: #3D3654; margin-top: 2px; }

/* app header */

.vd-app-head { border-top: 3px solid var(--fam, var(--grape)); padding: 24px; }
.vd-app-head-row { display: flex; align-items: flex-start; gap: 18px; }

.vd-app-glyph-lg {
    width: 60px; height: 60px;
    border-radius: 15px;
    background: var(--fam, var(--grape));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 10px 22px -8px rgba(29, 23, 60, .5);
}

.vd-app-head-main { flex: 1 1 auto; min-width: 0; }
.vd-app-title { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; flex-wrap: wrap; }
.vd-app-title h2 { font-size: 22px; font-weight: 700; color: var(--blackberry); margin: 0; letter-spacing: -.5px; }
.vd-app-sub { font-size: 12.5px; color: #3D3654; }

/* ---------- Credentials (layout only, nothing connected) ---------- */

.vd-creds { display: flex; flex-direction: column; gap: 15px; }

.vd-creds-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    background: rgba(122, 53, 120, .05);
    border: 1px solid rgba(122, 53, 120, .3);
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ink);
}

.vd-creds-notice svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--plum); margin-top: 1px; }
.vd-creds-notice a { color: var(--plum); font-weight: 600; }

.vd-kv {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding-bottom: 9px;
    border-bottom: 1px dashed var(--line);
}

.vd-kv-key {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #3D3654;
}

.vd-kv-val { font-size: 12px; color: var(--ink); word-break: break-all; }

.vd-creds-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #3D3654;
    margin-bottom: 6px;
}

.vd-creds-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vd-creds-show { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #3D3654; }
.vd-creds-row { display: flex; gap: 6px; }

.vd-creds-row input {
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
    padding: 0 12px;
    font-size: 11.5px;
    color: var(--ink);
    background: #FBF8FC;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.vd-creds-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.vd-creds-table table { width: 100%; border-collapse: collapse; font-size: 12px; }

.vd-creds-table th {
    text-align: left;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 700;
    color: #3D3654;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: #FBF8FC;
}

.vd-creds-table td { padding: 11px 14px; color: var(--ink); border-top: 1px solid var(--line); }
.vd-creds-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Lifecycle + help ---------- */

.vd-app-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.vd-help {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    box-shadow: none;
    background: linear-gradient(160deg, #FBFAFE, #F6F3FC);
}

.vd-help > div { flex: 1 1 auto; min-width: 0; }

.vd-help-ico {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: rgba(64, 60, 126, .12);
    color: var(--indigo);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.vd-help-ico svg { width: 19px; height: 19px; }
.vd-help-title { font-size: 13.5px; font-weight: 700; color: var(--blackberry); }
.vd-help-sub { font-size: 12px; color: #3D3654; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
    .vd-apps-split { grid-template-columns: 1fr; }
    .vd-apps-list { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
    .vd-apps-detail { padding: 20px; }
    .vd-pagehead { flex-direction: column; }
}

.vd-apps-warn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 32px 0;
    padding: 11px 14px;
    border-radius: 10px;
    background: #FCF9EC;
    border: 1px solid #F59D11;
    font-size: 12.5px;
    line-height: 1.5;
    color: #7A5600;
}

.vd-apps-warn svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }

/* ---------- API Usage empty state ---------- */

.vd-usage-empty { padding: 40px 44px 36px; max-width: 720px; }

.vd-usage-ico {
    width: 48px; height: 48px;
    border-radius: 13px;
    background: rgba(64, 60, 126, .10);
    color: var(--indigo);
    display: grid;
    place-items: center;
    margin-bottom: 20px;
}

.vd-usage-ico svg { width: 24px; height: 24px; }

.vd-usage-empty h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--blackberry);
    margin: 0 0 10px;
}

.vd-usage-empty p { font-size: 13.5px; line-height: 1.65; color: #3D3654; margin: 0 0 16px; }

.vd-usage-list { margin: 0 0 20px; padding-left: 20px; }

.vd-usage-list li {
    font-size: 13px;
    line-height: 1.7;
    color: #4B4560;
}

.vd-usage-foot {
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
}

.vd-usage-foot a { color: var(--plum); font-weight: 600; }

/* VCO-1345: Unity app name in the credentials panel was 12px monospace -
   hard to read. Larger, regular font; the username/password values stay mono. */
.vd-creds .vd-kv-val.vd-cred-appname { font-family: inherit; font-size: 15px; font-weight: 600; color: var(--blackberry); }
