/* assets/css/style.css */

html, body {
    height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 0.9rem;
    color: #2d3748;
    background-color: #f7f8fa;
}

.container, .main-content {
    flex: 1;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

header {
    background: linear-gradient(135deg, #1a2744 0%, #2c4a7c 60%, #1e3a5f 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

.nav-link {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.85;
}

.dropdown-menu {
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.4rem 1rem;
    font-weight: 400;
}

.dropdown-item:hover {
    background-color: #f0f4f8;
}

.dropdown-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8898aa;
    padding: 0.5rem 1rem 0.2rem;
}

.user-info {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    margin-top: auto;
    background-color: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 0.5rem 0 !important;
}

footer .container {
    padding-top: 0;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4 {
    font-weight: 700 !important;
    color: #1a2744;
    letter-spacing: -0.02em;
}

.text-white h1, .text-white h2, .text-white h3, .text-white h4 {
    color: #fff;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

/* ========================================
   LAYOUT
   ======================================== */

.container {
    padding-top: 20px;
}

.success {
    color: green;
}

/* ========================================
   FORMS
   ======================================== */

.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.input-group-text {
    border-right: none;
    font-size: 0.85rem;
}

.form-control {
    border-radius: 0.45rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(33, 83, 143, 0.1);
    border-color: #21538f;
}

.form-select {
    font-size: 0.875rem;
    border-radius: 0.45rem;
    border: 1px solid #d1d5db;
}

.form-select:focus {
    box-shadow: 0 0 0 3px rgba(33, 83, 143, 0.1);
    border-color: #21538f;
}

.form-text {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ========================================
   TABLES
   ======================================== */

/* Table header styling */
table.dataTable thead th,
.table thead th,
.datatable thead th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8898aa;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 0.75rem 0.75rem;
    background-color: transparent;
}

table.dataTable tbody td,
.table tbody td {
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

/* Striped rows */
.odd-row {
    background-color: #f8fafc !important;
}

.even-row {
    background-color: #ffffff !important;
}

/* Remove borders between columns */
table.dataTable.no-footer {
    border-bottom: none;
}

table.dataTable thead th,
table.dataTable tbody td {
    border-left: none;
    border-right: none;
}

table.dataTable {
    border-collapse: collapse;
}

/* More specific rules for Bootstrap */
.table.dataTable > tbody > tr.odd-row > td {
    background-color: #f8fafc !important;
}

.table.dataTable > tbody > tr.even-row > td {
    background-color: #ffffff !important;
}

.table.dataTable > tbody > tr > td {
    border-left: none !important;
    border-right: none !important;
}

.table-bordered > :not(caption) > * {
    border-width: 0;
}

/* Row hover */
.table > tbody > tr:hover > td,
table.dataTable > tbody > tr:hover > td {
    background-color: #eef2f7 !important;
}

/* Delete button: hidden until row hover (opacity preserves layout) */
.delete-button {
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.delete-button i {
    color: #e53e3e;
}

tr:hover .delete-button,
.customer-row:hover .delete-button {
    opacity: 1;
    pointer-events: auto;
}

/* DataTables pagination & controls */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.8rem;
    color: #64748b;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.45rem;
    border: 1px solid #d1d5db;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    font-size: 0.8rem;
    border-radius: 0.35rem !important;
    padding: 0.25rem 0.6rem !important;
}

/* ========================================
   TABLE ACTION BUTTONS (standardized)
   ======================================== */

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.table-actions .btn-group-sm .btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}

.table-actions .btn-danger {
    margin-left: 0.75rem;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 0.45rem;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.3rem 0.65rem;
}

.btn i.bi,
.nav-link i.bi,
.dropdown-item i.bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05em;
    min-width: 1.05em;
    line-height: 1;
    flex-shrink: 0;
}

.table-actions .btn-group-sm .btn,
.table-actions .btn {
    min-width: 2rem;
    justify-content: center;
}

.btn:hover {
    text-decoration: none;
    transform: none;
}

.btn-primary {
    background-color: #21538f;
    border-color: #21538f;
}

.btn-primary:hover {
    background-color: #1a4270;
    box-shadow: 0 2px 6px rgba(33, 83, 143, 0.2);
}

.btn-outline-primary {
    border: 1px solid #21538f;
    color: #21538f;
}

.btn-outline-primary.active {
    background-color: #21538f;
    color: white;
    border-color: #21538f;
}

.btn-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.btn-warning:hover {
    background-color: #d97706;
    border-color: #d97706;
}

.btn-danger:hover {
    background-color: #c53030;
    border-color: #c53030;
}

.btn-info {
    background-color: #3182ce;
    border-color: #3182ce;
    color: #fff;
}

.btn-info:hover {
    background-color: #2b6cb0;
    border-color: #2b6cb0;
}

.btn-success {
    background-color: #38a169;
    border-color: #38a169;
}

.btn-success:hover {
    background-color: #2f855a;
    border-color: #2f855a;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.card-header {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0.6rem 0.6rem 0 0;
}

.card-body {
    text-align: left;
}

/* Dashboard stat cards - centered layout */
a.card-link .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card-body h5 {
    font-size: 2rem;
    margin: 0;
    color: #ffffff;
}

.card-body p {
    font-size: 0.8rem;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.card-footer {
    background: #fafbfc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 0.6rem 0.6rem;
    text-align: center;
}

a.card-link {
    color: #efefef;
    text-decoration: none;
    display: block;
    height: 100%;
    padding: 15px;
}

a.card-link:hover {
    text-decoration: none;
    color: #ffffff;
}

/* ========================================
   CARD COLORS (Dashboard)
   ======================================== */

.bg-primary {
    background-color: #21538f !important;
}

.bg-success {
    background-color: #38a169 !important;
}

.bg-warning {
    background-color: #d69e2e !important;
}

.bg-danger {
    background-color: #e53e3e !important;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    font-size: 0.85rem;
    border-radius: 0.45rem;
}

.alert-danger i {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ========================================
   PAGE HEADERS
   ======================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.page-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header h2 i {
    font-size: 1.1rem;
    color: #64748b;
}

/* ========================================
   QUICK ACCESS BUTTONS
   ======================================== */

.quick-access-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-right: 12px;
    font-size: 0.85rem;
}

.quick-access-btn:hover {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Shared scroll wrapper for overdue list views */
.overdue-scroll {
    max-height: 420px;
    overflow-y: auto;
}

/* ========================================
   UTILITIES
   ======================================== */

.spacer50 {
    padding-top: 25px;
    padding-bottom: 25px;
}

.underline {
    border-bottom: 3px solid #e2e8f0;
    margin-bottom: 20px;
}

#emailHistoryList p {
    padding: 0;
    margin: 0;
}

.no-link {
    text-decoration: none;
    color: #2d3748;
}

.no-link:hover {
    color: #21538f;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #1a2744;
    color: white;
    padding: 10px 20px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    font-size: 0.85rem;
}

.notification.show {
    opacity: 1;
}

.close-notification {
    cursor: pointer;
    margin-left: 10px;
}

.close-notification:hover {
    color: #ddd;
}

/* ========================================
   GRADIENTS
   ======================================== */

.bg-gradient-primary-to-light {
    background: linear-gradient(135deg, #1a2744 0%, #2c4a7c 100%);
}

.bg-gradient-light-to-dark {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* ========================================
   QUICK ACTION BAR (sidebar)
   ======================================== */

.quick-action-bar {
    position: fixed;
    top: 20% !important;
    left: -5px !important;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1000;
}

.quick-action-bar .quick-action-btn {
    position: absolute;
    left: 0;
    transform-origin: top left;
    transform: rotate(-90deg) translateX(-100%);
    pointer-events: auto;
}

.quick-action-bar .quick-action-btn:nth-child(1) { top: 0; }
.quick-action-bar .quick-action-btn:nth-child(2) { top: 121px; }
.quick-action-bar .quick-action-btn:nth-child(3) { top: 224px; }
.quick-action-bar .quick-action-btn:nth-child(4) { top: 359px; }

/* ========================================
   NAV TABS (for edit pages)
   ======================================== */

.nav-tabs .nav-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 1rem;
}

.nav-tabs .nav-link.active {
    color: #21538f;
    border-bottom-color: #21538f;
    font-weight: 600;
    background-color: transparent;
}

.nav-tabs .nav-link:hover:not(.active) {
    border-bottom-color: #cbd5e0;
    color: #2d3748;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3em 0.55em;
    border-radius: 0.35rem;
}

/* ========================================
   SELECT2 OVERRIDES
   ======================================== */

.select2-container--default .select2-selection--single {
    border-radius: 0.45rem;
    border: 1px solid #d1d5db;
    height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    font-size: 0.875rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-dropdown {
    border: 1px solid #d1d5db;
    border-radius: 0.45rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.select2-results__option {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

/* ========================================
   GLOBAL SEARCH
   ======================================== */
.search-result-item:hover {
    background-color: #f0f4ff;
}

#globalSearchResults {
    border: 1px solid #e2e8f0;
    border-radius: 0.45rem;
}

#globalSearchInput::placeholder {
    color: #6b7280;
}

/* ========================================
   NOTIFICATION STYLES
   ======================================== */
#notifBellDropdown:hover {
    opacity: 0.85;
}

.dropdown-item.fw-bold {
    border-left: 3px solid #3182ce;
}

/* ========================================
   CALENDAR STYLES
   ======================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    min-height: 80px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    font-size: 0.8em;
    overflow-y: auto;
    max-height: 120px;
}

.calendar-day.today {
    background: #ebf8ff;
    border-color: #3182ce;
}

.calendar-day-header {
    font-weight: 600;
    font-size: 0.75em;
    text-align: center;
    padding: 4px;
    background: #f7fafc;
    border-radius: 4px;
}

.calendar-event {
    display: block;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 3px;
    font-size: 0.75em;
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event.task { background-color: #3182ce; }
.calendar-event.activity { background-color: #38a169; }
.calendar-event:hover { opacity: 0.85; }

/* ========================================
   ONBOARDING STYLES
   ======================================== */
.onboarding-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.6rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.onboarding-step {
    padding: 0.5rem;
    border-radius: 0.4rem;
    transition: background 0.2s;
}

.onboarding-step:hover {
    background: rgba(255,255,255,0.1);
}

.onboarding-step.completed {
    opacity: 0.7;
    text-decoration: line-through;
}

/* ================================================
   INTERACTION LOG — Professional Upgrade
   ================================================ */

/* --- Hot Log Form --- */
.il-hot-log {
    background: #f8f9fc;
    border: 1px solid #e2e6ea;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.il-type-btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.il-type-btn {
    width: 70px;
    height: 60px;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.65rem;
    color: #6c757d;
    gap: 0.2rem;
}

.il-type-btn i {
    font-size: 1.25rem;
}

.il-type-btn:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.il-type-btn.active {
    border-color: var(--il-type-color, #0d6efd);
    background: color-mix(in srgb, var(--il-type-color, #0d6efd) 8%, white);
    color: var(--il-type-color, #0d6efd);
    box-shadow: 0 0 0 1px var(--il-type-color, #0d6efd);
}

.il-cat-btn-group {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.il-cat-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 50rem;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #6c757d;
}

.il-cat-btn:hover {
    border-color: #adb5bd;
}

.il-cat-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.il-cat-btn.active[data-cat="sales"] { background: #0d6efd; border-color: #0d6efd; }
.il-cat-btn.active[data-cat="support"] { background: #0dcaf0; border-color: #0dcaf0; color: #000; }
.il-cat-btn.active[data-cat="billing"] { background: #ffc107; border-color: #ffc107; color: #000; }
.il-cat-btn.active[data-cat="general"] { background: #6c757d; border-color: #6c757d; }

.il-textarea {
    min-height: 60px;
    max-height: 300px;
    resize: none;
    overflow-y: hidden;
    transition: border-color 0.15s ease;
}

.il-textarea:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.il-save-hint {
    font-size: 0.75rem;
    color: #adb5bd;
}

/* --- Filter Bar --- */
.il-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.il-filter-bar .il-filter-group {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.il-filter-type-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.85rem;
    color: #6c757d;
    padding: 0;
}

.il-filter-type-btn:hover {
    background: #f8f9fa;
}

.il-filter-type-btn.active {
    background: #e7f1ff;
    border-color: #86b7fe;
    color: #0d6efd;
}

.il-filter-cat-btn {
    padding: 0.15rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 50rem;
    background: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #6c757d;
}

.il-filter-cat-btn:hover {
    background: #f8f9fa;
}

.il-filter-cat-btn.active {
    background: #e7f1ff;
    border-color: #86b7fe;
    color: #0d6efd;
}

.il-filter-search,
.il-filter-date {
    height: 32px;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    max-width: 140px;
}

.il-filter-clear {
    font-size: 0.75rem;
    color: #6c757d;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.il-filter-clear:hover {
    color: #dc3545;
}

/* --- Professional Timeline --- */
.il-timeline {
    position: relative;
    padding-left: 40px;
}

.il-timeline::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.il-date-separator {
    position: relative;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0 0.5rem;
    margin: 0;
}

.il-date-separator::before {
    content: '';
    position: absolute;
    left: -31px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #adb5bd;
    border: 2px solid #fff;
}

.il-entry {
    position: relative;
    margin-bottom: 0.5rem;
}

.il-entry-node {
    position: absolute;
    left: -47px;
    top: 0.65rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    z-index: 1;
    box-shadow: 0 0 0 3px #fff;
}

.il-entry-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-left: 3px solid var(--il-entry-color, #6c757d);
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.il-entry-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.il-entry-card.escalated {
    border-left-color: #dc3545 !important;
    background: #fff5f5;
}

.il-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.il-entry-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.il-entry-type-label {
    font-weight: 600;
    font-size: 0.8rem;
}

.il-entry-time {
    color: #6c757d;
    font-size: 0.75rem;
}

.il-entry-user {
    color: #6c757d;
    font-size: 0.75rem;
}

.il-entry-contact {
    color: #6c757d;
    font-size: 0.75rem;
}

.il-entry-details {
    margin-top: 0.375rem;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.il-entry-details.collapsed {
    max-height: 4.5em;
    overflow: hidden;
    position: relative;
}

.il-entry-details.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(transparent, #fff);
}

.il-entry-card.escalated .il-entry-details.collapsed::after {
    background: linear-gradient(transparent, #fff5f5);
}

.il-show-more {
    font-size: 0.75rem;
    color: #0d6efd;
    cursor: pointer;
    display: inline-block;
    margin-top: 0.125rem;
}

.il-show-more:hover {
    text-decoration: underline;
}

.il-entry-actions .btn {
    padding: 0.15rem 0.35rem;
    font-size: 0.75rem;
    line-height: 1;
}

.il-entry-actions .dropdown-menu {
    font-size: 0.8rem;
    min-width: 10rem;
}

/* Inline Edit */
.il-inline-edit {
    display: none;
    margin-top: 0.375rem;
}

.il-entry.editing .il-inline-edit {
    display: block;
}

.il-entry.editing .il-entry-details,
.il-entry.editing .il-show-more {
    display: none;
}

.il-inline-edit textarea {
    width: 100%;
    min-height: 60px;
    font-size: 0.85rem;
    border: 1px solid #86b7fe;
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    resize: vertical;
}

.il-inline-edit .btn-group {
    margin-top: 0.375rem;
}

/* Animation for new entries */
@keyframes il-slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.il-entry.il-new {
    animation: il-slide-in 0.3s ease;
}

/* Fade out for deleted entries */
@keyframes il-fade-out {
    from { opacity: 1; max-height: 200px; }
    to { opacity: 0; max-height: 0; padding: 0; margin: 0; overflow: hidden; }
}

.il-entry.il-removing {
    animation: il-fade-out 0.35s ease forwards;
}

/* Empty state */
.il-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #adb5bd;
}

.il-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

/* ========================================
   DASHBOARD WIDGET CONFIG (edit_user.php)
   ======================================== */

.widget-config-group {
    border: 1px solid #e2e8f0;
    border-radius: 0.45rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: #fafbfc;
}

.widget-config-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.35rem 0;
}

.widget-config-item:last-child {
    border-bottom: none;
}

.widget-config-item .form-check-label {
    font-size: 0.82rem;
    font-weight: 500;
}

.widget-config-item .form-control-sm,
.widget-config-item .form-select-sm {
    font-size: 0.78rem;
    padding: 0.2rem 0.4rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .il-timeline {
        padding-left: 30px;
    }

    .il-timeline::before {
        left: 8px;
    }

    .il-entry-node {
        left: -37px;
        width: 22px;
        height: 22px;
        font-size: 0.6rem;
    }

    .il-date-separator::before {
        left: -26px;
        width: 8px;
        height: 8px;
    }

    .il-type-btn {
        width: 56px;
        height: 50px;
        font-size: 0.6rem;
    }

    .il-type-btn i {
        font-size: 1rem;
    }

    .il-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .il-filter-search,
    .il-filter-date {
        max-width: 100%;
        width: 100%;
    }

    .il-entry-header {
        flex-direction: column;
    }

    .il-entry-actions {
        align-self: flex-end;
    }
}

/* ========================================
   WF UI UTILITIES (v2.91)
   ======================================== */

/* Loading Overlay */
.wf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: inherit;
}

/* Empty State */
.wf-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.wf-empty-state i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.wf-empty-state p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Toast Enhancements */
#wf-toast-container .toast {
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spinner 0.6s linear infinite;
}

@keyframes btn-spinner {
    to { transform: rotate(360deg); }
}

/* Confirm Modal Enhancements */
#wfConfirmModal .modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

#wfConfirmModal .modal-body {
    padding: 1.5rem;
    font-size: 0.95rem;
}

/* Status Badges (Consistent) */
.badge-pending { background-color: #eab308; color: #000; }
.badge-active { background-color: #22c55e; color: #fff; }
.badge-inactive { background-color: #94a3b8; color: #fff; }
.badge-completed { background-color: #10b981; color: #fff; }
.badge-overdue { background-color: #ef4444; color: #fff; }
.badge-in-progress { background-color: #3b82f6; color: #fff; }

/* Clickable Row */
.table-clickable tbody tr {
    cursor: pointer;
    transition: background-color 0.15s;
}

.table-clickable tbody tr:hover {
    background-color: #f1f5f9 !important;
}

/* Card Hover Effect */
.card-hover {
    transition: transform 0.15s, box-shadow 0.15s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Form Validation States */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
    background-image: none;
}

.invalid-feedback {
    font-size: 0.8rem;
}

/* Accessibility: Focus Visible */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to Content Link (Accessibility) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1a2744;
    color: #fff;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

/* ========================================
   TABLE RESPONSIVE SCROLLBAR
   ======================================== */

/* Prevent table from exceeding container width */
.table-responsive > .table {
    width: 100% !important;
    max-width: 100%;
    table-layout: auto;
}

/* Ensure DataTables wrapper doesn't cause overflow */
.dataTables_wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Hide scrollbar track, only show thumb when hovering and content overflows */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.table-responsive:hover {
    scrollbar-color: #c1c1c1 transparent;
}

/* Webkit browsers (Chrome, Safari, Edge) */
.table-responsive::-webkit-scrollbar {
    height: 6px;
    background: transparent;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}

.table-responsive:hover::-webkit-scrollbar-thumb {
    background: #c1c1c1;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ========================================
   TIMER ANIMATIONS
   ======================================== */

/* Blinking indicator for ongoing timer */
.blink {
    animation: blink 1.2s ease-in-out infinite;
    font-size: 0.5rem;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
