/* Main site styles for Smart Business System */

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

 .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

.footer {
  position: relative;
  width: 100%;
  white-space: nowrap;
  line-height: 18px;
  margin-top: auto;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  flex-shrink: 0;
}

/* Custom styles for Smart Business System */
.main-content {
  padding: 20px;
}

.sidebar {
  min-height: 100vh;
  background-color: #f8f9fa;
}

.navbar-brand {
  font-weight: bold;
}

.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.table th {
  background-color: #003366;
  color: white;
  border-color: #003366;
}

.btn-primary {
  background-color: #003366;
  border-color: #003366;
}

.btn-primary:hover {
  background-color: #0059ee;
  border-color: #0059ee;
}

.alert {
  border-radius: 0.375rem;
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive utilities */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
  }
  
  .main-content {
    padding: 10px;
  }
}

/* Global DataTable Scrollbar Styling */
.dataTables_wrapper ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dataTables_wrapper ::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.dataTables_wrapper ::-webkit-scrollbar-thumb {
  background: #003366;
  border-radius: 4px;
}

.dataTables_wrapper ::-webkit-scrollbar-thumb:hover {
  background: #0059ee;
}

.dataTables_wrapper {
  scrollbar-width: thin;
  scrollbar-color: #003366 #f1f1f1;
}

/* Table container scrollbars */
.table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #003366;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #0059ee;
}

.table-responsive {
  scrollbar-width: thin;
  scrollbar-color: #003366 #f1f1f1;
}

/* Stats styling */
.avatar-initial {
    padding: 4px;
    color: white;
}

/* Stats and Action Buttons Section */
.stats-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

    .stats-item i {
        font-size: 16px;
        width: 20px;
        text-align: center;
    }

    .stats-item .fw-bold {
        color: #495057;
    }

.action-buttons-section .btn-group .btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
}

    .action-buttons-section .btn-group .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        transition: all 0.2s ease;
    }

/* Compact Filters */
.compact-filters .form-label {
    font-size: 0.875rem;
    color: #6c757d;
}

.compact-filters .form-select-sm,
.compact-filters .form-control-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Table Container Styling for Centralized Table Headers */
.table-container {
    margin-bottom: 1rem;
}

.table-container .card {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Fix DataTable header width alignment issues */
.dataTables_wrapper .dataTables_scrollHead {
    overflow: hidden !important;
}

.dataTables_wrapper .dataTables_scrollHead table {
    width: 100% !important;
}

.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto;
}

/* Ensure table headers take full width */
.dataTables_wrapper table {
    width: 100% !important;
    table-layout: auto;
}

.dataTables_wrapper thead th {
    white-space: nowrap;
    min-width: auto;
}

/* Business System specific styles */
.business-link {
    color: #000;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .business-link:hover {
        color: #003366;
        text-decoration: underline;
    }

.table thead th{
    color:white
}

.link-title {
    margin-left: 10px !important;
}

.page-header {
    margin-bottom: 0px !important;
    border-bottom: none !important;
}

.page-description {
    max-width: fit-content !important;
}

.card {
    border-color:white;
}

/* Custom Logo Styling */
.sidebar .sidebar-header .sidebar-brand {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #000865 !important;
}

.sidebar .sidebar-header .sidebar-brand span {
    margin-left: 5px;
}

/* Sidebar Menu Items Styling */
/* Parent menu items with dropdowns - Show arrow icon on the right */
.sidebar .nav-link[href^="#"] {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar .nav-link .link-title {
    flex: 1;
    margin-right: 10px;
}

.sidebar .nav-link .fa-chevron-down,
.sidebar .nav-link .fa-chevron-up {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 12px;
    flex-shrink: 0;
}

/* Rotate arrow when dropdown is expanded */
.sidebar .nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Submenu items - Add proper spacing between icon and text */
.sidebar .nav .sub-menu .nav-link {
    padding-left: 3.5rem;
}

.sidebar .nav .sub-menu .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Dashboard Cards Styling */
.dashboard-card {
    border-radius: 15px;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.dashboard-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
}

.dashboard-card .card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.dashboard-card .card-icon::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    opacity: 0.3;
}

