/* Import Professional Typography */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Global Base Settings */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Stunning Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1; /* Tailwind slate-300 */
    border-radius: 10px;
}

.dark ::-webkit-scrollbar-thumb {
    background-color: #374151; /* Tailwind gray-700 */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8; /* Tailwind slate-400 */
}

.dark ::-webkit-scrollbar-thumb:hover {
    background-color: #4b5563; /* Tailwind gray-600 */
}

/* Global Text Selection Styling */
::selection {
    background-color: rgba(var(--color-primary-rgb), 0.2);
    color: rgb(var(--color-primary-rgb));
}

.dark ::selection {
    background-color: rgba(var(--color-primary-rgb), 0.3);
    color: #ffffff;
}

/* ==========================================
   DATATABLES RESPONSIVE UI RESTORATION
   ========================================== */
/* 1. Restore the Green '+' Toggle Icon (Excluding child rows!) */
table.dataTable.dtr-inline.collapsed > tbody > tr:not(.child) > td:first-child,
table.dataTable.dtr-inline.collapsed > tbody > tr:not(.child) > th:first-child {
    position: relative;
    padding-left: 40px !important; 
    cursor: pointer;
}

table.dataTable.dtr-inline.collapsed > tbody > tr:not(.child) > td:first-child::before,
table.dataTable.dtr-inline.collapsed > tbody > tr:not(.child) > th:first-child::before {
    top: 50%;
    left: 12px;
    height: 18px;
    width: 18px;
    margin-top: -9px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-family: sans-serif;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    content: '+';
    background-color: #16a34a; /* Tailwind green-600 */
    transition: background-color 0.2s ease;
}

/* 2. Restore the Red '-' Toggle Icon when open */
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child::before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child::before {
    content: '-';
    background-color: #dc2626; /* Tailwind red-600 */
}

/* 3. Style the Hidden Child Row Content */
table.dataTable > tbody > tr.child ul.dtr-details {
    display: block;
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

table.dataTable > tbody > tr.child ul.dtr-details > li {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
}

.dark table.dataTable > tbody > tr.child ul.dtr-details > li {
    border-bottom: 1px solid #374151;
}

/* Remove bottom border from last item */
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
    border-bottom: none;
}

/* Style the column title inside the child row */
table.dataTable > tbody > tr.child span.dtr-title {
    font-weight: 700;
    min-width: 100px;
    display: inline-block;
    color: #6b7280; 
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.dark table.dataTable > tbody > tr.child span.dtr-title {
    color: #9ca3af;
}

/* 4. Fix Action Icons Layout in Mobile View */
table.dataTable > tbody > tr.child span.dtr-data {
    flex-grow: 1;
    padding-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Adds perfect spacing between the view/edit/delete icons */
    flex-wrap: wrap;
}