/* ELEGANT DARK SLATE THEME */
:root {
    /* Elegant Theme Primary Colors */
    --bs-primary: #34495E; /* Wet Asphalt */
    --bs-primary-dark: #2C3E50; /* Midnight Blue */
    --bs-primary-light: #4A6572; /* Lighter Slate */
    --bs-accent: #16A085; /* Green Sea */
    
    /* Bootstrap Standard Colors - Adjusted for Elegance */
    --bs-secondary: #7F8C8D; /* Asbestos */
    --bs-success: #27AE60; /* Nephritis */
    --bs-info: #2980B9; /* Belize Hole */
    --bs-warning: #F39C12; /* Orange */
    --bs-danger: #C0392B; /* Pomegranate */
    --bs-light: #FDFEFE; /* Almost White */
    --bs-dark: #212529;
    --bs-white: #fff;
    --bs-gray-100: #f8f9fa; /* Main background */
    --bs-gray-200: #e9ecef;
    --bs-gray-300: #dee2e6;
    --bs-gray-400: #ced4da;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #6c757d;
    --bs-gray-700: #495057;
    --bs-gray-800: #343a40;
    --bs-gray-900: #212529;
    
    /* Gradient colors */
    --bs-blue-gradient-start: var(--bs-primary);
    --bs-blue-gradient-end: var(--bs-primary-dark);

    /* Sidebar widths */
    --sidebar-width-expanded: 220px;
    --sidebar-width-collapsed: 70px;
}

html, body {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 1rem;
    background: var(--bs-gray-100);
    color: var(--bs-dark);
    margin: 0;
    padding: 0;
}

/*h1, h2, h3, h4, h5, h6, .card-title, .modal-title, .navbar-brand {
    color: var(--bs-dark);
    font-weight: 600;
    margin-bottom: 1rem;
}*/
/* Native styles for headings */
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* General label and form label styles */
label, .form-label {
    color: var(--bs-dark);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Text color utilities for primary, success, danger, warning, info, dark, and light contexts */
.text-muted, .text-secondary { color: var(--bs-gray-600) !important; }
.text-primary { color: var(--bs-primary) !important; }
.text-success { color: var(--bs-success) !important; }
.text-danger { color: var(--bs-danger) !important; }
.text-warning { color: var(--bs-warning) !important; }
.text-info { color: var(--bs-info) !important; }
.text-dark { color: var(--bs-dark) !important; }
.text-light { color: var(--bs-light) !important; }

/* Button default styles and hover/focus states */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    background: var(--bs-primary);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover, .btn:focus {
    background: var(--bs-primary-dark);
    color: #fff;
}

/* Secondary button styles */
.btn-secondary {
    background: var(--bs-secondary);
    color: #fff;
}
.btn-secondary:hover, .btn-secondary:focus {
    background: #565e64;
    color: #fff;
}

/* Danger button styles */
.btn-danger {
    background: var(--bs-danger);
    color: #fff;
}
.btn-danger:hover, .btn-danger:focus {
    background: #bb2d3b;
    color: #fff;
}

/* Success button styles */
.btn-success {
    background: var(--bs-success);
    color: #fff;
}
.btn-success:hover, .btn-success:focus {
    background: #157347;
    color: #fff;
}

/* Light button styles */
.btn-light {
    background: var(--bs-light);
    color: var(--bs-dark);
    border: 1px solid var(--bs-gray-300);
}

/* Primary outline button styles */
.btn-outline-primary {
    background: transparent;
    color: var(--bs-primary);
    border: 1.5px solid var(--bs-primary);
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--bs-primary);
    color: #fff;
}

/* Logout button styles specific to blue theme */
.btn-logout {
    background: var(--bs-primary) !important;   /* Changed to blue theme */
    color: #fff !important;
    border: 1px solid var(--bs-primary) !important;
}
.btn-logout:hover, .btn-logout:focus {
    background: var(--bs-primary-dark) !important;
    color: #fff !important;
    border: 1px solid var(--bs-primary-dark) !important;
}

