/**
 * ServicePoints Web Application
 * Main Stylesheet - Brand Colors
 */

/* ============ Brand Variables ============ */
:root {
    /* Primary Brand Colors */
    --sp-green: #5B9A4D;
    --sp-green-dark: #4A8040;
    --sp-green-light: #7AB86A;
    
    --sp-purple: #8B4D9C;
    --sp-purple-dark: #6D3A7D;
    --sp-purple-light: #A66BB8;
    
    --sp-lavender: #B8A3C7;
    --sp-lavender-light: #D4C6E0;
    
    /* UI Colors */
    --primary-color: #5B9A4D;
    --secondary-color: #8B4D9C;
    --success-color: #5B9A4D;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --dark-color: #3D3D3D;
    --light-color: #f8f9fc;
    --gray-color: #858796;
    
    /* Layout */
    --sidebar-width: 260px;
    --navbar-height: 60px;
}

/* ============ Base Styles ============ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f4f6f9;
    margin: 0;
    padding: 0;
}

a {
    color: var(--sp-green);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--sp-green-dark);
    text-decoration: none;
}

/* ============ Login Page ============ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 50px 40px;
    width: 100%;
    max-width: 440px;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo {
    max-width: 240px;
    height: auto;
    margin-bottom: 15px;
}

.login-header .logo-image {
    max-width: 220px;
    height: auto;
    margin-bottom: 20px;
}

.login-header .logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.login-header .logo-dots {
    width: 50px;
    height: 50px;
}

.login-header .logo-text {
    font-size: 1.8rem;
    font-weight: 600;
}

.login-header .logo-text .green {
    color: var(--sp-green);
}

.login-header .logo-text .purple {
    color: var(--sp-purple);
}

.login-header h2 {
    color: var(--dark-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.login-header p {
    color: var(--gray-color);
    margin: 0;
}

.login-card .form-control {
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card .form-control:focus {
    border-color: var(--sp-green);
    box-shadow: 0 0 0 3px rgba(91, 154, 77, 0.15);
}

.login-card .btn-primary {
    background: linear-gradient(135deg, var(--sp-green) 0%, var(--sp-green-dark) 100%);
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 154, 77, 0.3);
}

.login-card .btn-primary:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ============ Main Layout ============ */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: #fff;
    color: var(--dark-color);
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    border-right: 1px solid #e9ecef;
}

.sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    max-width: 180px;
    height: auto;
}

.sidebar-header .logo-dots {
    width: 40px;
    height: 40px;
}

.sidebar-header .logo-text {
    font-size: 1.3rem;
    font-weight: 600;
}

.sidebar-header .logo-text .green {
    color: var(--sp-green);
}

.sidebar-header .logo-text .purple {
    color: var(--sp-purple);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Sidebar Menu */
.sidebar .components {
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar .menu-section {
    padding: 10px 20px 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #adb5bd;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: #495057;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar ul li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #adb5bd;
    transition: color 0.2s;
}

.sidebar ul li a:hover {
    background: #f8f9fa;
    color: var(--sp-green);
    border-left-color: var(--sp-green);
}

.sidebar ul li a:hover i {
    color: var(--sp-green);
}

.sidebar ul li.active a {
    background: linear-gradient(90deg, rgba(91, 154, 77, 0.1) 0%, rgba(91, 154, 77, 0) 100%);
    color: var(--sp-green);
    border-left-color: var(--sp-green);
    font-weight: 600;
}

.sidebar ul li.active a i {
    color: var(--sp-green);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
    color: #adb5bd;
}

/* ============ Content Area ============ */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
    min-height: 100vh;
    background: #f4f6f9;
}

#content.active {
    width: 100%;
    margin-left: 0;
}

/* Top Navbar */
#content .navbar {
    padding: 12px 25px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

#content .navbar .btn-outline-secondary {
    border-color: #e0e0e0;
    color: #6c757d;
}

#content .navbar .btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #d0d0d0;
}

