:root {
    --sidebar-start: #061b47;
    --sidebar-end: #020f2c;
    --bg-main: #f4f7fc;
    --card-bg: #ffffff;
    --text-dark: #0f172a;
    --text-soft: #64748b;
    --text-summary-soft: #54575d --line: #e2e8f0;
    --brand-blue: #2563eb;
    --brand-green: #16a34a;
    --brand-orange: #f59e0b;
    --brand-purple: #7c3aed;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top right, #ebf3ff 0%, #f6f9ff 45%, #f8fafc 100%);
    color: var(--text-dark);
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

.dashboard-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    padding: 18px 14px;
    background: linear-gradient(180deg, var(--sidebar-start), var(--sidebar-end));
    color: #dbeafe;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1040;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d4ed8, #06b6d4);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 18px;
}

.logo-title {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 800;
    line-height: 1;
}

.logo-subtitle {
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: #bfdbfe;
}

.nav-links .nav-link,
.sidebar-footer .nav-link {
    color: #dbeafe;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

    .nav-links .nav-link:hover,
    .sidebar-footer .nav-link:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

.sidebar-section-title {
    margin: 18px 8px 10px;
    color: #9fb7e9;
    font-size: 0.72rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 2px;
}

.project-item,
.project-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #dbeafe;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid transparent;
    cursor: pointer;
}

    .project-item:hover,
    .project-item.active,
    .project-menu-item:hover,
    .project-menu-item.active {
        background: rgba(37, 99, 235, 0.25);
        color: #fff;
        border-color: rgba(147, 197, 253, 0.25);
    }

.project-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(96, 165, 250, 0.2);
}

.project-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
}

.project-status {
    font-size: 0.72rem;
    color: #bfd5ff;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
}

.project-menu-item.active .project-icon {
    background: rgba(255, 255, 255, 0.16);
}

.project-menu-item.active .project-status,
.project-menu-item.active .project-name {
    color: #fff;
}

.project-menu-item.active .status-dot {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.loading-state {
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed rgba(148, 163, 184, 0.28);
    padding: 12px 14px;
    font-size: 0.92rem;
}

.project-list .loading-state {
    margin: 6px 4px 0;
    color: #dbeafe;
}

.sidebar-footer {
    margin-top: auto;
}

.main-content {
    margin-left: 280px;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
}

.breadcrumb-row {
    font-weight: 700;
}

.crumb-link {
    color: var(--brand-blue);
}

.crumb-sep {
    color: #94a3b8;
    margin: 0 6px;
}

.crumb-current {
    color: #0f172a;
}

.top-subtext {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-wrap {
    /*border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 10px;*/
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
}

    .search-wrap input {
        border: 0;
        outline: 0;
        width: 220px;
        font-size: 0.9rem;
    }

.date-range-wrap {
    gap: 12px;
}

.date-range-single-wrap {
    min-width: 300px;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-soft);
    margin: 0;
}

.date-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 8px;
    background: #fff;
}

    .date-input-wrap .bi {
        color: #64748b;
    }

    .date-input-wrap .form-control {
        border: 0;
        box-shadow: none;
        min-width: 160px;
        padding: 0;
        font-size: 0.86rem;
    }

        .date-input-wrap .form-control:focus {
            box-shadow: none;
        }

.date-search-btn {
    border-radius: 8px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.datepicker {
    z-index: 2000 !important;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.profile-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-blue);
    color: #fff;
    font-weight: 700;
}

.profile-name {
    font-size: 0.86rem;
    font-weight: 700;
}

.profile-role {
    font-size: 0.72rem;
    color: var(--text-soft);
}

.content-wrap {
    padding: 18px 24px;
}

.panel-card {
    border: 0;
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.project-main-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4338ca, #7c3aed);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.status-pill {
    background: #e9e8ff;
    color: #4338ca;
}

.project-title {
    font-size: 1.6rem;
    font-weight: 800;
}

.project-desc {
    color: var(--text-soft);
    max-width: 760px;
}

