﻿/* =========================================================
   ENV360 GLOBAL THEME
   Envergure 360 - Refined Ivory v2
========================================================= */

:root {
    --env360-blue: #17394C;
    --env360-blue-soft: #25495D;
    --env360-gold: #A68863;
    --env360-bg: #FAF9F7;
    --env360-surface: #FFFFFF;
    --env360-soft: #F5F2ED;
    --env360-text: #293A46;
    --env360-muted: #73818A;
    --env360-border: #E5E8E9;
    --env360-border-soft: #EDF0F1;
    --env360-radius: 12px;
    --env360-shadow: 0 3px 14px rgba(23, 57, 76, .035);
    --env360-shadow-hover: 0 7px 22px rgba(23, 57, 76, .085);
}

.env360-layout {
    min-height: 100vh;
    background: var(--env360-bg);
    color: var(--env360-text);
}

/* HEADER */

.env360-topbar {
    padding: 13px 30px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--env360-border);
    backdrop-filter: blur(14px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.env360-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.env360-brand-logo {
    height: 38px;
}

.env360-brand-title strong {
    font-weight: 600;
    color: var(--env360-text);
}

.env360-badge-360 {
    background: var(--env360-soft);
    border: 1px solid var(--env360-border);
    color: #7A6B57;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.env360-client-logo-zone {
    border: 1px dashed var(--env360-border);
    background: #F8F9F9;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--env360-muted);
}

/* PAGE */

.env360-page {
    width: min(96vw, 1800px);
    margin: auto;
    padding: 18px;
}

/* HERO */

.env360-hero {
    background: linear-gradient(115deg, #FFFFFF, #F8F5F0);
    border: 1px solid var(--env360-border);
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: var(--env360-shadow);
    margin-bottom: 16px;
}

    .env360-hero h1 {
        font-weight: 600;
        margin: 0 0 8px;
        color: var(--env360-blue);
    }

    .env360-hero p {
        color: var(--env360-muted);
        margin: 0;
        line-height: 1.55;
    }

/* CHARTER */

.env360-charter {
    background: var(--env360-surface);
    border: 1px solid var(--env360-border);
    border-radius: var(--env360-radius);
    padding: 15px;
    margin-bottom: 18px;
    box-shadow: var(--env360-shadow);
}

.env360-charter-title {
    font-weight: 600;
    color: var(--env360-blue);
    margin-bottom: 8px;
}

.env360-charter-text {
    color: var(--env360-muted);
    line-height: 1.55;
    font-size: 13px;
    margin-bottom: 12px;
}

.env360-checkline {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--env360-text);
    font-weight: 500;
}

/* HOME TOOLBAR */

.env360-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin: 20px 0 14px;
}

.env360-section-title {
    margin: 0;
    color: var(--env360-blue);
    font-size: 18px;
    font-weight: 600;
}

.env360-toolbar p {
    margin: 4px 0 0;
    color: var(--env360-muted);
    font-size: 13px;
}

/* SEARCH */

.env360-search-input {
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--env360-border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--env360-surface);
    color: var(--env360-text);
    outline: none;
    flex-shrink: 0;
}

    .env360-search-input:focus {
        border-color: var(--env360-gold);
        box-shadow: 0 0 0 3px rgba(166,136,99,.12);
    }

/* HOME CATEGORY GROUPS */

.env360-category-section {
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
    background: #FCFCFB;
    border: 1px solid var(--env360-border);
    box-shadow: var(--env360-shadow);
}

.env360-category-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--env360-border-soft);
}

.env360-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--env360-soft);
    border: 1px solid var(--env360-border);
    color: #8a6b42;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.env360-category-header h3 {
    margin: 0;
    color: var(--env360-blue);
    font-size: 18px;
    font-weight: 600;
}

.env360-category-header p {
    margin: 4px 0 0;
    color: var(--env360-muted);
    font-size: 13px;
}

/* HOME PUBLICATION LIST */

.env360-publication-list {
    display: grid;
    gap: 11px;
}

.env360-publication-card {
    background: var(--env360-surface);
    border: 1px solid var(--env360-border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 9px rgba(23, 57, 76, .03);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    transition: .2s;
}

    .env360-publication-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--env360-shadow-hover);
        border-color: rgba(166,136,99,.65);
    }

    .env360-publication-card.is-new {
        border-left: 3px solid var(--env360-gold);
    }

