/* AriDesk Dashboard V2 - Merged & Finalized (CLEANED UP) */

/* === BASE STYLES === */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #F4F7FC;
    color: #2D3748;
    margin: 0;
    display: flex;
}

a {
    text-decoration: none;
    color: inherit;
}

/* === SIDEBAR LAYOUT === */
.dashboard-sidebar {
    width: 260px;
    background-color: #1A202C;
    color: #E2E8F0;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    font-size: 1.5em;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 2rem;
    text-align: center;
}

.sidebar-nav a {
    display: block;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: #4A55A2;
    color: #FFFFFF;
}

.sidebar-nav i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.sidebar-nav a.primary-action {
    background-color: #4A55A2;
    color: #FFFFFF;
    font-weight: 600;
    text-align: center;
}
.sidebar-nav a.primary-action:hover {
    background-color: #3B4482;
}

/* === MAIN CONTENT LAYOUT === */
.dashboard-main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 30px;
    box-sizing: border-box;
}

.dashboard-main-content.foreign-employees-page,
.dashboard-main-content.wide-page {
    max-width: 95%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2em;
    font-weight: 700;
    color: #1A202C;
}

/* === WELCOME & PAGE HEADERS === */
.welcome-header {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-greeting h1 {
    margin: 0;
    font-size: 2em;
    font-weight: 500;
    color: #2D3748;
}

.welcome-greeting .user-name {
    font-weight: 700;
    color: #4A55A2;
}

.welcome-greeting .wave {
    display: inline-block;
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave-animation {
    0% { transform: rotate(0.0deg); }
    10% { transform: rotate(14.0deg); }
    20% { transform: rotate(-8.0deg); }
    30% { transform: rotate(14.0deg); }
    40% { transform: rotate(-4.0deg); }
    50% { transform: rotate(10.0deg); }
    60% { transform: rotate(0.0deg); }
    100% { transform: rotate(0.0deg); }
}

.bahamas-immigration-logo {
    max-height: 100px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(74, 85, 162, 0.4));
    margin-right: 1.5rem;
}

/* === CARDS & PANELS === */
.dashboard-panel {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    padding: 2rem;
    margin-bottom: 2rem;
}

.panel-title {
    font-size: 1.25em;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1A202C;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #E2E8F0;
}
.section-header {
    font-size: 1.4rem;
    font-weight: 600;
    color: #5e3fd7;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* === STATS & MODULE CARDS === */
.stats-grid, .modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.stat-card .stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #4A55A2;
}

.stat-card .stat-label {
    font-size: 1em;
    color: #718096;
}

.module-card {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.module-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.module-card-icon {
    font-size: 1.5em;
    color: #FFFFFF;
    background-color: #4A55A2;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.module-card h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
}

.module-card p {
    font-size: 0.9em;
    color: #718096;
    margin: 0;
    line-height: 1.4;
}

/* === TABLES & EMPLOYEE DISPLAY === */
.activity-table, .employee-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.activity-table td {
    padding: 12px 0;
    border-bottom: 1px solid #E2E8F0;
    font-size: 0.9em;
}

.activity-table tr:last-child td {
    border-bottom: none;
}

.employee-table th, .employee-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #E2E8F0;
    text-align: left;
    vertical-align: middle;
}

.employee-table thead th {
    font-size: 14px;
    background-color: #F8F9FA;
    font-weight: 600;
    text-transform: uppercase;
    color: #4A55A2;
}

.employee-table tbody td {
    font-size: 13px;
}

.employee-table tbody tr:hover {
    background-color: #e9e7f5;
}

.employee-photo, .employee-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.placeholder-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #e2e8f0;
    color: #718096;
}

.profile-photo-lg {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #E2E8F0;
}

.placeholder-photo-lg {
    width: 250px;
    height: 250px;
    border-radius: 8px;
    font-size: 6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #e2e8f0;
    color: #718096;
    border: 2px solid #E2E8F0;
}

.employee-name {
    font-weight: 600;
}