/* Styles for form controls and selects including focus states */
.form-control, .form-select {
    background: var(--bs-white);
    color: var(--bs-dark);
    border: 1px solid var(--bs-gray-400);
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    transition: border 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(52, 73, 94, .25);
}

/* Custom checkbox input styles */
.form-check-input {
    border: 1px solid var(--bs-gray-400);
    border-radius: 0.25rem;
    background: var(--bs-white);
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.5em;
}
.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Input group text styles */
.input-group-text {
    background: var(--bs-gray-200);
    color: var(--bs-dark);
    border: 1px solid var(--bs-gray-400);
    border-radius: 0.375rem 0 0 0.375rem;
    font-weight: 500;
}

/* Card component styles including header and body */
.card {
    background: var(--bs-white);
    color: var(--bs-dark);
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.5rem;
    box-shadow: 0 0.1rem 0.7rem rgba(0,0,0,0.06);
    margin-bottom: 1.2rem;
    overflow: hidden;
}
.card-header {
    background: var(--bs-gray-200);
    color: var(--bs-dark);
    font-weight: 600;
    border-bottom: 1px solid var(--bs-gray-300);
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1rem 1.5rem;
}
.card-body {
    padding: 1.5rem;
    background: var(--bs-white);
    color: var(--bs-dark);
}

/* Table styles including header, body, and hover states */
.table {
    width: 100%;
    background: var(--bs-white);
    color: var(--bs-dark);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.375rem;
    overflow: hidden;
}
.table th, .table thead th {
    background: var(--bs-gray-200);
    color: var(--bs-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--bs-gray-300);
    padding: 0.75rem 1rem;
}
.table td {
    background: var(--bs-white);
    color: var(--bs-dark);
    border-bottom: 1px solid var(--bs-gray-300);
    padding: 0.75rem 1rem;
}
.table-hover tbody tr:hover {
    background: var(--bs-gray-200);
}