.env360-publication-content {
    flex: 1;
    min-width: 0;
}

.env360-publication-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .env360-publication-title-row h4 {
        margin: 0;
        color: var(--env360-text);
        font-size: 15px;
        font-weight: 600;
    }

.env360-publication-content p {
    margin: 7px 0 0;
    color: var(--env360-muted);
    font-size: 13px;
    line-height: 1.5;
}

.env360-publication-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--env360-muted);
    font-size: 12px;
}

.env360-new-chip {
    background: var(--env360-soft);
    border: 1px solid var(--env360-border);
    color: #7A6B57;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.env360-publication-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* LEGACY GRID/CARD SUPPORT */

.env360-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.env360-card {
    background: var(--env360-surface);
    border: 1px solid var(--env360-border);
    border-radius: var(--env360-radius);
    padding: 15px;
    box-shadow: var(--env360-shadow);
    transition: .2s;
    cursor: pointer;
}

    .env360-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--env360-shadow-hover);
    }

.env360-card-head {
    display: flex;
    gap: 13px;
    align-items: flex-start;
}

.env360-card-icon {
    width: 42px;
    height: 38px;
    border-radius: 13px;
    background: var(--env360-soft);
    color: #8a6b42;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.env360-card h4 {
    font-weight: 600;
    color: var(--env360-text);
    margin: 0 0 6px;
}

.env360-card p {
    color: var(--env360-muted);
    margin: 0;
}

/* DETAIL */

.env360-detail-card {
    background: var(--env360-surface);
    border: 1px solid var(--env360-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--env360-shadow);
}

.env360-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 18px;
}

    .env360-detail-header h1 {
        font-weight: 600;
        color: var(--env360-text);
        margin: 0 0 8px;
    }

    .env360-detail-header p {
        color: var(--env360-muted);
        margin: 0;
    }

.env360-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.env360-meta {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.env360-pill {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--env360-soft);
    color: #7A6B57;
    border: 1px solid var(--env360-border);
}

    .env360-pill.gold {
        background: var(--env360-soft);
        color: #7A6B57;
    }

/* BOOK / PREVIEW LAYOUT */

.env360-book-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    height: calc(100vh - 210px);
    min-height: 640px;
    overflow: hidden;
}

.env360-book-index {
    background: #F9FAFA;
    border: 1px solid var(--env360-border);
    border-radius: var(--env360-radius);
    padding: 14px;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.env360-book-index-title {
    font-weight: 600;
    color: var(--env360-blue);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.env360-book-index .env360-search-input {
    max-width: none;
    margin-bottom: 12px;
}

.env360-book-index-list {
    overflow-y: auto;
    padding-right: 4px;
}

.env360-book-index-item {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--env360-text);
    margin-bottom: 6px;
}

    .env360-book-index-item:hover {
        background: var(--env360-soft);
    }

    .env360-book-index-item.active {
        background: #F0EBE3;
        font-weight: 600;
    }

.env360-book-content {
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    scroll-behavior: smooth;
}

.env360-book-sheet {
    padding-bottom: 10px;
}

/* SHEET TITLE */

.env360-sheet-title {
    margin: 0 auto 24px;
    width: fit-content;
    max-width: 90%;
    padding: 12px 30px;
    text-align: center;
    color: var(--env360-text);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    border: 1px solid var(--env360-gold);
    border-radius: 999px;
    background: linear-gradient(115deg, #FFFFFF, #F8F5F0);
    box-shadow: 0 4px 14px rgba(166,136,99,.07);
}

/* IDENTITY CARDS */

.env360-identity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.env360-identity-field {
    background: #F9FAFA;
    border: 1px solid var(--env360-border);
    padding: 12px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(23,57,76,.025);
}

    .env360-identity-field label {
        display: block;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: .4px;
        color: #A59A8D;
        font-weight: 500;
        margin-bottom: 6px;
    }

    .env360-identity-field strong {
        display: block;
        font-weight: 600;
        color: var(--env360-text);
        font-size: 14px;
        line-height: 1.35;
    }

/* BOOK SECTIONS */

.env360-book-section {
    margin-top: 26px;
    background: transparent;
}

.env360-book-section-title {
    background: var(--env360-blue);
    color: white;
    padding: 12px 18px;
    border-radius: 14px 14px 0 0;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-align: center;
}

    .env360-book-section-title span:first-child {
        color: white;
        font-size: 15px;
    }

    .env360-book-section-title span:last-child {
        color: white;
        font-size: 15px;
        background: transparent;
        padding: 0;
        border-radius: 0;
    }

        .env360-book-section-title span:last-child::before {
            content: "(";
        }

        .env360-book-section-title span:last-child::after {
            content: ")";
        }

/* TABLE */

.env360-table-wrapper {
    border: 1px solid var(--env360-border);
    border-top: none;
    border-radius: 0 0 14px 14px;
    overflow-x: auto;
    background: var(--env360-surface);
}

.env360-table {
    width: 100%;
    border-collapse: collapse;
}

    .env360-table th {
        background: var(--env360-soft);
        color: #5E5144;
        padding: 10px 12px;
        font-weight: 600;
        text-align: left;
        white-space: nowrap;
    }

    .env360-table td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--env360-border-soft);
        color: var(--env360-text);
        white-space: nowrap;
    }

    .env360-table tr:nth-child(even) {
        background: #F9FAFA;
    }

