/* Pixelbuilders Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary:       #000EFF;
    --nav-bg:        #000734;
    --body-bg:       #F6F7FB;
    --text:          #111111;
    --border:        #D8DCE6;
    --radius:        4px;
    --font:          'Inter', sans-serif;
    --grey:          #6B7280;
    --success:       #16A34A;
    --warning:       #D97706;
    --danger:        #DC2626;
    --info-bg:       #EEF0FF;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--body-bg);
    margin: 0;
    padding: 0;
}

/* ── Nav ──────────────────────────────────────────── */
.pp-nav {
    background: var(--nav-bg);
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.pp-nav-brand {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.pp-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.pp-nav-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}
.pp-nav-link:hover,
.pp-nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.pp-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}
.pp-nav-right a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}
.pp-nav-right a:hover { color: #fff; }

/* ── Layout ───────────────────────────────────────── */
.pp-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}
.pp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.pp-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* ── Buttons ──────────────────────────────────────── */
.pp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.pp-btn:hover { opacity: 0.85; }
.pp-btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.pp-btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.pp-btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.pp-btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Cards / Panels ───────────────────────────────── */
.pp-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.pp-card + .pp-card { margin-top: 16px; }

/* ── Tables ───────────────────────────────────────── */
.pp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.pp-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey);
    border-bottom: 1px solid var(--border);
    background: #fff;
}
.pp-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.pp-table tr:last-child td { border-bottom: none; }
.pp-table tr:hover td { background: var(--body-bg); }

/* ── Badges ───────────────────────────────────────── */
.pp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.pp-badge-grey    { background: #F3F4F6; color: #6B7280; }
.pp-badge-yellow  { background: #FEF9C3; color: #92400E; }
.pp-badge-green   { background: #D1FAE5; color: #065F46; }
.pp-badge-red     { background: #FEE2E2; color: #991B1B; }
.pp-badge-blue    { background: #DBEAFE; color: #1E40AF; }
.pp-badge-purple  { background: #EDE9FE; color: #5B21B6; }
.pp-badge-override { background: var(--info-bg); color: var(--primary); }

/* ── Forms ────────────────────────────────────────── */
.pp-form-group { margin-bottom: 16px; }
.pp-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.pp-input,
.pp-select,
.pp-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s;
    outline: none;
}
.pp-input:focus,
.pp-select:focus,
.pp-textarea:focus { border-color: var(--primary); }
.pp-textarea { resize: vertical; }
.pp-textarea-mono { font-family: 'Consolas', 'Monaco', monospace; font-size: 12px; }
.pp-hint { font-size: 12px; color: var(--grey); margin-top: 4px; }
.pp-field-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ── Tabs ─────────────────────────────────────────── */
.pp-tabs { border-bottom: 1px solid var(--border); display: flex; gap: 0; margin-bottom: 24px; }
.pp-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--grey);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
    text-decoration: none;
    display: inline-block;
    margin-bottom: -1px;
}
.pp-tab:hover { color: var(--text); }
.pp-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.pp-tab-panel { display: none; }
.pp-tab-panel.active { display: block; }

/* ── Pipeline Kanban ──────────────────────────────── */
.pp-pipeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}
.pp-pipeline-col {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.pp-pipeline-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.pp-pipeline-col-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey);
}
.pp-pipeline-count {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

/* Pulsing activity dot */
.pp-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: pp-pulse-anim 1.5s ease-in-out infinite;
}
@keyframes pp-pulse-anim {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ── Activity Feed ────────────────────────────────── */
.pp-feed { list-style: none; margin: 0; padding: 0; }
.pp-feed-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.pp-feed-item:last-child { border-bottom: none; }
.pp-feed-time { color: var(--grey); white-space: nowrap; flex-shrink: 0; font-size: 12px; }
.pp-feed-event { font-weight: 600; }
.pp-feed-detail { color: var(--grey); margin-top: 2px; font-size: 12px; }

/* ── Toast ────────────────────────────────────────── */
.pp-toast-container {
    position: fixed;
    top: 64px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pp-toast {
    min-width: 280px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: pp-slide-in 0.2s ease;
}
.pp-toast-success { border-left: 3px solid var(--success); }
.pp-toast-error   { border-left: 3px solid var(--danger); }
@keyframes pp-slide-in {
    from { transform: translateX(16px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ── Log Timeline ─────────────────────────────────── */
.pp-timeline { list-style: none; margin: 0; padding: 0; }
.pp-timeline-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.pp-timeline-item:last-child { border-bottom: none; }
.pp-timeline-time { color: var(--grey); font-size: 12px; white-space: nowrap; flex-shrink: 0; width: 140px; }
.pp-timeline-event { font-weight: 600; margin-bottom: 2px; }
.pp-timeline-detail { color: var(--grey); font-size: 12px; }

/* ── Colour swatches ──────────────────────────────── */
.pp-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 4px;
}
.swatch-blue   { background: #0079BF; }
.swatch-green  { background: #70B500; }
.swatch-orange { background: #FF9F1A; }
.swatch-red    { background: #EB5A46; }
.swatch-purple { background: #C377E0; }
.swatch-pink   { background: #FF78CB; }
.swatch-sky    { background: #00C2E0; }
.swatch-lime   { background: #51E898; }

/* ── Markdown output ──────────────────────────────── */
.pp-markdown { font-size: 14px; line-height: 1.7; }
.pp-markdown h1,.pp-markdown h2,.pp-markdown h3 { font-weight: 700; margin: 16px 0 8px; }
.pp-markdown h1 { font-size: 18px; }
.pp-markdown h2 { font-size: 16px; }
.pp-markdown h3 { font-size: 14px; }
.pp-markdown p  { margin: 0 0 12px; }
.pp-markdown ul,.pp-markdown ol { margin: 0 0 12px; padding-left: 20px; }
.pp-markdown code { background: #F3F4F6; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.pp-markdown pre { background: #F3F4F6; padding: 12px; border-radius: var(--radius); overflow-x: auto; }
.pp-markdown pre code { background: none; padding: 0; }
.pp-markdown blockquote { border-left: 3px solid var(--border); margin: 0 0 12px; padding-left: 12px; color: var(--grey); }

/* ── Misc ─────────────────────────────────────────── */
.pp-info-note {
    background: var(--info-bg);
    border: 1px solid #BFC7FF;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: #1A2DB5;
}
.pp-section-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.pp-readonly-preview {
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    font-size: 13px;
    color: var(--grey);
    font-family: 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}
.pp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pp-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.text-grey { color: var(--grey); }
.text-small { font-size: 12px; }
