/* MoneySuite developer portal.
 *
 * Deliberately light. The client portal carries a full PrimeFaces theme because
 * it is a product surface; this is a tool developers keep open beside an editor,
 * so it favours density, legibility and fast scanning over decoration.
 *
 * Everything is driven from the tokens below, and both light and dark are
 * defined: a developer tool that ignores the OS theme is the one thing everyone
 * notices.
 */

:root {
    --dp-bg: #f7f8fa;
    --dp-surface: #ffffff;
    --dp-border: #e2e5ea;
    --dp-text: #1c2128;
    --dp-muted: #5c6672;
    --dp-accent: #1f6feb;
    --dp-accent-soft: rgba(31, 111, 235, 0.09);
    --dp-good: #1a7f47;
    --dp-good-soft: rgba(26, 127, 71, 0.10);
    --dp-bad: #b42318;
    --dp-bad-soft: rgba(180, 35, 24, 0.10);
    --dp-warn: #9a6700;
    --dp-warn-soft: rgba(154, 103, 0, 0.10);
    --dp-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --dp-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --dp-bg: #0f1216;
        --dp-surface: #171b21;
        --dp-border: #2a313a;
        --dp-text: #e6edf3;
        --dp-muted: #9aa4b1;
        --dp-accent: #58a6ff;
        --dp-accent-soft: rgba(88, 166, 255, 0.12);
        --dp-good: #4ac07c;
        --dp-good-soft: rgba(74, 192, 124, 0.13);
        --dp-bad: #f3776a;
        --dp-bad-soft: rgba(243, 119, 106, 0.13);
        --dp-warn: #e3b341;
        --dp-warn-soft: rgba(227, 179, 65, 0.13);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--dp-bg);
    color: var(--dp-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ---------- shell ---------- */

.dp-header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--dp-surface);
    border-bottom: 1px solid var(--dp-border);
    padding: 0 24px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.dp-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    letter-spacing: -0.2px;
    font-size: 16px;
    white-space: nowrap;
}
/* Sized in em, not px: the brand is set at 16px in the header and 20px on the
   sign-in pages, and the mark keeps its proportion to the wordmark in both
   without a second rule. */
.dp-brand img {
    height: 1.7em;
    width: auto;
    display: block;
}
/* Scoped to the wordmark: the mark now sits in its own span beside it, and an
   unscoped `.dp-brand span` would paint "MoneySuite" in the accent too. */
.dp-brand-text { color: inherit; }
.dp-brand-text span { color: var(--dp-accent); }

.dp-nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }

.dp-nav a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--dp-muted);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}
.dp-nav a:hover { background: var(--dp-accent-soft); color: var(--dp-text); }
.dp-nav a.dp-active { background: var(--dp-accent-soft); color: var(--dp-accent); font-weight: 600; }

.dp-who { color: var(--dp-muted); font-size: 13px; white-space: nowrap; }

.dp-main { max-width: 1180px; margin: 0 auto; padding: 24px; }

.dp-page-title { font-size: 22px; font-weight: 700; margin: 0 0 4px 0; letter-spacing: -0.3px; }
.dp-page-sub { color: var(--dp-muted); margin: 0 0 22px 0; font-size: 14px; }

/* ---------- cards ---------- */

.dp-card {
    background: var(--dp-surface);
    border: 1px solid var(--dp-border);
    border-radius: var(--dp-radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}
.dp-card h2 { font-size: 15px; font-weight: 650; margin: 0 0 14px 0; }

.dp-grid { display: grid; gap: 16px; }
.dp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
    .dp-grid-4, .dp-grid-3, .dp-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- stats ---------- */

.dp-stat { background: var(--dp-surface); border: 1px solid var(--dp-border); border-radius: var(--dp-radius); padding: 16px 18px; }
.dp-stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dp-muted); }
.dp-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.dp-stat-note { font-size: 12px; color: var(--dp-muted); }
.dp-stat-good .dp-stat-value { color: var(--dp-good); }
.dp-stat-bad .dp-stat-value { color: var(--dp-bad); }

/* ---------- tables ---------- */

.dp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dp-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dp-muted);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid var(--dp-border);
}
.dp-table td { padding: 9px 10px; border-bottom: 1px solid var(--dp-border); vertical-align: top; }
.dp-table tr:last-child td { border-bottom: 0; }
.dp-table .dp-num { text-align: right; font-variant-numeric: tabular-nums; }
.dp-scroll { overflow-x: auto; }

/* ---------- badges, code, buttons ---------- */

.dp-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.dp-badge-good { background: var(--dp-good-soft); color: var(--dp-good); }
.dp-badge-bad { background: var(--dp-bad-soft); color: var(--dp-bad); }
.dp-badge-warn { background: var(--dp-warn-soft); color: var(--dp-warn); }
.dp-badge-mute { background: var(--dp-accent-soft); color: var(--dp-muted); }

code, .dp-mono { font-family: var(--dp-mono); font-size: 13px; }

