@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Global Background & Typography */
body,
#main-wrapper,
.content-body,
#preloader {
    background-color: #f8fafc !important;
}

.header,
.nav-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.03) !important;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
.form-control,
.btn,
.table,
.badge,
.nav-text,
.sidebar,
.logo-title,
.brand-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Moderate global text boldness for a cleaner interface */
.fw-bold {
    font-weight: 600 !important;
}

.fw-semibold {
    font-weight: 500 !important;
}

.fw-normal {
    font-weight: 400 !important;
}

th {
    font-weight: 700 !important;
}

/* Card Improvements */
.card {
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
    border-radius: 12px !important;
    background-color: #ffffff !important;
}

/* Table Design: Single color, neat, and non-messy */
.table-responsive {
    overflow: visible !important;
    border: none !important;
    background: transparent !important;
}

.table {
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important; /* Outer border on table */
    border-radius: 12px !important;
    background-clip: padding-box !important;
}

/* Remove default cell borders to avoid layout interference */
.table th,
.table td {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* Override zebra stripes to enforce a clean single-color design */
.table-striped>tbody>tr:nth-of-type(odd)>*,
.table-striped>tbody>tr:nth-of-type(even)>*,
.table>tbody>tr>* {
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: #ffffff !important;
    background-color: #ffffff !important;
}

.table tr,
.table tbody tr {
    background-color: transparent !important;
}

.table tbody td,
.table tbody th {
    background-color: #ffffff !important;
}

.table thead th {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #cbd5e1 !important; /* Dark horizontal row border */
    padding: 14px 16px !important;
    font-size: 0.825rem !important;
}

.table tbody td {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important; /* Light professional row border */
    padding: 14px 16px !important;
    font-size: 0.875rem !important;
    color: #334155 !important;
}

/* Vertical column borders: apply only to cells that follow another cell */
.table th + th,
.table td + td {
    border-left: 1px solid #e2e8f0 !important; /* Visible but lighter vertical column border */
}

/* Strip bottom border from last row to avoid doubling with outer border */
.table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Round inner corner cells to match outer rounded border curves and prevent overlay */
.table thead tr:first-child th:first-child {
    border-top-left-radius: 12px !important;
    background-clip: padding-box !important;
}
.table thead tr:first-child th:last-child {
    border-top-right-radius: 12px !important;
    background-clip: padding-box !important;
}
.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px !important;
    background-clip: padding-box !important;
}
.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px !important;
    background-clip: padding-box !important;
}

/* Exclude badge backgrounds and select elements from resetting background and padding */
.table tbody td .badge {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    padding: 0.35em 0.65em !important;
}

.table tbody td .badge-warning,
.table tbody td .badge-primary,
.table tbody td .badge-success,
.table tbody td .badge-danger,
.table tbody td .badge.light {
    font-weight: 400 !important;
    font-size: 0.78rem !important;
}

.table tbody td .dropdown-menu,
.table tbody td .dropdown-menu * {
    background-color: #ffffff !important;
}

.table tbody tr:hover td {
    background-color: #f8fafc !important;
}

/* Custom 3-dot Dropdown Actions Style */
.action-dropdown-btn {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b !important;
    background: #f1f5f9 !important;
    border: none !important;
    padding: 0 !important;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

.action-dropdown-btn:hover,
.action-dropdown-btn:focus,
.action-dropdown-btn[aria-expanded="true"] {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.action-dropdown-btn i {
    font-size: 0.9rem !important;
}

.dropdown-menu {
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08) !important;
    border-radius: 8px !important;
    padding: 6px !important;
    min-width: 140px !important;
    background: #ffffff !important;
    z-index: 1050;
}

.dropdown-item {
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    color: #475569 !important;
    transition: all 0.15s ease;
    border: none !important;
    background: none !important;
    width: 100%;
    text-align: left;
    display: block;
}

.dropdown-item:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.dropdown-item.text-danger:hover {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.dropdown-item i {
    margin-right: 8px;
    width: 14px;
    text-align: center;
}

/* Badge Tweaks */
.badge {
    font-weight: 500 !important;
    padding: 0.35em 0.65em !important;
}

.badge-light {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

/* Custom Search Bar with unified border covering the icon */
.custom-search-bar {
    display: flex;
    align-items: center;
    background-color: #f1f5f9 !important; /* Light grey background */
    border: 1px solid #cbd5e1 !important; /* Border covering icon and input */
    border-radius: 8px !important;
    padding: 0 14px !important;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.custom-search-bar:focus-within {
    border-color: #f93a0b !important; /* Brand orange color */
    box-shadow: 0 0 0 3px rgba(249, 58, 11, 0.15) !important;
    background-color: #ffffff !important; /* Transition to white on focus */
}

.custom-search-bar .search-icon {
    color: #64748b !important; /* Light grey/muted icon color */
    margin-right: 10px;
    font-size: 0.95rem;
}

.custom-search-bar input {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 10px 0 !important;
    font-size: 0.875rem !important;
    color: #334155 !important;
    width: 100%;
}

.custom-search-bar input::placeholder {
    color: #94a3b8 !important;
}

/* Brand logo text in header */
.brand-title {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #0c3b73 !important; /* Corporate navy blue matching SAKTHI logo */
    margin-left: 10px;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

@media (max-width: 767px) {
    .brand-title {
        display: none !important;
    }
}

#main-wrapper.menu-toggle .brand-title {
    display: none !important;
}

/* Optimize page loading speed by bypassing preloader white screen */
#main-wrapper {
    opacity: 1 !important;
}
#preloader {
    display: none !important;
}