
/* PRAWNIKOM GLOBAL APP DESIGN */

#app {
    --app-navy:#142641;
    --app-gold:#b58a43;
    --app-bg:#eff3f8;
    --app-border:#d3deea;
    --app-muted:#64748b;

    width:100%;
    min-width:0;
    max-width:100%;
    color:var(--app-navy);
    font-family:"Inter","Segoe UI",Arial,sans-serif;
    font-size:15px;
    line-height:1.6;
}

#app * {
    box-sizing:border-box;
}

#app :is(.portal,.shell,.content,.department-workspace) {
    min-width:0;
    max-width:100%;
}

#app [hidden],
#app .hidden,
#app .tab-panel-hidden {
    display:none !important;
}

/* NAGLOWKI */

#app h1 {
    font-family:Georgia,serif;
    font-size:clamp(26px,2.4vw,40px);
    line-height:1.3;
    overflow-wrap:anywhere;
}

#app h2 {
    font-family:Georgia,serif;
    font-size:clamp(21px,1.8vw,28px);
    line-height:1.35;
}

#app h3 {
    font-size:18px;
}

#app a {
    text-decoration:none !important;
}

/* GLOWNA PRZESTRZEN */

#app #main-content {
    width:100%;
    min-width:0;
    padding:24px;
    background:var(--app-bg);
}

#app .page-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:24px;
    padding:28px;
    background:#fff;
    border:1px solid var(--app-border);
    border-top:3px solid var(--app-gold);
    margin-bottom:24px;
}

#app .page-head-main {
    display:flex;
    align-items:flex-start;
    gap:20px;
    flex:1 1 500px;
    min-width:0;
}

#app .page-head-copy {
    min-width:0;
}

#app .page-head-copy h1 {
    margin:6px 0 12px;
}

#app .head-actions {
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

/* KARTY */

#app :is(
    .card,
    .pp-auto-card,
    section[class$="-card"],
    article[class$="-card"]
) {
    min-width:0;
    padding:24px;
    background:#fff;
    border:1px solid var(--app-border);
    border-radius:0;
}

#app .card-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:16px;
    padding-bottom:16px;
    margin-bottom:20px;
    border-bottom:1px solid var(--app-border);
}

#app .card-head h2 {
    margin:0;
}

/* AUTOMATYCZNE SIATKI */

#app :is(
    .grid,
    .pp-auto-grid,
    [class$="-fact-grid"],
    [class$="-metrics-grid"],
    [class$="-stats-grid"],
    [class$="-reference-grid"],
    [class$="-report-grid"],
    [class$="-cards-grid"]
) {
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(min(220px,100%),1fr));
    gap:18px;
    min-width:0;
}

#app .grid.two {
    grid-template-columns:repeat(2,minmax(0,1fr));
}

#app .grid.three {
    grid-template-columns:repeat(3,minmax(0,1fr));
}

#app .grid.four {
    grid-template-columns:repeat(4,minmax(0,1fr));
}

/* METRYKI I POLA REKORDOW */

#app [class$="-fact-grid"] > article {
    padding:18px;
    min-width:0;
    background:#f6f8fb;
    border:1px solid var(--app-border);
    border-left:3px solid var(--app-gold);
}

#app [class$="-fact-grid"] small {
    display:block;
    color:var(--app-muted);
    font-size:12px;
    margin-bottom:8px;
}

#app [class$="-fact-grid"] b {
    display:block;
    color:var(--app-navy);
    font-size:15px;
    overflow-wrap:anywhere;
}

/* OBSZARY ROBOCZE */

#app .module-workspace {
    display:grid;
    grid-template-columns:250px minmax(0,1fr);
    gap:20px;
    align-items:start;
    width:100%;
    min-width:0;
}

#app .module-canvas {
    min-width:0;
    max-width:100%;
    background:#fff;
    border:1px solid var(--app-border);
}

#app .module-canvas-scroll {
    min-width:0;
    padding:20px;
    height:auto;
    max-height:none;
    overflow:visible;
}

#app .module-workspace-bar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:12px;
    padding:16px;
    background:#f5f7fa;
    border-bottom:1px solid var(--app-border);
}

/* MENU BOCZNE */

#app .module-rail {
    position:static;
    width:100%;
    min-width:0;
    height:auto;
    max-height:none;
    overflow:visible;
    padding:0;
    background:#fff;
    color:var(--app-navy);
    border:1px solid var(--app-border);
}

#app .module-rail > header {
    display:flex;
    align-items:center;
    gap:12px;
    padding:18px;
    background:var(--app-navy);
    color:#fff;
}

#app .module-rail nav {
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:10px;
}

#app .module-rail nav > :is(a,button) {
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:12px;
    width:100%;
    min-height:46px;
    padding:12px;
    background:#fff;
    color:var(--app-navy);
    border:1px solid transparent;
    border-radius:0;
    text-align:left;
    font-size:14px;
}

#app .module-rail nav svg {
    width:21px;
    height:21px;
    color:var(--app-gold);
    flex-shrink:0;
}

#app .module-rail nav > :is(a,button):hover,
#app .module-rail nav > .active {
    background:#eaf0f7;
    border-left:3px solid var(--app-gold);
}