.dp-secret {
    font-family: var(--dp-mono);
    font-size: 13px;
    background: var(--dp-bg);
    border: 1px dashed var(--dp-border);
    border-radius: 6px;
    padding: 10px 12px;
    word-break: break-all;
    display: block;
}

.dp-btn {
    display: inline-block;
    background: var(--dp-accent);
    color: #fff !important;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.dp-btn:hover { filter: brightness(1.06); }
.dp-btn-quiet { background: transparent; color: var(--dp-text) !important; border-color: var(--dp-border); }
.dp-btn-danger { background: var(--dp-bad); }

.dp-input, .dp-select, .dp-textarea {
    width: 100%;
    background: var(--dp-surface);
    color: var(--dp-text);
    border: 1px solid var(--dp-border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
}
.dp-input:focus, .dp-select:focus, .dp-textarea:focus {
    outline: 2px solid var(--dp-accent-soft);
    border-color: var(--dp-accent);
}
.dp-field { margin-bottom: 14px; }
.dp-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.dp-help { font-size: 12px; color: var(--dp-muted); margin-top: 4px; }

/* ---------- grouped nav ---------- */

.dp-nav-group { position: relative; display: inline-block; }

.dp-nav-trigger {
    font: inherit;
    color: var(--dp-muted);
    background: none;
    border: 0;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 6px;
}
.dp-nav-trigger:hover { color: var(--dp-text); }
.dp-nav-trigger.dp-active { color: var(--dp-accent); background: var(--dp-accent-soft); }
.dp-nav-trigger::after { content: " \25BE"; font-size: 10px; }

.dp-nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 170px;
    z-index: 30;
    background: var(--dp-surface);
    border: 1px solid var(--dp-border);
    border-radius: var(--dp-radius);
    padding: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
/* Opens on hover and on keyboard focus, so it is reachable by tab as well. */
.dp-nav-group:hover .dp-nav-menu,
.dp-nav-group:focus-within .dp-nav-menu { display: block; }

.dp-nav-menu a { display: block; padding: 7px 10px; border-radius: 5px; white-space: nowrap; }
.dp-nav-menu a:hover { background: var(--dp-accent-soft); color: var(--dp-text); }

/* ---------- look and feel ---------- */

.dp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .dp-split { grid-template-columns: minmax(0, 1fr); } }

.dp-colour-row { display: flex; align-items: center; gap: 10px; }

.dp-colour {
    width: 46px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--dp-border);
    border-radius: 6px;
    background: var(--dp-surface);
    cursor: pointer;
}

.dp-colour-hex { color: var(--dp-muted); text-transform: uppercase; }

.dp-preview-frame { padding: 18px; border-radius: 6px; border: 1px solid var(--dp-border); }

.dp-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid var(--dp-border);
    border-radius: 6px;
    padding: 6px;
    background: var(--dp-surface);
}

/* ---------- endpoint preview blocks ---------- */

.dp-subcard {
    border: 1px solid var(--dp-border);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--dp-bg);
}
.dp-subcard:last-child { margin-bottom: 0; }

.dp-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dp-chip {
    display: inline-block;
    padding: 2px 9px;
    margin: 3px 5px 0 0;
    border: 1px solid var(--dp-border);
    border-radius: 999px;
    background: var(--dp-surface);
    font-size: 12px;
    color: var(--dp-text);
}

/* ---------- notices ---------- */

.dp-notice { border-left: 3px solid var(--dp-accent); background: var(--dp-accent-soft); padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.dp-notice-warn { border-left-color: var(--dp-warn); background: var(--dp-warn-soft); }
.dp-notice-bad { border-left-color: var(--dp-bad); background: var(--dp-bad-soft); }
.dp-notice h3 { margin: 0 0 4px 0; font-size: 14px; }
.dp-notice p { margin: 0; color: var(--dp-muted); }

.dp-empty { text-align: center; padding: 34px 16px; color: var(--dp-muted); font-size: 14px; }

/* ---------- chart ---------- */

.dp-chart { width: 100%; height: 220px; display: block; }
.dp-legend { display: flex; gap: 16px; font-size: 12px; color: var(--dp-muted); margin-top: 8px; }
.dp-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* --- password reveal + copyable identifiers ------------------------------- */
.dp-input-wrap { position: relative; display: block; }
.dp-input-wrap .dp-input { padding-right: 62px; width: 100%; }
.dp-reveal {
	position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
	background: none; border: 0; padding: 4px 6px; cursor: pointer;
	font-size: 12px; font-weight: 600; color: var(--dp-accent, #6c63ff);
}
.dp-reveal:hover { text-decoration: underline; }
.dp-idrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dp-idvalue {
	font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
	background: var(--dp-code, #f7f7fb); border: 1px solid var(--dp-line, #e5e7eb);
	border-radius: 8px; padding: 7px 10px; word-break: break-all;
}
.dp-menu-form { margin: 0; }
.dp-menu-form a, .dp-nav-menu a { display: block; }
