* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-icon img {
    height: 28px; /* Adjust this value to match your specific logo's proportions */
    width: auto;
    display: block;
    object-fit: contain;
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.sidebar-nav {
    padding: 20px 16px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item i:first-child {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background-color: #f3f4f6;
    color: var(--text-main);
}

.nav-item.active {
    color: var(--primary-red);
    background-color: #fef2f2;
}

body[data-nav="dashboard"] #nav-dashboard,
body[data-nav="travel"] #nav-travel,
body[data-nav="training"] #nav-training,
body[data-nav="claim"] #nav-claim,
body[data-nav="approval"] #nav-approval,
body[data-nav="finance"] #nav-finance,
body[data-nav="reports"] #nav-reports,
body[data-nav="admin"] #adminDropdownBtn {
    color: var(--primary-red);
    background-color: #fef2f2;
}

.nav-group-title {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 700;
    margin: 24px 0 8px 16px;
    letter-spacing: 0.05em;
}

.badge {
    background-color: var(--primary-red);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================= MAIN CONTENT ================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

body[data-layout="sticky-action"] .main-content {
    padding-bottom: 80px;
    position: relative;
}

.top-header {
    background-color: var(--bg-surface);
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #d1d5db;
}

.breadcrumb .current {
    color: var(--text-main);
    font-weight: 500;
}

.page-content {
    padding: 24px 32px;
    max-width: 2000px;
}

.page-title-section {
    margin-bottom: 24px;
}

.title-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.title-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.title-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.title-left p {
    color: var(--text-muted);
}

/* ================= TABS & ACTIONS ================= */
.tabs-actions-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    list-style: none;
    gap: 24px;
}

.tab {
    padding: 12px 0;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    position: relative;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--primary-red);
    border-bottom: 2px solid var(--primary-red);
    font-weight: 700;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-outline {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f3f4f6;
}

.btn-primary {
    background: var(--primary-red);
    border: 1px solid var(--primary-red);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-red-hover);
}

/* ================= DATA CONTAINER ================= */
.data-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

/* Filters */
.filters-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.search-group {
    flex: 1;
    position: relative;
    justify-content: flex-end;
}

.search-icon {
    position: absolute;
    left: 12px;
    bottom: 10px;
    color: var(--text-muted);
}

.search-group input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
}

.filter-group select {
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 16px;
    min-width: 200px;
}

.reset-btn {
    height: 35px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.data-table th {
    background-color: var(--table-header-bg);
    color: white;
    text-align: left;
    padding: 12px 16px;
    font-weight: 500;
    font-size: 0.85rem;
}

.data-table th:first-child { border-top-left-radius: 0px; border-bottom-left-radius: 0px; }
.data-table th:last-child { border-top-right-radius: 0px; border-bottom-right-radius: 0px; }

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Avatar Colors Setup */
.bg-blue { background: var(--avatar-blue); color: var(--avatar-blue-text); }
.bg-orange { background: var(--avatar-orange); color: var(--avatar-orange-text); }
.bg-purple { background: var(--avatar-purple); color: var(--avatar-purple-text); }
.bg-gray { background: var(--avatar-gray); color: var(--avatar-gray-text); }
.bg-pink { background: var(--avatar-pink); color: var(--avatar-pink-text); }

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .name {
    font-weight: 700;
}

.user-details .email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-active { background: var(--status-active-bg); color: var(--status-active-text); }
.status-inactive { background: var(--status-inactive-bg); color: var(--status-inactive-text); }

.actions-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
}

