:root {
    --bg-main: #f4f7fc;
    --sidebar-blue: #0745e4;
    --sidebar-hover: #1e59ed;
    --btn-blue: #1b5bf7;
    --border-color: #ebedf2;
    --text-dark: #1e293b;
    --text-muted: #8a99ad;
}

body {
    background: var(--bg-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #475569;
    margin: 0;
    padding: 0;
}


/* Fixed Split-Screen Dashboard Wrapper */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Left Column Fixed Panel */
.sidebar {
    width: 240px;
    height: 100vh;
    background: var(--sidebar-blue);
    color: white;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    overflow: hidden; /* Disables sidebar scrolling */
    box-sizing: border-box;
}

.sidebar-top-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.sidebar-bottom-group {
    margin-top: auto; /* Pushes the logout group to the very bottom */
    width: 100%;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 36px;
    padding-left: 16px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s ease;
}

.sidebar-menu a i {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-menu a:hover{
    background-color: var(--sidebar-hover);
    color: #ffffff;
}
.sidebar-menu a.active {
    background: var(--sidebar-hover);
    color: white;
}

/* Main Content Frame (Right Panel) */
.main-content {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;  /* Vertical scroll enabled exclusively here */
    overflow-x: hidden;
}

/* Top Bar Panel */
.top-navbar {
    background: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumbs {
    font-size: 14px;
    color: #64748b;
}

/* Inside Workspace Fluid Area */
.content-body {
    padding: 32px;
}

/* Interactive Standard Controls Buttons Layout */
.btn-primary {
    background-color: var(--btn-blue);
    border-color: var(--btn-blue);
    border-radius: 8px;
    font-size: 14px;
}
.btn-primary:hover {
    background-color: #0d4bdf;
    border-color: #0d4bdf;
}

/* Filter Management Block Styling */
.filter-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.filter-card .form-control,
.filter-card .form-select {
    border-color: #dee2e6;
    padding: 10px 14px;
    font-size: 14px;
    color: #475569;
    border-radius: 8px;
}

.filter-card .input-group-text {
    border-color: #dee2e6;
    color: var(--text-muted);
}

/* Main Data Container Design */
.table-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: visible !important; /* 🔴 CRITICAL: Allows elements to overflow out of the table area */
    position: relative;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 13px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: white;
    text-align: left;
}

.custom-table td {
    padding: 16px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    text-align: left;
}

.custom-table tr:hover {
    background: #f8fafc;
}

.modified-row {
    background: #fffdf5;
}

/* Status Pills Custom Engine */
.status-pill {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pill .dot {
    font-size: 10px;
}

.status-case-was-approved {
    background-color: #e6f9f0;
    color: #10b981;
}

.status-request-for-evidence-was-sent {
    background-color: #fff2e6;
    color: #f97316;
}

.status-case-was-received {
    background-color: #eef2ff;
    color: #3b82f6;
}

/* Action Dropdowns Elements */
.action-cell {
    position: relative;
}

.menu-btn {
    background: none;
    color: var(--text-muted);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s;
}

.menu-btn:hover {
    background: #f1f5f9;
    color: var(--text-dark);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 12px;
    top: 100%; /* 🔴 CHANGED: Dynamically calculates position directly below the three dots button */
    background: white;
    min-width: 150px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 9999 !important; /* 🔴 CRITICAL: Forces menu to display directly on top of the pages footer */
    padding: 6px 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: black;
}

.table-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: white;
}

.pagination .page-link {
    color: #475569;
    border-color: #dee2e6;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
}

.pagination .page-item.active .page-link {
    background-color: var(--btn-blue);
    border-color: var(--btn-blue);
    color: white;
}

/* Full Workspace-Covering Modal (Fills the entire screen area next to blue sidebar) */
@media (min-width: 992px) {
    .custom-workspace-modal {
        position: fixed !important;
        top: 0 !important;
        left: 240px !important;
        margin: 0 !important;
        width: calc(100vw - 240px) !important;
        max-width: none !important;
        height: 100vh !important;
    }

    .custom-workspace-modal .modal-content {
        height: 100vh !important;
        min-height: 100vh !important;
        border-radius: 0 !important;
        background-color: #ffffff !important;
    }
}

#historyContent .card {
    width: 100% !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

#historyContent .row {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#historyContent h5,
#historyContent h6 {
    color: var(--text-dark);
    font-weight: 700;
}

/* ADD THIS DIRECTLY UNDERNEATH TO FORCE CLEAN PARAGRAPH TEXT WRAPPING */

#historyContent {
    max-height: 70vh !important;
    overflow-y: auto !important;
}

#historyContent .flex-grow-1,
#historyContent span,
#historyContent p,
#historyContent div {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}