.dashboard-card .card-info {
    flex: 1;
}

.dashboard-card .card-number {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .dashboard-card .card-text {
        font-size: 0.95rem;
        font-weight: 500;
        opacity: 0.9;
        margin: 0;
        max-width:180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .card-text-muted{
        color:rgba(255,255,255,0.7) !important;
    }

/* AI Dashboard specific - allow text wrapping but maintain height */
.dashboard-card.ai-card .card-text {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.2;
    max-height: 2.4em; /* Allow 2 lines max */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dashboard-card .progress {
    height: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    overflow: hidden;
}

.dashboard-card .progress-bar {
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* Blue Card - Total Customers */
.dashboard-card.blue-card {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
}

.dashboard-card.blue-card .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.dashboard-card.blue-card .card-icon::before {
    background: #4A90E2;
}

/* Green Card - Total Employees */
.dashboard-card.green-card {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    color: white;
}

.dashboard-card.green-card .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.dashboard-card.green-card .card-icon::before {
    background: #2ECC71;
}

/* Yellow Card - Active Projects */
.dashboard-card.yellow-card {
    background: linear-gradient(135deg, #F39C12 0%, #E67E22 100%);
    color: white;
}

.dashboard-card.yellow-card .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.dashboard-card.yellow-card .card-icon::before {
    background: #F39C12;
}

/* Purple Card - Monthly Revenue */
.dashboard-card.purple-card {
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 100%);
    color: white;
}

.dashboard-card.purple-card .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.dashboard-card.purple-card .card-icon::before {
    background: #9B59B6;
}

/* Red Card - For risk/danger items only */
.dashboard-card.red-card {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: white;
}

.dashboard-card.red-card .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.dashboard-card.red-card .card-icon::before {
    background: #E74C3C;
}

/* Teal Card - For quarterly/intermediate metrics */
.dashboard-card.teal-card {
    background: linear-gradient(135deg, #1ABC9C 0%, #16A085 100%);
    color: white;
}

.dashboard-card.teal-card .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.dashboard-card.teal-card .card-icon::before {
    background: #1ABC9C;
}

/* Orange Card - For yearly/major metrics */
.dashboard-card.orange-card {
    background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
    color: white;
}

.dashboard-card.orange-card .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.dashboard-card.orange-card .card-icon::before {
    background: #E67E22;
}

/* Indigo Card - For performance/rate metrics */
.dashboard-card.indigo-card {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: white;
}

.dashboard-card.indigo-card .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.dashboard-card.indigo-card .card-icon::before {
    background: #6366F1;
}

/* Card animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dashboard-card:nth-child(1) { animation: slideInLeft 0.6s ease-out; }
.dashboard-card:nth-child(2) { animation: slideInLeft 0.7s ease-out; }
.dashboard-card:nth-child(3) { animation: slideInRight 0.8s ease-out; }
.dashboard-card:nth-child(4) { animation: slideInRight 0.9s ease-out; }

/* Navbar Settings Dropdown Styling */
.navbar .dropdown-menu {
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.175);
    border-radius: 0.375rem;
}

.navbar .dropdown-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background-color: #f8f9fa;
    color: #495057;
}

/* Ensure all links in navbar dropdowns have consistent hover behavior */
.navbar .dropdown-menu a.dropdown-item-link {
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    display: inline-block;
}

.navbar .dropdown-menu a.dropdown-item-link:hover,
.navbar .dropdown-menu a.dropdown-item-link:focus {
    background-color: #f8f9fa;
    color: #495057;
}

.navbar .dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e9ecef;
}

/* Role-specific badges */
.admin-badge {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.manager-badge {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.employee-badge {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}