.action-btn:hover { background: #f3f4f6; }
.delete-btn { color: var(--primary-red); }
.delete-btn:hover { background: #fef2f2; border-color: #fca5a5; }

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.showing-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pagination {
    display: flex;
    gap: 4px;
}

.page-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-family: inherit;
    transition: 0.2s;
}

.page-btn:hover {
    background: #f3f4f6;
}

.page-btn.active {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

/* ================= SUMMARY CARDS ================= */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.summary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.card-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.bg-icon-blue { background: #e0f2fe; color: #0284c7; }
.bg-icon-green { background: #dcfce7; color: #16a34a; }
.bg-icon-purple { background: #f3e8ff; color: #9333ea; }
.bg-icon-orange { background: #ffedd5; color: #ea580c; }

.card-info {
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 4px 0;
}

.card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-link {
    font-size: 0.8rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-link:hover {
    text-decoration: underline;
}

/* ================= SIDEBAR DROPDOWN ================= */
.nav-dropdown {
    display: flex;
    flex-direction: column;
}

.nav-sub-menu {
    display: none; /* Hidden by default */
    flex-direction: column;
    padding-left: 44px; /* Indent to align with text */
    margin-top: 4px;
    margin-bottom: 8px;
    gap: 4px;
}

/* Class to toggle visibility */
.nav-sub-menu.show {
    display: flex;
}

body[data-subnav] #adminSubMenu {
    display: flex;
}

.sub-nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sub-nav-item:hover {
    color: var(--text-main);
    background-color: #f3f4f6;
}

.sub-nav-item.active {
    color: var(--primary-red);
    font-weight: 700;
}

body[data-subnav="users"] #subnav-users,
body[data-subnav="role"] #subnav-role,
body[data-subnav="tcategories"] #subnav-tcategories,
body[data-subnav="budget"] #subnav-budget,
body[data-subnav="designation"] #subnav-designation,
body[data-subnav="departments"] #subnav-departments,
body[data-subnav="claimpolicy"] #subnav-claimpolicy,
body[data-subnav="audit"] #subnav-audit {
    color: var(--primary-red);
    font-weight: 700;
}

/* Chevron Rotation Animation */
.chevron-icon {
    transition: transform 0.3s ease;
}

.chevron-icon.rotate {
    transform: rotate(180deg);
}

body[data-subnav] #adminDropdownBtn .chevron-icon {
    transform: rotate(180deg);
}

/* ================= ROLES LAYOUT ================= */
.roles-layout { 
    display: flex; 
    gap: 24px; 
    align-items: flex-start; 
}

/* Left Sidebar (Roles List) */
.roles-sidebar { 
    width: 280px; 
    background: var(--bg-surface); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
}
.roles-list-header { 
    padding: 20px; 
    border-bottom: 1px solid var(--border-color); 
}
.roles-list-header h3 { 
    font-size: 1rem; 
    color: #0f172a; 
    font-weight: 700; 
}

.role-list { 
    list-style: none; 
    display: flex; 
    flex-direction: column; 
}
.role-list-item { 
    padding: 14px 20px; 
    border-bottom: 1px solid var(--border-color); 
    border-left: 3px solid transparent; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    cursor: pointer; 
    font-weight: 500; 
    transition: all 0.2s; 
    font-size: 0.9rem; 
    color: #334155; 
}
.role-list-item:hover { 
    background-color: #f9fafb; 
}
.role-list-item.active { 
    background-color: #fef2f2; 
    border-left-color: var(--primary-red); 
    color: #0f172a; 
}
.badge-default { 
    background: #dcfce7; 
    color: #16a34a; 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-size: 0.7rem; 
    font-weight: 700; 
}
.role-list-footer { 
    padding: 16px 20px; 
}
.btn-text-red { 
    background: none; 
    border: 1px solid var(--border-color); 
    color: var(--primary-red); 
    width: 100%; 
    justify-content: center; 
    font-weight: 600; 
    padding: 8px 16px; 
    border-radius: 6px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.btn-text-red:hover { 
    background-color: #fef2f2; 
}

/* Right Content (Role Details) */
.roles-content-main { 
    flex: 1; 
    background: var(--bg-surface); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
}

.permission-page-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.permission-context-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    max-width: 520px;
}

.permission-context-field {
    min-width: 0;
}

.permission-context-helper {
    margin: 8px 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.permission-content-card {
    width: 100%;
}
.role-details-header, .permissions-header { 
    padding: 20px 24px; 
    border-bottom: 1px solid var(--border-color); 
}
.role-details-header h3, .permissions-header h3 { 
    font-size: 1rem; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: #0f172a; 
    font-weight: 700;
}
.info-icon { 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    cursor: help; 
}

/* Form Fields */
.role-details-form { 
    padding: 24px; 
    border-bottom: 1px solid var(--border-color); 
}

.permission-role-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.permission-role-tab {
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.permission-role-tab:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.permission-role-tab.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.table-row-selected {
    background: #f8fbff;
}

.form-row { 
    display: flex; 
    gap: 24px; 
    align-items: flex-start;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    font-weight: 500; 
}
.form-group input { 
    width: 100%; 
    padding: 10px 12px; 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    font-family: inherit; 
    font-size: 0.9rem; 
    color: #0f172a; 
    outline: none; 
}
.form-group input:focus { 
    border-color: #94a3b8; 
}
.text-red { color: var(--primary-red); }

/* Table overrides for Permissions */
.text-center-cells th:not(.text-left), 
.text-center-cells td:not(.text-left) { 
    text-align: center; 
}
.text-left { text-align: left; }
.font-medium { 
    font-weight: 500; 
    color: #334155; 
}

/* Custom Checkbox mapping to image style */
.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background-color: var(--primary-red);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
}
.custom-checkbox:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.permissions-footer { 
    padding: 20px 24px; 
    display: flex; 
    justify-content: flex-end; 
    border-top: 1px solid var(--border-color); 
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 1024px) {
    .permission-context-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
}

/* Delete Button Style */
.btn-danger-outline {
    background: var(--bg-surface);
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
}
.btn-danger-outline:hover {
    background: #fef2f2;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-surface);
    border-left: 4px solid #10b981; /* Success Green */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 16px 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(120%);
    animation: slideInRight 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.toast i {
    color: #10b981;
    font-size: 1.2rem;
}

.toast span {
    font-weight: 500;
    color: #0f172a;
    font-size: 0.9rem;
}

.toast.fade-out {
    animation: fadeOutRight 0.3s forwards;
}

@keyframes slideInRight {
    to { transform: translateX(0); }
}

@keyframes fadeOutRight {
    to { transform: translateX(120%); opacity: 0; }
}

/* ================= CUSTOM MODAL ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5); /* Dark semi-transparent */
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon-warning {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fee2e2;
    color: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.modal-header h3 {
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 700;
}

.modal-body {
    padding: 16px 24px 24px;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Utility Text Classes */
.text-muted {
    color: var(--text-muted);
}
.font-medium {
    font-weight: 500;
    color: #334155;
}

/* ================= CUSTOM MULTI-SELECT DROPDOWN ================= */
.custom-multi-select {
    position: relative;
    margin-bottom: 24px;
}

.select-box {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
    user-select: none;
    outline: none;
}

.select-box .selected-text {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
}

.select-box .chevron-icon {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.select-box.open {
    border-color: #94a3b8;
}

.select-box.open .chevron-icon {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    flex-direction: column;
    padding: 6px;
}

.select-dropdown.show {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: background-color 0.2s;
    user-select: none;
}

.dropdown-item:hover {
    background-color: #f8fafc;
}

.dropdown-item .custom-checkbox {
    margin: 0;
}

/* ================= UI BUG FIXES ================= */

/* 1. Fix Modal Clipping (Allows dropdown to show fully) */
.modal-box {
    overflow: visible !important;
}

/* Ensure the modal corners stay rounded when overflow is visible */
.modal-header {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-footer {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* 2. Fix Dropdown Checkbox Stretching & Styling */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: background-color 0.2s;
    user-select: none;
    width: 100%;
}

/* 3. Proper Checked/Unchecked states for the checkboxes */
.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px !important;
    height: 18px !important;
    background-color: var(--bg-surface) !important;
    /* White background when unchecked */
    border: 2px solid var(--border-color) !important;
    /* Gray border */
    border-radius: 4px !important;
    position: relative;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    flex-shrink: 0 !important;
    /* Prevents it from stretching into a long rectangle */
    transition: all 0.2s ease;
}

/* Red background only applies when checked */
.custom-checkbox:checked {
    background-color: var(--primary-red) !important;
    border-color: var(--primary-red) !important;
}

.custom-checkbox:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Table input styling */
.policy-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.policy-loc-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Ensure consistency for the nested header */
.data-table thead tr th {
    text-align: left;
}

/* Update this in styles.css to create cell outlines */
.data-table th,
.data-table td {
    border: 1px solid var(--border-color);
}

/* Ensure the table itself handles the borders correctly */
.data-table {
    border-collapse: collapse;
    width: 100%;
}

/* Sidebar Footer Layout */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Compact Button Styles */

.btn-text-red {
    background: transparent;
    border: none;
    color: var(--primary-red);
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: opacity 0.2s;
    text-decoration: none !important;
    /* Forces removal of underline */
}

.btn-text-red:hover {
    opacity: 0.8;
    text-decoration: none !important;
    /* Ensures no underline on hover */
}

/* ================= TRAVEL & BUDGET MODULE ================= */

/* 1. Global Form Inputs for Travel Module */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    color: var(--text-main);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.custom-select:focus {
    border-color: #94a3b8;
}

/* 2. Header & Stepper Setup */
.travel-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
}

.stepper-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.step.active .step-circle {
    background: #0f172a;
    color: white;
}

.step.pending .step-circle {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

.step-label {
    display: flex;
    flex-direction: column;
}

.step-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

.step.pending .step-title {
    color: #94a3b8;
}

.step-status {
    font-size: 0.75rem;
    color: #3b82f6;
}

.step.pending .step-status {
    color: #94a3b8;
}

.step-line {
    width: 30px;
    height: 1px;
    background: #e2e8f0;
}

/* 3. Alert Box */
.info-alert {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    color: #1e3a8a;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.info-alert i {
    color: #3b82f6;
    margin-top: 3px;
}

/* 4. Layout Grid & Form Cards */
.travel-layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
    /* Prevents columns from stretching unevenly */
}

.form-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.step-circle-small {
    width: 24px;
    height: 24px;
    background: #0f172a;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.form-card-header h2 {
    font-size: 1rem;
    color: #0f172a;
    margin: 0;
}

.travel-card-subtitle {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.form-card-body {
    padding: 24px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

/* 5. Custom Selects & Read-only Inputs */
.input-readonly {
    background-color: #f8fafc !important;
    color: #475569 !important;
    cursor: not-allowed;
    border-color: #e2e8f0 !important;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    cursor: pointer;
    color: var(--text-main);
}

.select-wrapper i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.8rem;
}

/* 6. Transport Radio Buttons */
.transport-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.transport-option input[type="radio"] {
    display: none;
}

.transport-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s;
    user-select: none;
}

.transport-option input[type="radio"]:checked+.transport-btn {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

/* 7. Right Column Widgets */
.widget-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.travel-schedule-card .form-card-body {
    padding: 20px 22px 24px;
}

.travel-schedule-rules {
    margin-bottom: 18px;
}

.master-departure-card {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.master-departure-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.master-departure-select-wrap {
    position: relative;
    margin-top: 2px;
    max-width: 250px;
}

.master-departure-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 8px 34px 8px 10px;
    outline: none;
}

.master-departure-select-wrap i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    font-size: 0.85rem;
}

.master-departure-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.68rem;
    font-weight: 700;
}

.master-departure-grid {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 14px 16px;
}

.trip-overview-grid {
    grid-template-columns: minmax(220px, 280px) 1fr;
}

.trip-country-field {
    max-width: 280px;
}

.trip-purpose-field {
    min-width: 0;
}

.trip-notes-field {
    grid-column: 1 / -1;
}

.master-departure-input {
    width: 100%;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    padding: 8px 10px;
    outline: none;
}

.trip-notes-field textarea {
    width: 100%;
    display: block;
}

.master-departure-header .master-departure-select-wrap {
    display: none;
}

.master-departure-layout {
    grid-template-columns: minmax(260px, 320px) 210px;
}

.master-location-field .master-departure-select-wrap {
    display: block;
    max-width: none;
    margin-top: 0;
}

.master-note-field {
    grid-column: 1 / -1;
}

.schedule-rule-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 0;
    border-radius: 0;
    background: transparent;
    border: 1px solid #dbe3ee;
    border-width: 0 0 1px 0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
}

.destination-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.destination-tabs-shell {
    margin-bottom: 16px;
}

.destination-tabs-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.destination-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.destination-tab-btn {
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.destination-tab-btn.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.add-destination-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.add-destination-pill:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.destination-block {
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    padding: 16px 18px 18px;
    background: #ffffff;
}

.destination-block.hidden-destination {
    display: none;
}

.destination-block.is-return-destination {
    border-color: #fecaca;
    background: #fffafa;
}

.destination-block-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.destination-kicker {
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.destination-block-input {
    border: none;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0;
    outline: none;
}

.destination-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.destination-type-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.66rem;
    font-weight: 700;
}

.return-tag {
    background: #fee2e2;
    color: #b91c1c;
}

.destination-remove-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
}

.destination-remove-btn:hover {
    color: var(--primary-red);
    border-color: #fecaca;
    background: #fff5f5;
}

.destination-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 240px;
    gap: 14px 16px;
    margin-bottom: 16px;
}

.schedule-grid-header,
.schedule-row {
    display: grid;
    grid-template-columns: 120px 1fr 140px 34px;
    gap: 8px;
    align-items: center;
}

.schedule-grid-header {
    padding: 0 2px 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-row {
    padding: 6px 0;
    border-bottom: 1px solid #eef2f7;
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-date-input,
.schedule-details-input,
.schedule-status-select,
.destination-input,
.destination-date-input {
    width: 100%;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    padding: 7px 10px;
    outline: none;
}

.schedule-date-input,
.schedule-status-select {
    min-height: 34px;
}

.schedule-details-input {
    min-height: 34px;
}

.schedule-status-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
}

.schedule-action-col {
    display: flex;
    justify-content: center;
}

.schedule-add-row {
    margin-top: 12px;
}

.destination-attachments {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
}

.destination-accommodation {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
}

.accommodation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accommodation-entry {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    background: #f8fbff;
}

.accommodation-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.accommodation-entry-title {
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.destination-accommodation-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 0.8fr 0.8fr;
    gap: 12px 14px;
}

.destination-policy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    margin-top: 14px;
}

.weekend-policy-note {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
}

.weekend-policy-textarea {
    width: 100%;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    padding: 8px 10px;
    outline: none;
    resize: vertical;
}

.destination-attachments-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.destination-attachments-header span {
    color: #0f172a;
    font-weight: 700;
    font-size: 0.8rem;
}

.schedule-attachment-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.attachment-pill,
.file-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    padding: 6px 9px;
    font: inherit;
    font-weight: 600;
    font-size: 0.82rem;
}

.file-pill {
    background: #fff;
}

.file-pill span {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill-close {
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
}

.destination-widget {
    padding: 22px 22px 20px;
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.destination-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.destination-input,
.destination-date-input {
    font-size: 0.95rem;
}

.destination-field {
    margin-top: 14px;
}

.destination-field label,
.return-toggle-row label {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.9rem;
}

.return-toggle-row {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.return-toggle-help {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: -2px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 999px;
    transition: 0.2s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.toggle-switch input:checked + .toggle-slider {
    background: #16a34a;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.destination-submit-btn {
    width: 100%;
    margin-top: 18px;
}

.schedule-note-inline {
    margin-top: 12px;
    color: #64748b;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .destination-block-header,
    .destination-attachments-header,
    .master-departure-header {
        flex-direction: column;
        align-items: stretch;
    }

    .destination-meta-grid,
    .destination-accommodation-grid,
    .destination-policy-grid,
    .master-departure-grid,
    .schedule-grid-header,
    .schedule-row {
        grid-template-columns: 1fr;
    }

    .schedule-action-col {
        justify-content: flex-end;
    }
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.widget-header h3 {
    font-size: 1rem;
    margin: 0;
    color: #0f172a;
}

.timeline-vertical {
    display: flex;
    flex-direction: column;
    position: relative;
}

.timeline-vertical::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 10px;
    bottom: 30px;
    width: 1px;
    background: #e2e8f0;
}

.timeline-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
}

.timeline-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.timeline-marker.active {
    background: #0f172a;
    color: white;
}

.timeline-content h4 {
    font-size: 0.9rem;
    margin: 0 0 4px 0;
    color: #0f172a;
}

.timeline-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.info-list {
    margin: 0;
    padding-left: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* 8. Bottom Sticky Action Bar */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 260px;
    /* Sidebar width offset */
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .travel-layout-grid {
        grid-template-columns: 1fr;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .bottom-action-bar {
        left: 0;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ================= TRAVEL LISTING STYLES ================= */

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 12px;
}

.kpi-value {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.kpi-subtext {
    font-size: 0.8rem;
    margin-top: auto;
}

/* Custom Tabs */
.custom-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 0;
    font-family: inherit;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #0f172a;
}

.tab-btn.active {
    color: #0f172a;
    font-weight: 600;
    border-bottom-color: #0f172a;
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pill i {
    font-size: 0.4rem;
}

/* Small dot size */

.pill-draft {
    background: #f1f5f9;
    color: #475569;
}

.pill-draft i {
    color: #64748b;
}

.pill-pending {
    background: #fef3c7;
    color: #d97706;
}

.pill-pending i {
    color: #f59e0b;
}

.pill-approved {
    background: #dcfce7;
    color: #15803d;
}

.pill-approved i {
    color: #22c55e;
}

.pill-booking {
    background: #f3e8ff;
    color: #7e22ce;
}

.pill-booking i {
    color: #a855f7;
}

.pill-cash {
    background: #ffedd5;
    color: #c2410c;
}

.pill-cash i {
    color: #f97316;
}

.pill-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.pill-rejected i {
    color: #ef4444;
}

.pill-completed {
    background: #e0e7ff;
    color: #4338ca;
}

.pill-completed i {
    color: #6366f1;
}

/* Table adjustments for Travel listing */
.travel-table th,
.travel-table td {
    border: none;
    /* Removes the grid lines previously added, matching this specific UI */
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    font-size: 0.85rem;
}

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

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= TRAVEL MODULE: STEP 2 STYLES ================= */

/* Completed Step Styling */
.step.completed .step-circle {
    background: #10b981;
    color: white;
    border: none;
}

/* Budget Available Card */
.budget-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.budget-progress-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.budget-progress-bar {
    height: 100%;
    background: #10b981;
    /* Gray progress fill matching the image */
    border-radius: 4px;
}

.budget-subtext {
    font-size: 0.8rem;
}

/* Schedule Table */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table th {
    text-align: left;
    padding: 12px 24px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    border-bottom: 1px solid var(--border-color);
}

.schedule-table td {
    padding: 12px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.schedule-table tr:last-child td {
    border-bottom: 1px solid var(--border-color);
}

.schedule-input-invisible {
    width: 100%;
    border: none !important;
    padding: 4px 0 !important;
    background: transparent !important;
    color: #0f172a !important;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.schedule-input-invisible:focus {
    border-bottom: 1px solid #94a3b8 !important;
    border-radius: 0 !important;
}

.delete-row-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.delete-row-btn:hover {
    color: var(--primary-red);
}

.add-row-container {
    padding: 16px 24px;
}

.btn-text-blue {
    background: transparent;
    border: none;
    color: #3b82f6;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-text-blue:hover {
    text-decoration: underline;
}

/* Trip Summary Widget */
.summary-widget {
    padding: 24px;
}

.summary-group {
    margin-bottom: 16px;
}

.summary-group h5 {
    font-size: 0.7rem;
    color: #64748b;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-group p {
    font-size: 0.9rem;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
}

/* ================= TRAVEL MODULE: STEP 3 STYLES ================= */

/* Segmented Toggle Buttons */
.toggle-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toggle-option {
    display: flex;
}

.toggle-option input[type="radio"] {
    display: none;
}

.toggle-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s;
    user-select: none;
}

.toggle-option:last-child .toggle-btn {
    border-right: none;
}

.toggle-option input[type="radio"]:checked+.toggle-btn {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

/* Warning Alert */
.warning-alert {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    color: #92400e;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 16px;
}

.warning-alert i {
    color: #d97706;
    margin-top: 2px;
}

.warning-alert p {
    margin: 0;
}

/* ================= TRAVEL MODULE: AMOUNT INPUT ================= */
.input-with-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: white;
    transition: border-color 0.2s;
}

.input-with-prefix:focus-within {
    border-color: #94a3b8;
}

.input-with-prefix .prefix {
    padding: 10px 16px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    user-select: none;
}

.input-with-prefix input {
    border: none !important;
    border-radius: 0 !important;
    width: 100%;
    padding: 10px 12px !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 0.95rem;
}

/* ================= TRAVEL MODULE: STEP 4 DOCUMENTS STYLES ================= */

.doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    transition: all 0.2s;
}

.doc-row:last-child {
    margin-bottom: 0;
}

.doc-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.doc-icon {
    font-size: 1.25rem;
    color: #94a3b8;
}

.doc-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
}

.doc-meta {
    font-size: 0.8rem;
    color: #64748b;
}

/* Uploaded State */
.doc-uploaded {
    background-color: #ecfdf5;
    /* Light green bg */
    border-color: #a7f3d0;
}

.doc-uploaded .doc-title,
.doc-uploaded .doc-meta {
    color: #065f46;
}

/* Pending State */
.doc-pending {
    background-color: white;
}

/* Awaiting/Disabled State */
.doc-awaiting {
    background-color: #fafafa;
    opacity: 0.7;
}

.doc-awaiting .doc-title,
.doc-awaiting .doc-meta {
    color: #94a3b8;
}

/* Document Buttons & Badges */
.btn-upload {
    padding: 6px 16px;
    font-size: 0.8rem;
    color: #475569;
    background: white;
}

.doc-action-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}

.doc-action-btn:hover {
    color: #0f172a;
}

.badge-awaiting {
    background-color: #f1f5f9;
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ================= TRAVEL MODULE: STEP 5 REVIEW STYLES ================= */
.review-header {
    justify-content: space-between;
}

.btn-edit {
    padding: 6px 16px;
    font-size: 0.8rem;
    color: #475569;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.review-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.review-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.review-value {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 500;
}

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

.review-schedule-table th {
    text-align: left;
    padding-bottom: 12px;
    font-size: 0.7rem;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.review-schedule-table td {
    padding: 12px 0;
    font-size: 0.9rem;
    color: #0f172a;
    border-top: 1px solid #f1f5f9;
}

.review-schedule-table tr:first-child td {
    border-top: none;
}

@media (max-width: 768px) {

    .review-grid,
    .review-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ================= SUCCESS MODAL STYLES ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    /* Controlled by JS */
    align-items: center;
    justify-content: center;
    z-index: 99999;
    /* Ensure it is the absolute highest element */
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    /* Added to keep content stable */
    z-index: 100000;
    /* Must be higher than the overlay */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    animation: slideUp 0.3s ease forwards;
}

.modal-content .btn-primary {
    position: relative;
    z-index: 100005;
    /* Force it above everything else */
    cursor: pointer;
}

.modal-icon {
    font-size: 3.5rem;
    color: #10b981;
    margin-bottom: 16px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ================= CLAIM POLICY STYLES ================= */

/* Nested Headers for Meal Allowance */
.data-table th.sub-header {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
}

.data-table td.val-cell {
    text-align: center;
    font-size: 0.85rem;
}

/* Tab Content Pane Switching */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