.employee-table .text-success { color: #38A169 !important; }
.employee-table .text-danger { color: #E53E3E !important; }

.nationality-flag {
    display: none;
}

.nationality-coat-of-arms {
    height: 150px;
    width: auto;
    vertical-align: middle;
    filter: drop-shadow(0 0 5px rgba(74, 85, 162, 0.3));
}

.immigration-manage-table th, .immigration-manage-table td {
    font-size: 0.8em;
    padding: 6px 4px;
    white-space: nowrap;
    text-align: center;
}
.immigration-manage-table td {
    white-space: normal;
    word-break: break-word;
}
.immigration-manage-table th:first-child, .immigration-manage-table td:first-child {
    min-width: 120px; max-width: 160px; text-align: left;
}
.immigration-manage-table th:nth-child(n+5):nth-child(-n+13),
.immigration-manage-table td:nth-child(n+5):nth-child(-n+13) {
    min-width: 50px; max-width: 60px;
}
.immigration-manage-table td .text-success, .immigration-manage-table td .text-danger {
    font-size: 1.2em;
}

/* === SEARCH BAR === */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 1.5rem;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-button { /* Missing Glow on Buttons */
    background-color: #5e3fd7; /* New color */
    color: white;
    border: none;
    border-radius: 0.5rem; /* New border-radius */
    padding: 0.6rem 1.2rem; /* New padding */
    font-weight: 500;
    box-shadow: 0 0 10px rgba(94, 63, 215, 0.4); /* New glow */
}
.search-button:hover,
.btn-view:hover {
    background-color: #462fc4; /* Darker hover color */
    box-shadow: 0 0 12px rgba(94, 63, 215, 0.6); /* Intensified glow */
    transform: translateY(-2px); /* Lift effect */
    color: #FFFFFF; /* Ensure text color remains white on hover */
}

/* === BUTTONS & BADGES === */
.badge, .stage-badge, .location-tag {
  display: inline-block;
  padding: 0.4em 0.8em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 12px;
  text-transform: capitalize;
  color: #fff;
}
.trident-badge-success, .location-on-island, .stage-badge.on-island-completed { background-color: #38A169; }
.trident-badge-primary, .stage-badge.pending-travel { background-color: #4299E1; }
.trident-badge-info, .stage-badge.pending-labour-approval { background-color: #319795; }
.trident-badge-secondary, .location-n-a { background-color: #718096; }
.stage-badge.preparation { background-color: #4A55A2; }
.stage-badge.pending-processing-fee, .stage-badge.pending-document-fee { background-color: #DD6B20; }
.stage-badge.pending-arrival, .location-off-island { background-color: #E53E3E; }

.action-buttons a, .action-buttons button, .btn-view, .btn-edit, .btn-delete, .btn-leave {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 6px 12px;
    margin: 2px;
    border-radius: 6px;
    border: none;
    font-size: 0.85em;
    font-weight: 500;
    color: #FFFFFF;
    transition: opacity 0.2s ease, transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    text-decoration: none;
}
.btn-view { background-color: #5e3fd7; }
.btn-edit { background-color: #38A169; }
.btn-delete { background-color: #E53E3E; }
.btn-leave { background-color: #319795; }

.action-buttons a:hover, .action-buttons button:hover, .btn-edit:hover, .btn-delete:hover, .btn-leave:hover {
    opacity: 0.85;
    color: #FFFFFF;
}

/* === FORMS === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #4A5568;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4A55A2;
    box-shadow: 0 0 0 2px rgba(74, 85, 162, 0.2);
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    cursor: pointer;
}

.form-actions {
    grid-column: 1 / -1;
    text-align: right;
    margin-top: 1rem;
}

.form-bordered {
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    padding: 20px;
    background-color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    margin-top: 1.5rem;
}

/* === VIEW PAGE DETAILS & FILES === */
.details-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 20px;
    align-items: center;
}
.details-grid strong {
    font-weight: 600;
    text-align: right;
    color: #4A55A2;
}
.details-grid span {
    color: #2D3748;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.file-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #E2E8F0;
}
.file-list-item:last-child {
    border-bottom: none;
}
.file-list-item a {
    color: #4A55A2;
    font-weight: 500;
}
.file-list-item a:hover {
    text-decoration: underline;
}

/* === DATA TABLES UI === */
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info {
    color: #718096;
    margin-bottom: 1rem;
}
.dataTables_wrapper .form-control, .dataTables_wrapper .form-select {
    border: 1px solid #E2E8F0;
    border-radius: 6px;
}
.dataTables_wrapper .dt-buttons {
    float: right;
    margin-left: 1rem;
}
.dataTables_wrapper .dt-buttons .btn-view {
    padding: 0.4rem 0.8rem;
    font-size: 0.85em;
}
.dataTables_wrapper .dt-buttons .btn-view:hover {
    opacity: 0.9;
}
.dataTables_wrapper .pagination .page-link {
    color: #4A55A2;
}
.dataTables_wrapper .pagination .page-item.active .page-link {
    background-color: #4A55A2;
    border-color: #4A55A2;
    color: white;
}

/* === IMMIGRATION TRACKER SPECIFIC === */
.progress {
    background-color: #e9ecef;
    border-radius: 6px;
    height: 1.25rem;
}
.progress-bar {
    font-weight: 500;
    color: white;
}
.progress-bar.bg-theme-success {
    background-color: #38A169 !important;
}
.progress-bar.bg-theme-info {
    background-color: #4A55A2 !important;
}

/* === TAB NAVIGATION === */
.nav-tabs {
    border-bottom: 2px solid #E2E8F0;
}
.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #718096;
    font-weight: 500;
}
.nav-tabs .nav-link.active, .nav-tabs .nav-link:hover {
    border-color: #4A55A2;
    color: #4A55A2;
    background-color: transparent;
}

/* === ICON LEGEND === */
.icon-legend {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #F8F9FA;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}
.icon-legend h5 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.legend-item {
    display: flex;
    align-items: center;
    margin-right: 1.5rem;
    font-size: 0.9em;
}
.legend-item i {
    margin-right: 0.5rem;
    font-size: 1.1em;
}

/* === MOBILE RESPONSIVENESS === */
@media (max-width: 768px) {
    .dashboard-main-content.foreign-employees-page {
        padding: 15px;
    }
    .employee-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .form-input, .form-select {
        padding: 12px 15px;
    }
}

/* === Custom Additions (From Directive) === */
.track-status-btn.disabled {
    pointer-events: none;
    opacity: 0.5;
    position: relative;
}
.track-status-btn.disabled::after {
    content: "";
    position: absolute;
    top: -6px;
    right: -10px;
    font-size: 1rem;
    color: #dc3545;
}
.track-status-btn.disabled:hover {
    cursor: not-allowed;
}

/* OFFICIAL DIRECTIVE: TRIDENT-B80-PDFGEN
  Additions for dashboard_v2.css
  To be appended to the existing stylesheet.
*/
/* === Custom Form Containers (as per directive) === */
.form-container-b80 {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 0 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.form-container-b80:hover {
    box-shadow: 0 0 18px rgba(0,0,0,0.1);
}
/* === UI Enhancements for Buttons & Modals === */
.btn {
    position: relative;
    transition: all 0.2s ease;
}
.btn .btn-text.d-none {
    visibility: hidden;
}
.btn .spinner-border {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.modal-body .img-fluid {
    max-height: 75vh;
}

/* === Trident Logo Glow Integration === */
.trident-logo-glow {
    width: 120px;
    max-width: 100%;
    filter: drop-shadow(0 0 8px rgba(74, 85, 162, 0.5));
    transition: filter 0.3s ease;
}
.trident-logo-glow:hover {
    filter: drop-shadow(0 0 14px rgba(74, 85, 162, 0.7));
}

/* === FULLCALENDAR RESOURCE ALIGNMENT OVERRIDES FOR SCHEDULING === */

/* Uniform row height and alignment for resources and time slots */
.fc .fc-resource-area tr,
.fc .fc-scrollgrid-section-body tr,
.fc .fc-scrollgrid-sync-table tr,
.fc .fc-resource-cell,
.fc .fc-timeline-slot,
.fc .fc-timeline-lane,
.fc .fc-timeline-lane-frame,
.fc .fc-resource-title,
.fc-resource,
.fc .fc-datagrid-cell-main,
.fc .fc-resource-area .fc-datagrid-cell,
.fc .fc-datagrid-cell {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    vertical-align: middle !important;
    box-sizing: border-box;
    font-size: 1.01em;
    line-height: 40px !important;
}

.fc .fc-resource-title {
    display: flex;
    align-items: center;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 10px !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
}

.fc .fc-resource-cell {
    display: flex !important;
    align-items: center !important;
    padding: 0 8px !important;
    overflow: hidden;
}

.avatar-circle {
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
    font-size: 1em !important;
    margin-right: 7px !important;
    margin-left: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    flex-shrink: 0;
    background: #e0e0e0;
    color: #393939;
    font-weight: bold;
    border-radius: 50%;
    box-shadow: 0 0 2px #ccc;
}

.fc .fc-datagrid-cell-main {
    line-height: 40px !important;
}

.resource-name-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 170px;
    vertical-align: middle;
}

/* Ensure timegrid slots also match resource row height */
.fc-timegrid-slot {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
}

/* Force vertical centering for all resource and timeline grid cells */
.fc .fc-resource-cell,
.fc .fc-timeline-slot,
.fc .fc-timeline-lane,
.fc .fc-timeline-lane-frame,
.fc .fc-datagrid-cell-main {
    display: flex !important;
    align-items: center !important;
}