/* Global Variables */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary-color: #0ea5e9;
    --secondary-hover: #0284c7;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.1), 0 10px 10px -5px rgba(79, 70, 229, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
body {
    font-family: var(--font-sans);
    background-color: #ffffff;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Typography & Headers */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-color);
}

/* Premium Layout Elements */
.glass-card {
    background: #ffffff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01), 0 2px 4px rgba(0, 0, 0, 0.01);
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.03), 0 4px 8px rgba(0, 0, 0, 0.01);
}

/* Navbar Custom Styling */
.navbar-custom {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1.5rem;
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #818cf8, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-custom .nav-link {
    color: #94a3b8 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
}

.navbar-custom .nav-link.active {
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Forms & Inputs */
.form-control, .form-select {
    font-family: var(--font-sans);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    outline: none;
}

.form-label {
    font-weight: 550;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    border: none;
    color: white;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background-color: #e2e8f0;
    border: none;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #cbd5e1;
    color: var(--text-primary);
}

/* Premium Dashboard Metrics */
.metric-card {
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: white;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-3px);
}

.metric-card.primary { border-left: 5px solid var(--primary-color); }
.metric-card.success { border-left: 5px solid var(--success-color); }
.metric-card.warning { border-left: 5px solid var(--warning-color); }
.metric-card.danger { border-left: 5px solid var(--danger-color); }

.metric-card .icon-container {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.metric-card.primary .icon-container { background-color: var(--primary-light); color: var(--primary-color); }
.metric-card.success .icon-container { background-color: #d1fae5; color: var(--success-color); }
.metric-card.warning .icon-container { background-color: #fef3c7; color: var(--warning-color); }
.metric-card.danger .icon-container { background-color: #fee2e2; color: var(--danger-color); }

/* Tables */
.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

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

/* Badge styles */
.badge-custom {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 6px;
}

/* Select2 Overrides */
.select2-container--default .select2-selection--single {
    height: 48px !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    transition: var(--transition);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    line-height: 28px !important;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
}

.select2-dropdown {
    border: 1.5px solid var(--border-color) !important;
    border-radius: 10px !important;
    box-shadow: var(--card-shadow) !important;
    overflow: hidden;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
}

/* Select2 Bootstrap 5 Input Group Integration */
.input-group > .select2-container {
    flex: 1 1 auto !important;
    width: 1% !important;
}

.input-group > .select2-container .select2-selection--single {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: none !important;
}

/* Assignment Columns UI */
.assign-column {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    height: 450px;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.assign-column::-webkit-scrollbar {
    width: 6px;
}

.assign-column::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.assign-column-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    padding-bottom: 0.75rem;
    border-bottom: 1.5px solid var(--border-color);
    margin-bottom: 1rem;
    z-index: 5;
}

.assign-column-header h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Indian Address Generator Custom CSS */
.address-preview-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    position: relative;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 260px;
    background-color: #ffffff; /* Match background color from reference image */
    transition: var(--transition);
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: #f3f4f8; /* Match light sidebar color from reference image */
    border-right: 1px solid #e2e8f0; /* Mapped from reference */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    color: #1e293b;
    transition: var(--transition);
}

.sidebar-brand-wrapper {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    display: flex;
    align-items: center;
}

.sidebar-brand-logo-container {
    background: #1e293b; /* Dark slate square logo from reference image */
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar-brand-logo-container i {
    color: #818cf8; /* Light blue icon */
    font-size: 1.25rem;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: #0f172a;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.sidebar-menu-wrapper {
    flex: 1;
    padding: 1rem 0.85rem;
    overflow-y: auto;
}

.sidebar-menu-wrapper::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.sidebar-nav-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8; /* Muted gray category headers from reference */
    font-weight: 700;
    padding: 0.85rem 0.75rem 0.4rem 0.75rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.sidebar-menu-item {
    margin-bottom: 0.2rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    color: #5e6e82; /* Muted slate text from reference */
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.sidebar-link-content {
    display: flex;
    align-items: center;
}

.sidebar-menu-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.05rem;
    text-align: center;
    color: #64748b;
    transition: var(--transition);
}

.sidebar-menu-link:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.02);
}

.sidebar-menu-link:hover i {
    color: #4f46e5;
}

.sidebar-menu-link.active {
    color: #0f172a;
    background: #ffffff; /* Active white card background from reference */
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04), 0 2px 4px rgba(15, 23, 42, 0.02); /* Active card shadow */
}

.sidebar-menu-link.active i {
    color: #4f46e5;
}

/* Badge counts on sidebar */
.sidebar-badge {
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.sidebar-badge.danger {
    background: #fef2f2;
    color: #ef4444;
}

/* Support widget inside sidebar from reference image */
.sidebar-support-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 8px;
    margin: 10px;
}

.sidebar-support-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    color: #5e6e82;
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-support-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
    text-align: center;
    color: #64748b;
}