#app .module-rail footer {
    padding:16px;
    border-top:1px solid var(--app-border);
}

/* BANERY REKORDOW */

#app section[class$="-record-hero"] {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:24px;
    padding:28px;
    margin-bottom:20px;
    background:linear-gradient(120deg,#101d32,#23415f);
    color:#fff;
    border-bottom:3px solid var(--app-gold);
}

#app section[class$="-record-hero"] > div {
    flex:1 1 400px;
    min-width:0;
}

#app section[class$="-record-hero"] h2 {
    color:#fff;
    margin:10px 0 18px;
}

#app section[class$="-record-hero"] aside {
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:18px;
    background:rgba(255,255,255,.07);
    border:1px solid rgba(255,255,255,.2);
    color:#fff;
}

/* ZAKLADKI */

#app nav[class$="-record-nav"] {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    padding:10px;
    margin-bottom:20px;
    background:#fff;
    border:1px solid var(--app-border);
}

#app nav[class$="-record-nav"] button {
    display:flex;
    align-items:center;
    gap:8px;
    padding:12px 16px;
    color:var(--app-navy);
    background:#fff;
    border:1px solid var(--app-border);
    border-radius:0;
}

#app nav[class$="-record-nav"] button.active,
#app nav[class$="-record-nav"] button[aria-selected="true"] {
    background:var(--app-navy);
    color:#fff;
    border-bottom:3px solid var(--app-gold);
}

/* UKLAD KART SZCZEGOLOWYCH */

#app section[class$="-record-grid"]:has(> main + aside) {
    display:grid;
    grid-template-columns:minmax(0,1fr) 300px;
    gap:20px;
    align-items:start;
}

#app section[class$="-record-grid"] > :is(main,aside) {
    min-width:0;
}

#app section[class$="-record-grid"] > aside > section {
    margin-bottom:18px;
}

/* STATUSY */

#app .tags {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

#app .badge {
    display:inline-flex;
    align-items:center;
    padding:5px 10px;
    font-size:12px;
    font-weight:600;
    background:#e9eef5;
    color:var(--app-navy);
    border-radius:0;
}

#app .badge.gold {
    background:#f4e8d1;
    color:#805b21;
}

#app .badge.blue {
    background:#e3edf9;
    color:#174b92;
}

#app .badge.green {
    background:#e4f3e9;
    color:#17653b;
}

/* OSIE CZASU */

#app [class$="-timeline"] > article {
    position:relative;
    padding:16px 20px;
    margin-left:12px;
    border-left:2px solid var(--app-gold);
    background:#f7f9fc;
}

#app [class$="-timeline"] > article > small {
    color:var(--app-muted);
}

#app [class$="-timeline"] > article > b {
    display:block;
    margin:8px 0;
}

/* PANELE INFORMACYJNE */

#app :is(
    .department-assurance,
    [class$="-verification-card"],
    [class$="-analysis-lead"]
) {
    display:flex;
    align-items:flex-start;
    flex-wrap:wrap;
    gap:16px;
    padding:22px;
    margin-bottom:18px;
    background:#fff;
    border:1px solid var(--app-border);
    border-left:4px solid var(--app-gold);
}

#app :is(
    .department-assurance,
    [class$="-verification-card"],
    [class$="-analysis-lead"]
) > div {
    flex:1 1 200px;
    min-width:0;
}

/* KOD I DANE ZRODLOWE */

#app pre {
    max-width:100%;
    overflow:auto;
    padding:20px;
    background:#142641;
    color:#e4edf7;
    font-size:13px;
    line-height:1.6;
}

/* PUSTE WYNIKI */

#app .empty-state {
    padding:22px;
    background:#f7f9fc;
    border:1px dashed var(--app-border);
}

#app .empty-state p {
    color:var(--app-muted);
}

/* KAFELKI DZIALOW */

#app [data-department-tiles] {
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(min(150px,100%),1fr));
    gap:12px;
}

#app [data-department-tiles] > a:has(svg[data-hub-square]) {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    min-height:130px;
    padding:14px;
    background:#fff;
    border:1px solid var(--app-border);
}

#app svg[data-hub-square] {
    display:block;
    width:110px !important;
    height:110px !important;
    max-width:100%;
    flex-shrink:0;
    transform:none !important;
}

#app svg[data-hub-square] text {
    fill:#142641;
    font-size:12px;
}

#app svg[data-hub-square] g {
    stroke:#b58a43;
}

/* RESPONSYWNOSC */

@media(max-width:1200px) {

    #app section[class$="-record-grid"]:has(> main + aside) {
        grid-template-columns:minmax(0,1fr);
    }

    #app .grid.four {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:900px) {

    #app .module-workspace {
        grid-template-columns:minmax(0,1fr);
    }

    #app .grid.three {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:600px) {

    #app #main-content {
        padding:12px;
    }

    #app .module-canvas-scroll {
        padding:12px;
    }

    #app .grid {
        grid-template-columns:minmax(0,1fr);
    }

    #app :is(.card,.page-head,.pp-auto-card) {
        padding:16px;
    }

    #app .page-head-main {
        flex-basis:100%;
    }

    #app .head-actions {
        width:100%;
    }

    #app [data-department-tiles] {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