/* FLOATING ACTIONS */

.env360-floating-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    padding-top: 18px;
    margin-top: 24px;
    background: linear-gradient(180deg, transparent, var(--env360-surface) 45%);
    z-index: 5;
}

/* EMPTY */

.env360-empty {
    background: var(--env360-surface);
    border: 1px solid var(--env360-border);
    border-radius: var(--env360-radius);
    padding: 32px;
    text-align: center;
    color: var(--env360-muted);
}

    .env360-empty.compact {
        padding: 15px;
        border-radius: 0 0 14px 14px;
        border-top: none;
        background: #F9FAFA;
    }

/* SCROLLBARS */

.env360-book-index-list::-webkit-scrollbar,
.env360-book-content::-webkit-scrollbar,
.env360-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.env360-book-index-list::-webkit-scrollbar-thumb,
.env360-book-content::-webkit-scrollbar-thumb,
.env360-table-wrapper::-webkit-scrollbar-thumb {
    background: #d8cbbb;
    border-radius: 999px;
}

/* BUTTONS */

.env360-layout .rz-button.rz-primary {
    background: var(--env360-gold);
    border: none;
    color: white;
    box-shadow: none;
}

    .env360-layout .rz-button.rz-primary:hover {
        background: #917652;
    }

.env360-layout .rz-button.rz-light {
    background: var(--env360-soft);
    border: 1px solid var(--env360-border);
    color: var(--env360-text);
    box-shadow: none;
}

    .env360-layout .rz-button.rz-light:hover {
        background: #F0EBE3;
    }

/* PRINT */

@media print {
    body * {
        visibility: hidden;
    }

    #env360PrintableSheet,
    #env360PrintableSheet * {
        visibility: visible;
    }

    #env360PrintableSheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white;
    }

    .env360-floating-actions,
    .env360-actions,
    .env360-publication-actions {
        display: none !important;
    }

    .env360-book-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .env360-book-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .env360-book-index {
        height: auto;
        overflow: visible;
    }

    .env360-book-index-list {
        max-height: 280px;
    }

    .env360-book-content {
        height: auto;
        overflow: visible;
    }

    .env360-floating-actions {
        position: static;
    }
}

@media (max-width: 760px) {
    .env360-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .env360-search-input {
        max-width: none;
    }

    .env360-publication-card {
        flex-direction: column;
    }

    .env360-publication-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 720px) {
    .env360-topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 22px;
    }

    .env360-page {
        width: 100%;
        padding: 18px 12px 36px;
    }

    .env360-detail-header {
        flex-direction: column;
    }

    .env360-hero {
        padding: 20px;
    }

    .env360-sheet-title {
        font-size: 18px;
        padding: 10px 20px;
    }
}

.env360-diagram-viewer {
    height: calc(100vh - 260px);
    min-height: 620px;
    border: 1px solid var(--env360-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--env360-surface);
}

.env360-cy-container {
    width: 100%;
    height: 100%;
    min-height: 600px; /* 🔥 IMPORTANT */
}