/* Alert component styles for different contexts */
.alert {
    border-radius: 0.5rem;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.alert-success { background: #d1e7dd; color: #0f5132; }
.alert-danger { background: #f8d7da; color: #842029; }
.alert-warning { background: #fff3cd; color: #664d03; }
.alert-info { background: #cff4fc; color: #055160; }

/* Badge component styles */
.badge {
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge.bg-primary { background: var(--bs-primary); color: #fff; }
.badge.bg-success { background: var(--bs-success); color: #fff; }
.badge.bg-danger { background: var(--bs-danger); color: #fff; }
.badge.bg-warning { background: var(--bs-warning); color: #212529; }
.badge.bg-secondary { background: var(--bs-secondary); color: #fff; }

/* Pagination Styles */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.375rem;
    gap: 0.25rem;
}

.page-item {
    position: relative;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: 0;
    line-height: 1.25;
    color: var(--bs-primary);
    background-color: var(--bs-white);
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.375rem;
    text-decoration: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    font-weight: 500;
    min-width: 2.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-link:hover {
    z-index: 2;
    color: var(--bs-primary-dark);
    background-color: var(--bs-gray-200);
    border-color: var(--bs-primary);
    text-decoration: none;
}

.page-link:focus {
    z-index: 3;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(52, 73, 94, 0.25);
}

.page-item:not(:first-child) .page-link {
    margin-left: 0;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    font-weight: 600;
}

.page-item.disabled .page-link {
    color: var(--bs-gray-600);
    pointer-events: none;
    background-color: var(--bs-white);
    border-color: var(--bs-gray-300);
    opacity: 0.65;
    cursor: not-allowed;
}

.pagination-sm .page-link {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    min-width: 2rem;
}

.pagination-lg .page-link {
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    min-width: 3rem;
}

/* Pagination navigation buttons */
.page-link i {
    font-size: 0.875rem;
}

/* WhatsApp Templates specific pagination styles */
.whatsapp-templates-pagination {
    background: var(--bs-white);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--bs-gray-600);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-info .badge {
    background: var(--bs-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.125rem;
    }
    
    .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
        min-width: 2rem;
    }
    
    .pagination-info {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }
}

/* Page Layout */
.page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, var(--bs-primary) 0%, var(--bs-primary-dark) 70%);
    width: var(--sidebar-width-expanded);
    min-width: var(--sidebar-width-expanded);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 15px rgba(25,118,210,0.15);
    z-index: 100;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 0 1rem 1rem 0;
    padding-top: 0.5rem;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
    min-width: var(--sidebar-width-collapsed);
}

/* Main Content Area */
.main-content {
    flex: 1;
    background: var(--bs-gray-100);
    color: var(--bs-dark);
    padding: 2rem 1.5rem;
    min-width: 0;
    margin-left: var(--sidebar-width-expanded);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-width-collapsed);
}

/* Top Row */
.top-row {
    background: linear-gradient(90deg, var(--bs-primary-light), var(--bs-primary));
    color: white;
    border-radius: 0 0 1rem 1rem;
    margin: -2rem -1.5rem 1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.top-row a {
    color: white;
    text-decoration: none;
}

.top-row .btn-outline-light {
    border-color: rgba(255,255,255,0.5);
    color: white;
}

.top-row .btn-outline-light:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: white;
}

/* Navigation Styles */
.navbar-header {
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.5rem;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.navbar-brand {
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.btn-toggle {
    cursor: pointer;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    transition: background-color 0.15s ease;
    background: transparent;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.btn-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

.btn-toggle i {
    transition: transform 0.3s ease;
}

/* Nav section headers */
.nav-section-header {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem;
    margin: 1rem 0.5rem 0.5rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.nav-collapsed .nav-section-header {
    padding: 0.5rem 0.25rem;
    margin: 1rem 0.25rem 0.5rem 0.25rem;
    text-align: center;
    border-bottom: none;
}

.nav-collapsed .nav-section-header span {
    display: none;
}

.nav-collapsed .nav-section-header i {
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
}

/* Navigation link styles including active and hover states */
.nav-link {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.9) !important;
    text-decoration: none;
    padding: 0.75rem 1rem;
    margin: 0.1rem 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    margin: 0.1rem 0.25rem;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff !important;
    transform: translateX(2px);
}

.nav-collapsed .nav-link:hover {
    transform: none;
}

.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-link .bi {
    font-size: 1.1rem;
    width: 1.2rem;
    display: inline-block;
    text-align: center;
    min-width: 1.2rem;
    flex-shrink: 0;
}

.nav-collapsed .nav-link .bi {
    margin-right: 0;
}

/* Nav text visibility */
.nav-text {
    transition: opacity 0.3s ease;
}

/* Responsive design adjustments for page content, sidebar, and navigation */
@media (max-width: 900px) {
    .sidebar { 
        width: 60vw; 
        min-width: 120px; 
    }
    .sidebar.collapsed { 
        width: var(--sidebar-width-collapsed); 
        min-width: var(--sidebar-width-collapsed); 
    }
    .main-content { 
        margin-left: 60vw; 
    }
    .main-content.sidebar-collapsed { 
        margin-left: var(--sidebar-width-collapsed); 
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100vw !important;
        min-width: unset !important;
        position: fixed;
        left: 0; 
        top: 0;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 15px rgba(0,0,0,0.18);
    }
    .sidebar.show { 
        transform: translateX(0); 
    }
    .sidebar.collapsed {
        width: var(--sidebar-width-collapsed) !important;
        min-width: var(--sidebar-width-collapsed) !important;
        transform: translateX(0);
    }
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0; 
        left: 0;
        width: 100vw; 
        height: 100vh;
        background: rgba(0,0,0,0.45);
        z-index: 1049;
        pointer-events: auto;
        display: block;
    }
    .sidebar:not(.show)::before { 
        display: none; 
    }
    .sidebar.collapsed::before { 
        display: none; 
    }
    .main-content { 
        margin-left: 0; 
    }
    .main-content.sidebar-collapsed { 
        margin-left: var(--sidebar-width-collapsed); 
    }
}

/* Print styles for cleaner output */
@media print {
    .sidebar, .top-row, .btn, .alert { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .card { border: 1px solid #000 !important; box-shadow: none !important; break-inside: avoid; }
    .table { border: 1px solid #000 !important; }
}