/* ============ Dashboard Cards ============ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0 !important;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.border-left-primary {
    border-left: 4px solid var(--sp-green) !important;
}

.border-left-success {
    border-left: 4px solid var(--sp-green) !important;
}

.border-left-info {
    border-left: 4px solid var(--sp-purple) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-left-secondary {
    border-left: 4px solid var(--gray-color) !important;
}

.card .text-primary {
    color: var(--sp-green) !important;
}

.card .text-success {
    color: var(--sp-green) !important;
}

.card .text-info {
    color: var(--sp-purple) !important;
}

/* ============ Tables ============ */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    padding: 12px 15px;
    background: #f8f9fa;
}

.table td {
    vertical-align: middle;
    padding: 12px 15px;
    border-color: #f0f0f0;
}

.table-hover tbody tr:hover {
    background-color: rgba(91, 154, 77, 0.04);
}

/* ============ Buttons ============ */
.btn-primary {
    background-color: var(--sp-green);
    border-color: var(--sp-green);
}

.btn-primary:hover {
    background-color: var(--sp-green-dark);
    border-color: var(--sp-green-dark);
}

.btn-outline-primary {
    color: var(--sp-green);
    border-color: var(--sp-green);
}

.btn-outline-primary:hover {
    background-color: var(--sp-green);
    border-color: var(--sp-green);
}

.btn-info {
    background-color: var(--sp-purple);
    border-color: var(--sp-purple);
}

/* ============ Badges ============ */
.badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 6px;
}

.badge-success {
    background-color: var(--sp-green);
}

.badge-primary {
    background-color: var(--sp-green);
}

.badge-info {
    background-color: var(--sp-purple);
}