.sidebar-support-link:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.02);
}

/* User profile section at the bottom of sidebar */
.sidebar-profile {
    padding: 1rem 1.25rem;
    border-top: 1px solid #eef2f6;
    background: #fcfdfe;
}

.sidebar-profile-info {
    margin-bottom: 0.5rem;
}

.sidebar-profile-username {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Theme selector simulation from reference image */
.sidebar-theme-switch {
    display: flex;
    background: #eef2f6;
    border-radius: 10px;
    padding: 2px;
    margin-top: 8px;
}

.sidebar-theme-btn {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    padding: 4px 0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-theme-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Mobile Toggle and Header */
.mobile-header {
    display: none;
    background: #f3f4f8;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.mobile-toggle {
    background: none;
    border: none;
    color: #1e293b;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* Page Breadcrumbs layout from reference image */
.page-breadcrumbs {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.page-breadcrumbs a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
}

.page-breadcrumbs a:hover {
    color: #4f46e5;
}

.page-breadcrumbs span.separator {
    margin: 0 6px;
}

.page-title-block {
    margin-bottom: 1.5rem;
}

.page-title-block h2 {
    font-weight: 700;
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 2px;
}

.page-title-block .page-date {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
}

/* Footer styling */
footer {
    background-color: #ffffff;
    color: #64748b;
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
}

/* Responsive media queries */
@media (max-width: 991.98px) {
    .main-wrapper {
        margin-left: 0;
    }
    
    .sidebar {
        left: -260px;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* Compact small table custom styling */
.table-sm th {
    font-size: 0.78rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569 !important;
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.6rem 0.5rem !important;
}

.table-sm td {
    font-size: 0.82rem !important;
    padding: 0.5rem 0.5rem !important;
}

.table-sm .btn-sm {
    font-size: 0.75rem !important;
    padding: 2px 12px !important;
}

/* Mobile Responsive Utility Classes */
@media (max-width: 767.98px) {
    .main-wrapper > div.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .page-title-block h2 {
        font-size: 1.4rem !important;
    }
    
    .glass-card {
        padding: 1.25rem !important;
        border-radius: 12px !important;
    }
    
    .metric-card {
        padding: 1.25rem !important;
        margin-bottom: 1rem;
    }
    
    /* Make custom forms stack nicely on mobile */
    .form-group, .mb-3, .mb-4 {
        margin-bottom: 0.85rem !important;
    }
}

@media (max-width: 575.98px) {
    .page-breadcrumbs {
        font-size: 0.72rem !important;
        margin-bottom: 0.25rem;
    }
    
    .page-title-block {
        margin-bottom: 1rem !important;
    }
    
    .page-title-block h2 {
        font-size: 1.25rem !important;
    }
    
    .sidebar-brand-wrapper {
        padding: 1rem 1rem 0.75rem 1rem;
    }
    
    .sidebar-brand-text {
        font-size: 1.15rem;
    }
    
    /* Smooth horizontal scrollbar for tables on mobile */
    .table-responsive::-webkit-scrollbar {
        height: 6px;
    }
    .table-responsive::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 3px;
    }
}