.summary-box {
    border-radius: 12px;
    padding: 14px;
}

    .summary-box h4 {
        margin: 2px 0 0;
        font-size: 1.7rem;
        font-weight: 800;
    }

    .summary-box span,
    .summary-label {
        color: var(--text-summary-soft);
        font-size: 0.8rem;
        margin: 0;
    }

.summary-blue {
    background: #eef4ff;
}

.summary-green {
    background: #eefaf2;
}

.summary-red {
    background: #fcc0c0;
}

.summary-grey {
    background: #a9c0e1;
}

.summary-purple {
    background: #f3efff;
}

.summary-orange {
    background: #fff7e9;
}

.select-anchor {
    cursor: pointer;
    text-decoration: underline;
    color: #212529
}

.chart-wrap {
    position: relative;
    width: 210px;
    height: 210px;
    margin: 0 auto;
}

.chart-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    pointer-events: none;
}

.chart-value {
    font-size: 2rem;
    font-weight: 800;
}

.chart-label {
    color: var(--text-soft);
}

.progress-legend li {
    margin-bottom: 12px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

    .legend-dot.complete {
        background: #adf907;
    }

    .legend-dot.success {
        background: #16a34a;
    }

    .legend-dot.in-progress {
        background: #2563eb;
    }

    .legend-dot.at-risk {
        background: #f50b0b;
    }

.flow-wrap {
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.flow-step {
    min-width: 170px;
    background: #f8fafc;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    padding: 12px;
}

    .flow-step h6 {
        font-size: 0.85rem;
        margin-top: 8px;
    }

    .flow-step p {
        font-size: 0.77rem;
        color: var(--text-soft);
        margin-bottom: 0;
    }

.flow-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #2563eb;
    background: #eaf1ff;
}

.flow-arrow {
    align-self: center;
    color: #94a3b8;
    font-size: 1.2rem;
}

.metric-box {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 10px;
    min-height: 88px;
}

    .metric-box p {
        margin: 0;
        font-size: 0.76rem;
        color: var(--text-soft);
    }

    .metric-box h4 {
        margin-top: 6px;
        font-weight: 800;
    }

.custom-table thead th {
    border-bottom: 1px solid #dbe5f1;
    color: #475569;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.custom-table tbody td {
    font-size: 0.84rem;
    border-color: #eef2f7;
}

.slim-progress {
    height: 7px;
    background: #e2e8f0;
}

    .slim-progress .progress-bar {
        background-color: #2563eb;
    }

.mini-label {
    margin-bottom: 2px;
    color: var(--text-soft);
    font-size: 0.75rem;
}

.message-col {
    max-width: 260px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.documents-modal-content {
    border: 0;
    border-radius: 16px;
}

.documents-table-wrap {
    min-width: 100%;
}

.documents-modal-table {
    white-space: nowrap;
}

    .documents-modal-table tbody td {
        vertical-align: top;
    }

/* Fullscreen Documents View */
.documents-fullscreen-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

.documents-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--card-bg);
}

    .documents-view-header h2 {
        margin: 0;
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--text-dark);
    }

    .documents-view-header .btn-close {
        width: 38px;
        height: 38px;
        border: 1px solid var(--line);
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        opacity: 0.5;
        transition: opacity 0.2s ease;
    }

        .documents-view-header .btn-close:hover {
            opacity: 1;
        }

.documents-view-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px 24px;
    background: var(--bg-main);
}

    .documents-view-content .documents-table-wrap {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 16px;
    }

    .documents-view-content .table-responsive {
        border-radius: 8px;
        overflow: hidden;
    }

@media (max-width: 992px) {
    .app-sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        flex-wrap: wrap;
    }

    .date-range-wrap {
        width: 100%;
        align-items: center;
    }

    .date-input-wrap .form-control {
        min-width: 0;
        width: 100%;
    }

    .date-range-single-wrap {
        min-width: 0;
        flex: 1;
    }

    .documents-view-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

        .documents-view-header .btn-close {
            align-self: flex-end;
        }
}

div.dataTables_wrapper div.dataTables_length select {
    min-width: 50px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 10px;
}
