/* Modern Design Enhancements for CRM */
/* ================================== */

/* Professional Color Palette */
:root {
    --primary-gradient: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    --success-gradient: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    --info-gradient: linear-gradient(135deg, #3498DB 0%, #2874A6 100%);
    --warning-gradient: linear-gradient(135deg, #F39C12 0%, #D68910 100%);
    --danger-gradient: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    --secondary-gradient: linear-gradient(135deg, #95A5A6 0%, #7F8C8D 100%);
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --primary-color: #4A90E2;
    --success-color: #27AE60;
    --info-color: #3498DB;
    --warning-color: #F39C12;
    --danger-color: #E74C3C;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --border-color: #E0E6ED;
}

/* Enhanced Dashboard Stat Tiles */
.tile_count .tile_stats_count {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: none;
    border-bottom: none;
    padding: 25px 20px;
    margin-bottom: 20px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.tile_count .tile_stats_count:before {
    display: none;
}

.tile_count .tile_stats_count:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

/* Modern gradient overlay for stat tiles */
.tile_count .tile_stats_count:after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 50%;
    transform: translateX(50%);
    opacity: 0.5;
}

.tile_count .tile_stats_count .count_top {
    font-size: 14px;
    font-weight: 600;
    color: #5a5a5a;
    margin-bottom: 10px;
    display: block;
}

.tile_count .tile_stats_count .count_top i {
    color: var(--primary-color);
    font-size: 18px;
    margin-right: 5px;
}

.tile_count .tile_stats_count .count {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 10px 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tile_count .tile_stats_count a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition-smooth);
    display: inline-block;
    position: relative;
}

.tile_count .tile_stats_count a:after {
    content: '→';
    margin-left: 5px;
    transition: var(--transition-smooth);
}

.tile_count .tile_stats_count a:hover {
    color: var(--info-color);
    transform: translateX(3px);
}

.tile_count .tile_stats_count a:hover:after {
    margin-left: 10px;
}

/* Modern Panel Styling */
.x_panel {
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    border: none;
    padding: 25px;
    margin-bottom: 25px;
    transition: var(--transition-smooth);
}

.x_panel:hover {
    box-shadow: var(--card-shadow-hover);
}

.x_title {
    border-bottom: 2px solid #f0f0f0;
    padding: 0 0 15px;
    margin-bottom: 20px;
}

.x_title h2,
.x_title h3 {
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
}

.x_content {
    padding: 10px 0;
}

/* Modern Page Title */
.page-title {
    padding: 20px 0 30px;
    border-bottom: none;
}

.page-title .title_left h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    display: inline-block;
}

.page-title .title_left h3:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
}

/* Modern Table Design */
.table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border: none;
    padding: 15px 10px;
}

.table tbody tr {
    transition: var(--transition-smooth);
}

.table tbody tr:hover {
    background-color: #f8f9ff;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.table tbody td {
    padding: 15px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    color: #4a5568;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbff;
}

/* Modern Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 16px;
    transition: var(--transition-smooth);
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-success {
    background: var(--success-gradient);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #3cba92 0%, #0ba360 100%);
}

.btn-info {
    background: var(--info-gradient);
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

.btn-warning {
    background: var(--warning-gradient);
    border: none;
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
}

.btn-danger {
    background: var(--danger-gradient);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #fee140 0%, #fa709a 100%);
}

/* Card Box Enhancements */
.card-box {
    background: white;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Message Blocks */
.messge-block h6 {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
    color: #2d5016;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(150, 230, 161, 0.3);
}

/* Main Content Area */
.right_col {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Responsive Table Action Buttons */
.table td .btn {
    margin: 2px;
    padding: 6px 12px;
    font-size: 13px;
}

.table td .btn i {
    margin: 0;
}

/* DataTable Pagination Modern Style */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    margin: 0 3px;
    transition: var(--transition-smooth);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none !important;
}

/* Search and Filter Inputs */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    transition: var(--transition-smooth);
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.x_panel,
.tile_stats_count {
    animation: fadeIn 0.5s ease-out;
}

/* Export Button Enhancement */
#exportBtn {
    background: var(--success-gradient);
    color: white;
    font-weight: 600;
    padding: 10px 25px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

#exportBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(11, 163, 96, 0.3);
}

#exportBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Title Right Section */
.title_right .input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Status Badge Styles */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 12px;
}

/* Clearfix Modern */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .tile_count .tile_stats_count {
        margin-bottom: 15px;
    }

    .page-title .title_left h3 {
        font-size: 22px;
    }

    .x_panel {
        padding: 15px;
    }

    .table td .btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #357ABD 0%, #4A90E2 100%);
}

/* ========================================= */
/* MODERN FORM STYLING */
/* ========================================= */

/* Multi-Step Form Container */
.form-wizard-container {
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-bottom: 30px;
}

/* Step Progress Indicator */
.form-step-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 20px;
    position: relative;
}

.form-step-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    z-index: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition-smooth);
    margin-bottom: 8px;
}

.step-indicator.active .step-circle {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.step-indicator.completed .step-circle {
    background: var(--success-gradient);
    border-color: var(--success-color);
    color: white;
}

.step-indicator.completed .step-circle::before {
    content: '✓';
    font-size: 18px;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
}

.step-indicator.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Form Step Content */
.step {
    animation: fadeInStep 0.4s ease-out;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step h2 {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* Modern Form Inputs */
.step .form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    transition: var(--transition-smooth);
    background-color: #F8F9FA;
}

.step .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    background-color: white;
    outline: none;
}

.step .form-group label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 13px;
}

/* Section Divider */
.form-section-divider {
    border-right: 2px solid var(--border-color);
    padding-right: 20px;
}

/* Form Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.btn-form-nav {
    padding: 12px 30px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: var(--secondary-gradient);
    color: white;
}

.btn-prev:hover {
    transform: translateX(-3px);
    box-shadow: 0 5px 15px rgba(127, 140, 141, 0.3);
}

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

.btn-next {
    background: var(--primary-gradient);
    color: white;
}

.btn-next:hover {
    transform: translateX(3px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.btn-submit {
    background: var(--success-gradient);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

/* Form Title Header */
.form-wizard-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.form-wizard-header h2 {
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.form-wizard-header .form-subtitle {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 8px;
}

/* Responsive Form Design */
@media (max-width: 768px) {
    .form-section-divider {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .form-step-progress {
        padding: 0 10px;
    }

    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .step-label {
        font-size: 10px;
    }

    .form-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .btn-form-nav {
        width: 100%;
        justify-content: center;
    }
}

/* Better Alert Messages */
.alert-success-custom {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid var(--success-color);
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger-custom {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid var(--danger-color);
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ========================================= */
/* MODERN ADD/EDIT USER FORM STYLING */
/* ========================================= */

/* Form Section Headers */
.form-section-header {
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    padding: 12px 20px;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-section-header h4 {
    margin: 0;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 600;
}

.form-section-header h4 i {
    color: var(--primary-color);
    margin-right: 8px;
}

/* Modern Form Group */
.modern-form-group {
    margin-bottom: 20px;
}

.modern-form-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
    display: block;
}

.modern-form-group label i {
    color: var(--primary-color);
    margin-right: 5px;
}

.required-star {
    color: var(--danger-color);
    margin-left: 3px;
}

/* Modern Input Styling */
.modern-input {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    transition: var(--transition-smooth);
    background-color: #F8F9FA;
}

.modern-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    background-color: white;
    outline: none;
}

.modern-input::placeholder {
    color: #ADB5BD;
    font-style: italic;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition-smooth);
    padding: 5px;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Form Help Text */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-light);
}

/* Error Messages */
.error-message {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

.error-message i {
    margin-right: 5px;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

/* Modern Form Centering */
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Form */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn-form-nav {
        width: 100%;
    }

    .password-toggle {
        right: 10px;
    }
}