/* ============ Avatar ============ */
.avatar-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--sp-green) 0%, var(--sp-green-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle .initials {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
}

.info-item {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item i {
    width: 25px;
    margin-right: 10px;
    color: var(--sp-green);
}

/* ============ Crews Page ============ */
.crew-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--sp-purple) 0%, var(--sp-purple-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.crew-avatar .initials {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.crew-avatar .status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.status-available { background-color: var(--sp-green); }
.status-working { background-color: var(--sp-purple); }
.status-traveling { background-color: var(--info-color); }
.status-unavailable { background-color: var(--warning-color); }
.status-emergency { background-color: var(--danger-color); }
.status-offline { background-color: #adb5bd; }

.crew-info {
    font-size: 0.9rem;
}

.crew-info > div {
    padding: 5px 0;
}

.crew-info i {
    width: 20px;
    margin-right: 8px;
    color: var(--sp-green);
}

/* ============ Pagination ============ */
.pagination .page-link {
    color: var(--sp-green);
    border-radius: 6px;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: var(--sp-green);
    border-color: var(--sp-green);
}

/* ============ Utilities ============ */
.text-xs {
    font-size: 0.7rem;
}

.text-gray-300 {
    color: #dee2e6 !important;
}

.text-gray-800 {
    color: var(--dark-color) !important;
}

.shadow {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    #content {
        width: 100%;
        margin-left: 0;
    }
    
    #content.active {
        margin-left: var(--sidebar-width);
    }
    
    .login-card {
        padding: 30px 25px;
    }
}

/* ============ Animations ============ */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ Custom Scrollbar ============ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ============ Page Headers ============ */
.page-header {
    margin-bottom: 25px;
}

.page-header h2 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.page-header small {
    color: #6c757d;
}

/* ============ Dynamic Forms ============ */
.sp-dynamic-form {
    padding: 0;
}

.sp-dynamic-form .form-group {
    margin-bottom: 0.75rem;
}

.sp-dynamic-form .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
    display: block;
}

.sp-dynamic-form .section-title {
    font-weight: 600;
    color: var(--sp-purple);
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.sp-dynamic-form .form-section {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.sp-dynamic-form .form-section:first-child {
    margin-top: 0;
}

.sp-dynamic-form .form-group-container {
    margin-top: 0.75rem;
    border: 1px solid #e3e6f0;
    border-radius: 0.35rem;
}

.sp-dynamic-form .form-group-container .card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.5rem 0.75rem;
}

.sp-dynamic-form .form-group-container .card-header h6 {
    color: var(--sp-purple);
    font-weight: 600;
}

.sp-dynamic-form .form-group-container .card-body {
    padding: 0.75rem;
}

.sp-dynamic-form .form-control:disabled,
.sp-dynamic-form .form-control[readonly] {
    background-color: #f8f9fc;
    color: #6c757d;
}

.sp-dynamic-form .form-actions {
    padding-top: 1rem;
    border-top: 1px solid #e3e6f0;
}

/* Compact form controls */
.sp-dynamic-form .form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.sp-dynamic-form select.form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
}

.sp-dynamic-form textarea.form-control-sm {
    height: auto;
    min-height: 60px;
}

/* Two column form layout */
.modal-body .row > [class*="col-"] {
    margin-bottom: 0;
}

.modal-body .form-group {
    margin-bottom: 0.75rem;
}

/* Dynamic Summary Table */
.sp-dynamic-summary .table th {
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fc;
}

.sp-dynamic-summary .table td {
    vertical-align: middle;
}

/* Dynamic Details */
.sp-dynamic-details .detail-section {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.sp-dynamic-details .detail-section:first-child {
    margin-top: 0;
}

.sp-dynamic-details .row {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.sp-dynamic-details .row:last-child {
    border-bottom: none;
}

/* Form field wrapper for dynamic fields */
.dynamic-field-wrapper {
    margin-bottom: 0;
}

/* Multi-select styling */
select[multiple] {
    min-height: 120px;
}

/* Config indicator */
.config-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: #e7f5ff;
    color: #1971c2;
}

/* ============ Activity Type Selection Grid ============ */
.activity-type-btn {
    transition: all 0.2s ease;
    border-width: 2px;
    border-radius: 8px;
    background: #fff;
}

.activity-type-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: var(--sp-green);
    background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
}

.activity-type-btn:hover i {
    color: var(--sp-green);
}

.activity-type-btn:active {
    transform: translateY(0);
}

.activity-type-btn i {
    color: #6c757d;
    transition: color 0.2s ease;
}

/* Grid responsive adjustments */
@media (max-width: 576px) {
    .activity-type-btn {
        height: 80px !important;
        padding: 1rem !important;
    }
    
    .activity-type-btn i {
        font-size: 1.5rem !important;
    }
    
    .activity-type-btn span {
        font-size: 0.75rem !important;
    }
}

/* ============ Portal Selection Page ============ */
.portal-select-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.portal-container {
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

/* Logo Section */
.logo-section {
    margin-bottom: 50px;
}

.main-logo {
    max-width: 320px;
    height: auto;
    margin-bottom: 15px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 48px;
    background: linear-gradient(135deg, var(--sp-green) 0%, var(--sp-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--sp-green) 0%, var(--sp-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.tagline {
    color: var(--gray-color);
    font-size: 18px;
    margin: 0;
}

/* Portal Tiles */
.portal-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.portal-tile {
    background: white;
    border-radius: 16px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.portal-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.portal-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sp-green), var(--sp-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portal-tile:hover::before {
    opacity: 1;
}

/* Admin Portal */
.admin-portal:hover {
    border-color: #e74a3b;
}

.admin-portal .tile-icon {
    background: linear-gradient(135deg, #e74a3b 0%, #c0392b 100%);
}

.admin-portal:hover .tile-arrow {
    background: #e74a3b;
}

/* Operation Portal */
.operation-portal:hover {
    border-color: var(--sp-green);
}

.operation-portal .tile-icon {
    background: linear-gradient(135deg, var(--sp-green) 0%, var(--sp-green-dark) 100%);
}

.operation-portal:hover .tile-arrow {
    background: var(--sp-green);
}

/* BI Portal */
.bi-portal:hover {
    border-color: var(--sp-purple);
}

.bi-portal .tile-icon {
    background: linear-gradient(135deg, var(--sp-purple) 0%, var(--sp-purple-dark) 100%);
}

.bi-portal:hover .tile-arrow {
    background: var(--sp-purple);
}

/* Tile Icon */
.tile-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Tile Title */
.tile-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 12px 0;
}

/* Tile Description */
.tile-description {
    color: var(--gray-color);
    font-size: 13px;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

/* Tile Features */
.tile-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.tile-features span {
    font-size: 13px;
    color: #666;
}

.tile-features i {
    color: var(--sp-green);
    margin-right: 8px;
    font-size: 11px;
}

/* Tile Arrow */
.tile-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    transition: all 0.3s ease;
}

.tile-arrow i {
    transition: transform 0.3s ease;
}

.portal-tile:hover .tile-arrow i {
    transform: translateX(3px);
}

/* Portal Footer */
.portal-footer {
    color: var(--gray-color);
    font-size: 13px;
}

.portal-footer p {
    margin: 0;
}

/* ============ Portal Badge in Sidebar ============ */
.portal-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 0 15px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portal-badge.admin {
    background: linear-gradient(135deg, rgba(231, 74, 59, 0.15) 0%, rgba(192, 57, 43, 0.15) 100%);
    color: #e74a3b;
    border: 1px solid rgba(231, 74, 59, 0.3);
}

.portal-badge.operations {
    background: linear-gradient(135deg, rgba(91, 154, 77, 0.15) 0%, rgba(74, 128, 64, 0.15) 100%);
    color: var(--sp-green);
    border: 1px solid rgba(91, 154, 77, 0.3);
}

.portal-badge.bi {
    background: linear-gradient(135deg, rgba(139, 77, 156, 0.15) 0%, rgba(109, 58, 125, 0.15) 100%);
    color: var(--sp-purple);
    border: 1px solid rgba(139, 77, 156, 0.3);
}

.portal-badge.healthcare {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.15) 0%, rgba(17, 122, 139, 0.15) 100%);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.portal-badge i {
    font-size: 14px;
}

/* Menu Section Labels */
.menu-section {
    padding: 15px 20px 5px !important;
}

.menu-section .section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0a0a0;
}

/* Menu Divider */
.menu-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 15px 20px !important;
    padding: 0 !important;
}

/* Switch Portal Button */
.switch-portal {
    padding: 15px 20px;
    margin-top: auto;
}

.switch-portal .btn {
    font-size: 12px;
    padding: 8px 12px;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

.switch-portal .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Sidebar layout adjustment */
.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar .components {
    flex: 1;
    overflow-y: auto;
}

/* ============ BI Dashboard Styles ============ */
.bi-dashboard-page .card {
    border: none;
}

.border-left-primary {
    border-left: 4px solid var(--sp-green) !important;
}

.border-left-success {
    border-left: 4px solid #27ae60 !important;
}

.border-left-info {
    border-left: 4px solid #36b9cc !important;
}

.border-left-warning {
    border-left: 4px solid #f6c23e !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: #3a3b45 !important;
}

.progress-sm {
    height: 0.5rem;
}

.text-xs {
    font-size: .7rem;
}

/* ============ Login Portal Badge ============ */
.login-portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
}

.login-portal-badge.admin {
    background: linear-gradient(135deg, rgba(231, 74, 59, 0.15) 0%, rgba(192, 57, 43, 0.15) 100%);
    color: #e74a3b;
    border: 1px solid rgba(231, 74, 59, 0.3);
}

.login-portal-badge.operations {
    background: linear-gradient(135deg, rgba(91, 154, 77, 0.15) 0%, rgba(74, 128, 64, 0.15) 100%);
    color: var(--sp-green);
    border: 1px solid rgba(91, 154, 77, 0.3);
}

.login-portal-badge.bi {
    background: linear-gradient(135deg, rgba(139, 77, 156, 0.15) 0%, rgba(109, 58, 125, 0.15) 100%);
    color: var(--sp-purple);
    border: 1px solid rgba(139, 77, 156, 0.3);
}

.login-portal-badge.healthcare {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.15) 0%, rgba(17, 122, 139, 0.15) 100%);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Responsive */
@media (max-width: 1200px) {
    .portal-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portal-tiles {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto 50px;
    }
    
    .logo-icon {
        font-size: 36px;
    }
    
    .logo-text {
        font-size: 32px;
    }
    
    .portal-tile {
        padding: 30px 25px;
    }
    
    .tile-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .tile-title {
        font-size: 20px;
    }
}

/* ============ System Parameters Settings Page ============ */

/* Settings Navigation Card */
.settings-nav-card .list-group-item {
    border: none;
    padding: 12px 20px;
    transition: all 0.2s ease;
}

.settings-nav-card .list-group-item:hover {
    background-color: #f8f9fa;
}

.settings-nav-card .list-group-item.active {
    background: linear-gradient(135deg, var(--sp-green) 0%, var(--sp-purple) 100%);
    color: white;
    border-radius: 0;
}

.settings-nav-card .list-group-item.active i {
    color: white !important;
}

.settings-nav-card .list-group-item.active small {
    color: rgba(255, 255, 255, 0.8) !important;
}

.settings-nav-card .list-group-item div small {
    font-size: 0.75rem;
}

/* Settings Card */
.settings-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.settings-card .card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
}

.settings-card .card-body {
    padding: 25px;
}

/* Settings Icon */
.settings-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-primary-light { background-color: rgba(0, 123, 255, 0.1); }
.bg-success-light { background-color: rgba(40, 167, 69, 0.1); }
.bg-warning-light { background-color: rgba(255, 193, 7, 0.15); }
.bg-danger-light { background-color: rgba(220, 53, 69, 0.1); }
.bg-info-light { background-color: rgba(23, 162, 184, 0.1); }
.bg-purple-light { background-color: rgba(139, 77, 156, 0.1); }
.bg-teal-light { background-color: rgba(32, 201, 151, 0.1); }
.bg-secondary-light { background-color: rgba(108, 117, 125, 0.1); }

.text-purple { color: var(--sp-purple) !important; }
.text-teal { color: #20c997 !important; }

/* Settings Group */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Setting Item */
.setting-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item:hover {
    background-color: #fafbfc;
    margin: 0 -25px;
    padding: 18px 25px;
}

.setting-item.highlight-setting {
    background-color: #f8f9fa;
    margin: 0 -25px;
    padding: 18px 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.setting-item.disabled-setting {
    opacity: 0.5;
    pointer-events: none;
}

.setting-info {
    flex: 1;
    padding-right: 20px;
}

.setting-info label {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: block;
    font-size: 0.95rem;
}

.setting-info p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #6c757d;
}

.setting-control {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Settings Subsection */
.settings-subsection {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.subsection-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.subsection-title i {
    color: #adb5bd;
}

/* Beautiful Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    margin: 0;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e0e0e0;
    transition: all 0.3s ease;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--sp-green) 0%, var(--sp-purple) 100%);
}

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

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(91, 154, 77, 0.25);
}

.toggle-switch:hover .toggle-slider {
    background-color: #ccc;
}

.toggle-switch:hover input:checked + .toggle-slider {
    filter: brightness(1.05);
}

/* Form Controls in Settings */
.settings-card .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.settings-card .form-control:focus {
    border-color: var(--sp-green);
    box-shadow: 0 0 0 3px rgba(91, 154, 77, 0.15);
}

.settings-card .input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.settings-card .input-group .form-control {
    border-radius: 8px 0 0 8px;
}

.settings-card select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Responsive Settings */
@media (max-width: 992px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .setting-info {
        padding-right: 0;
    }
    
    .setting-control {
        width: 100%;
    }
    
    .setting-control .form-control,
    .setting-control .input-group,
    .setting-control select {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .settings-card .card-header {
        padding: 15px 20px;
    }
    
    .settings-card .card-body {
        padding: 20px;
    }
    
    .setting-item:hover,
    .setting-item.highlight-setting {
        margin: 0 -20px;
        padding: 15px 20px;
    }
    
    .settings-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ============ Create Activity Page - Wizard ============ */

/* Wizard Progress */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.wizard-step.active .step-number {
    background: linear-gradient(135deg, var(--sp-green) 0%, var(--sp-purple) 100%);
    color: white;
}

.wizard-step.completed .step-number {
    background: var(--sp-green);
    color: white;
}

.step-label {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.wizard-step.active .step-label {
    color: var(--sp-purple);
    font-weight: 600;
}

.wizard-connector {
    width: 120px;
    height: 3px;
    background: #e9ecef;
    margin: 0 15px;
    margin-bottom: 25px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.wizard-connector.active {
    background: linear-gradient(90deg, var(--sp-green) 0%, var(--sp-purple) 100%);
}

/* Activity Type Cards Grid */
.activity-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.activity-type-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.activity-type-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #e9ecef;
}

.activity-type-card.selected {
    border-color: var(--sp-green);
    background: linear-gradient(135deg, rgba(91, 154, 77, 0.05) 0%, rgba(139, 77, 156, 0.05) 100%);
    box-shadow: 0 8px 25px rgba(91, 154, 77, 0.2);
}

.card-image-container {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    position: relative;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.card-icon-fallback {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.card-icon-fallback i {
    color: inherit;
}

.bg-primary-light .card-icon-fallback i,
.card-icon-fallback.bg-primary-light i { color: #007bff; }
.bg-success-light .card-icon-fallback i,
.card-icon-fallback.bg-success-light i { color: #28a745; }
.bg-warning-light .card-icon-fallback i,
.card-icon-fallback.bg-warning-light i { color: #ffc107; }
.bg-danger-light .card-icon-fallback i,
.card-icon-fallback.bg-danger-light i { color: #dc3545; }
.bg-info-light .card-icon-fallback i,
.card-icon-fallback.bg-info-light i { color: #17a2b8; }
.bg-purple-light .card-icon-fallback i,
.card-icon-fallback.bg-purple-light i { color: var(--sp-purple); }
.bg-teal-light .card-icon-fallback i,
.card-icon-fallback.bg-teal-light i { color: #20c997; }

.card-content {
    flex: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.card-description {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.selection-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--sp-green);
    font-size: 1.5rem;
}

/* Wizard Actions */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.selected-type-info {
    font-size: 1rem;
}

/* Selected Type Banner */
.selected-type-banner {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--sp-green);
}

.banner-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 15px;
}

.banner-icon .banner-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.banner-content {
    flex: 1;
}

.banner-content h5 {
    font-weight: 600;
    color: #333;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.form-section-title i {
    color: #adb5bd;
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
}

/* Summary Card */
.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #6c757d;
    font-size: 0.85rem;
}

.summary-value {
    font-weight: 500;
    color: #333;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 992px) {
    .activity-type-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .card-image-container,
    .card-icon-fallback {
        width: 60px;
        height: 60px;
    }
    
    .card-icon-fallback {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .wizard-progress {
        padding: 15px 0;
    }
    
    .step-number {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .wizard-connector {
        width: 60px;
    }
    
    .activity-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wizard-actions {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .selected-type-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .banner-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .banner-content {
        margin-bottom: 15px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .ml-auto {
        margin-left: 0 !important;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================================
   CUSTOMERS DASHBOARD STYLES
   ============================================================ */

/* Custom Map Markers */
.custom-marker {
    background: transparent;
    border: none;
}

.customer-popup {
    min-width: 180px;
}

.customer-popup strong {
    font-size: 14px;
    color: #333;
}

.customer-popup small {
    display: block;
    margin-bottom: 5px;
}

.customer-popup .badge {
    margin-top: 5px;
}

.customer-popup .btn {
    margin-top: 8px;
}

/* Customers Page Stats */
.customers-page .stats-card {
    transition: transform 0.2s ease;
}

.customers-page .stats-card:hover {
    transform: translateY(-2px);
}

/* Customer Table Row Hover */
.customers-page .table tbody tr {
    transition: background-color 0.15s ease;
}

.customers-page .table tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

/* Location Button */
.customers-page .btn-outline-info {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

/* Map Container */
#customersMap {
    border-radius: 0 0 0.35rem 0.35rem;
}

/* Progress Bar Labels */
.customers-page .progress-bar {
    font-size: 11px;
    line-height: 25px;
}

/* ============================================================
   CUSTOMER CARDS GRID STYLES
   ============================================================ */

/* Cards Grid Container */
.customer-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
    gap: 20px;
    padding: 10px 0;
    justify-content: start;
}

/* Individual Customer Card */
.customer-card {
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.customer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #4e73df;
}

/* Customer Image/Avatar Section */
.customer-card-image {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.customer-card-image img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.customer-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: white;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.customer-avatar.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.customer-avatar.inactive {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Customer Info Body */
.customer-card-body {
    padding: 15px;
    text-align: center;
}

.customer-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-id {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

.customer-id i {
    margin-right: 5px;
    color: #4e73df;
}

.customer-address,
.customer-phone {
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-address i,
.customer-phone i {
    margin-right: 5px;
    width: 14px;
    color: #858796;
}

/* Customer Card Footer */
.customer-card-footer {
    padding: 10px 15px;
    background: #f8f9fc;
    border-top: 1px solid #e3e6f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Quick Actions (shown on hover) */
.customer-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.customer-card:hover .customer-card-actions {
    opacity: 1;
}

.customer-card-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .customer-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1400px) {
    .customer-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 340px));
    }
}

/* ============================================================
   CREWS DASHBOARD STYLES
   ============================================================ */

/* Border left cards */
.border-left-primary {
    border-left: 4px solid #4e73df !important;
}
.border-left-success {
    border-left: 4px solid #1cc88a !important;
}
.border-left-info {
    border-left: 4px solid #36b9cc !important;
}
.border-left-warning {
    border-left: 4px solid #f6c23e !important;
}
.border-left-danger {
    border-left: 4px solid #e74a3b !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}
.text-gray-800 {
    color: #5a5c69 !important;
}

/* Status Circles */
.status-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}
.status-circle.available { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
.status-circle.working { background: linear-gradient(135deg, #007bff 0%, #6610f2 100%); }
.status-circle.traveling { background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%); }
.status-circle.offline { background: linear-gradient(135deg, #6c757d 0%, #495057 100%); }

/* Crew Cards Grid */
.crew-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 340px));
    gap: 20px;
    justify-content: start;
}

/* Individual Crew Card */
.crew-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.crew-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Status Indicator Bar */
.crew-status-indicator {
    padding: 8px 15px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crew-status-indicator i {
    font-size: 14px;
}

/* Profile Section */
.crew-card-profile {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.crew-avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.crew-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.crew-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: white;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.crew-avatar.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.crew-avatar.inactive {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.crew-active-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
}

.crew-active-badge.active {
    background-color: #28a745;
}

.crew-active-badge.inactive {
    background-color: #dc3545;
}

.crew-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.crew-id {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

.crew-roles {
    min-height: 24px;
}

.crew-roles .badge {
    font-size: 10px;
    padding: 4px 8px;
}

/* Info Section */
.crew-card-info {
    padding: 15px 20px;
    background: #f8f9fc;
}

.crew-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.crew-info-item:last-child {
    margin-bottom: 0;
}

.crew-info-item i {
    width: 16px;
    color: #888;
}

/* Stats Section */
.crew-card-stats {
    display: flex;
    border-top: 1px solid #eee;
}

.crew-stat {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-right: 1px solid #eee;
}

.crew-stat:last-child {
    border-right: none;
}

.crew-stat .stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #4e73df;
}

.crew-stat .stat-label {
    display: block;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 576px) {
    .crew-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Crew Modal Styles */
.crew-photo-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.crew-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 600;
    color: white;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin: 0 auto;
}

.crew-avatar-large.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.crew-avatar-large.inactive {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Outline Badges */
.badge-outline-primary {
    background: transparent;
    border: 1px solid #4e73df;
    color: #4e73df;
    padding: 5px 10px;
}

.badge-outline-success {
    background: transparent;
    border: 1px solid #1cc88a;
    color: #1cc88a;
    padding: 5px 10px;
}

.badge-outline-warning {
    background: transparent;
    border: 1px solid #f6c23e;
    color: #b88c00;
    padding: 5px 10px;
}

.badge-outline-info {
    background: transparent;
    border: 1px solid #36b9cc;
    color: #36b9cc;
    padding: 5px 10px;
}

/* Modal Enhancements */
#crewDetailModal .modal-header {
    border-bottom: none;
}

#crewDetailModal .modal-header .close {
    opacity: 0.8;
}

#crewDetailModal .modal-header .close:hover {
    opacity: 1;
}

/* Clickable stat cards */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.clickable-card:active {
    transform: translateY(-2px);
}


/* Clickable status circles */
.clickable-status {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-status:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


/* Customer Cards Grid */
.customer-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.customer-card {
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.customer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.customer-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.customer-status-badge.active {
    background: #d4edda;
    color: #155724;
}

.customer-status-badge.inactive {
    background: #e2e3e5;
    color: #383d41;
}

.customer-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    margin: 0 auto 0.75rem;
}

.customer-avatar.active {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.customer-avatar.inactive {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
}

.customer-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.customer-id {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.customer-contact {
    font-size: 0.85rem;
    color: #666;
    text-align: left;
}

.customer-contact div {
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-contact i {
    width: 20px;
    color: #4e73df;
}

.customer-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

/* Alerts Dashboard Styles */
.alert-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.alert-type-icon i {
    font-size: 16px;
}

.clickable-status-row:hover {
    background: #f8f9fc;
    border-radius: 0.5rem;
    margin: -0.5rem;
    padding: 0.5rem;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert-item:hover {
    transform: translateX(5px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    border-left: 3px solid #4e73df;
}

.alert-item .alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1rem;
    flex-shrink: 0;
}

.alert-item .alert-icon i {
    font-size: 18px;
}

.alert-item .alert-content {
    flex-grow: 1;
    min-width: 0;
}

.alert-item .alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.alert-item .alert-type {
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-item .alert-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.alert-item .alert-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.alert-item .alert-details i {
    width: 14px;
    color: #4e73df;
}

.alert-item .alert-address {
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-item .alert-address i {
    color: #4e73df;
    margin-right: 0.25rem;
}

.alert-item .alert-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.alert-item .alert-actions .btn {
    padding: 0.375rem 0.5rem;
}

/* Alert type icons */
.alert-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.alert-type-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

/* Healthcare Portal Tile */
.healthcare-portal:hover {
    border-color: #20c997;
}

.healthcare-portal .tile-icon {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
}

.healthcare-portal:hover .tile-arrow {
    background: #20c997;
}

/* ============ Activity Detail Page - Clean Mobile App Style ============ */

.activity-detail-page {
    padding: 0.5rem 0;
}

/* Activity Header Gradient */
.activity-header-gradient {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
}

/* Activity Meta Info */
.activity-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.meta-item i {
    width: 20px;
    text-align: center;
}

/* Avatar Circles */
.avatar-circle {
    width: 50px;
    height: 50px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.avatar-circle.avatar-provider {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

/* Action Buttons Grid */
.action-buttons-card {
    border-radius: 0.5rem;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    color: #495057;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
    min-height: 65px;
}

.action-btn i {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}

.action-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.action-btn.btn-cancel:hover {
    background: #fee2e2;
    border-color: #dc3545;
    color: #dc3545;
}

/* Info Table */
.info-table td {
    padding: 0.6rem 1rem;
    border-top: 1px solid #e9ecef;
}

.info-table .info-label {
    color: #6c757d;
    font-weight: 500;
    width: 40%;
    background: #f8f9fa;
}

.info-table .info-value {
    font-weight: 500;
}

/* Status Buttons Grid */
.status-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.status-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}

/* Provider List */
.providers-list {
    max-height: 350px;
    overflow-y: auto;
}

.provider-item {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.provider-item:hover {
    background: #f8f9fa;
    border-color: #28a745;
}

.provider-item.selected {
    background: #d4edda;
    border-color: #28a745;
}

/* Details Modal Sections */
.details-section {
    border-bottom: 1px solid #e9ecef;
}

.details-section:last-child {
    border-bottom: none;
}

.details-section-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    margin: 0;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.details-section-header i {
    color: #6c757d;
}

.details-table {
    margin: 0;
}

.details-table td {
    padding: 0.5rem 1rem;
    vertical-align: middle;
}

.details-table .detail-label {
    width: 35%;
    font-weight: 500;
    color: #6c757d;
    background: #fafbfc;
}

.details-table .detail-value {
    color: #212529;
}

/* Status Badge */
.status-badge {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 991px) {
    .action-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .action-btn {
        padding: 0.5rem 0.25rem;
        font-size: 0.65rem;
        min-height: 55px;
    }
    
    .action-btn i {
        font-size: 1rem;
    }
    
    .avatar-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .details-table .detail-label {
        width: 40%;
    }
}

/* Edit Form Sections */
.edit-section {
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
}

.edit-section-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    margin: 0;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.edit-section-header i {
    color: #6c757d;
}

.edit-section .row {
    padding: 1rem;
    padding-bottom: 0;
}

.edit-section .form-group {
    margin-bottom: 1rem;
}

.edit-section .form-group:last-child {
    margin-bottom: 0;
}

.edit-section > .form-group {
    padding: 0 1rem 1rem 1rem;
}
