/* ============================================
   Uptrix - Base Styles
   Global styles, sidebar, variables, utilities
   ============================================ */

/* ============================================
   Global scale: UI at 90% at 100% browser zoom
   (matches visual at 90% zoom without user change).
   Height compensation so scaled layout fills viewport (no gap at bottom).
   ============================================ */
html {
    scroll-behavior: smooth;
    font-size: 90%;
}



/* ============================================
   CSS Variables & Base Styles
   ============================================ */

:root {
    /* Color Palette — Uptrix (logo-derived) */
    --primary-text: #0f172a;
    --page-bg: #f1f5f9;
    --card-bg: #ffffff;
    --primary-accent: #0d9488;
    --secondary-accent: #2563eb;
    --sidebar-bg: #121826;
    --border-color: #E5E7EB;
    --hover-bg: #F3F4F6;
    --text-muted: #6B7280;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
}

/* Typography - Poppins Font */
* {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--page-bg);
    color: var(--primary-text);
    font-weight: 400;
    line-height: 1.6;
    font-size: 0.9rem;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-text);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.95rem; }

/* ============================================
   Sidebar Styles
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 75px;
    background: var(--sidebar-bg);
    color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar:hover,
.sidebar.expanded {
    width: 250px;
}

.sidebar-header {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    transition: padding 0.3s ease;
}

.sidebar:hover .sidebar-header,
.sidebar.expanded .sidebar-header {
    padding: 0.625rem 1.5rem;
}

.sidebar-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 0.4rem;
}

.sidebar-logo-icon {
    height: 42px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
    opacity: 0.95;
}

.sidebar:hover .sidebar-logo-icon,
.sidebar.expanded .sidebar-logo-icon {
    opacity: 1;
}

.sidebar-logo-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
}

.sidebar:hover .sidebar-logo-text,
.sidebar.expanded .sidebar-logo-text {
    opacity: 1;
    width: auto;
}

.sidebar-header h4 {
    margin: 0;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.sidebar-header h4 i {
    color: var(--primary-accent);
    margin-right: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.9375rem 1rem;
    transition: all 0.2s ease, padding 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 400;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    line-height: 1.5;
    white-space: nowrap;
    justify-content: flex-start;
}

.sidebar:hover .sidebar-nav .nav-link,
.sidebar.expanded .sidebar-nav .nav-link {
    padding: 0.9375rem 1.5rem;
}

.sidebar-nav .nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
}

.sidebar:hover .sidebar-nav .nav-link span,
.sidebar.expanded .sidebar-nav .nav-link span {
    opacity: 1;
    width: auto;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: var(--secondary-accent);
}

.sidebar-nav .nav-link.active {
    background: rgba(192, 74, 90, 0.15);
    color: white;
    border-left-color: var(--primary-accent);
    font-weight: 500;
}

.sidebar-nav .nav-link.active i {
    color: var(--primary-accent);
}

.sidebar-nav .nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.125rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: padding 0.3s ease;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.sidebar:hover .sidebar-footer,
.sidebar.expanded .sidebar-footer {
    padding: 1.5rem;
    align-items: stretch;
}

.user-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: justify-content 0.3s ease;
    min-height: 48px;
}

.sidebar:hover .user-info,
.sidebar.expanded .user-info {
    justify-content: flex-start;
}

.user-info i {
    font-size: 1.5rem;
    margin-right: 0;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    transition: margin-right 0.3s ease;
}

.sidebar:hover .user-info i,
.sidebar.expanded .user-info i {
    margin-right: 0.5rem;
}

.user-info .user-info-text-wrapper {
    display: none;
    flex-direction: column;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar:hover .user-info .user-info-text-wrapper,
.sidebar.expanded .user-info .user-info-text-wrapper {
    display: flex;
    opacity: 1;
    width: auto;
}

.user-info .user-info-text-wrapper > span {
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: block;
    color: rgba(255, 255, 255, 0.95);
}

.user-info .user-info-text-wrapper small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    display: block;
}

/* ============================================
   Main Content Area
   ============================================ */

.main-content {
    margin-left: 0;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background-color: var(--page-bg);
}

.main-content.with-sidebar {
    margin-left: 75px;
    transition: margin-left 0.3s ease;
}

.sidebar:hover ~ .main-content.with-sidebar,
.sidebar.expanded ~ .main-content.with-sidebar {
    margin-left: 250px;
}

.main-content .container-fluid {
    padding: 2rem;
    animation: pageFadeIn 0.5s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Page Headers
   ============================================ */

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.5s ease-out 0.1s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 i {
    color: var(--secondary-accent);
    margin-right: 0.5rem;
}

/* ============================================
   Cards (Base)
   ============================================ */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    animation: cardFadeIn 0.5s ease-out both;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    color: var(--primary-text);
    border-radius: 12px 12px 0 0 !important;
    animation: fadeIn 0.4s ease-out 0.2s both;
    font-size: 0.95rem;
}

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

.card-body {
    padding: 1.5rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border: none;
}

.btn i {
    margin-right: 0.375rem;
}

/* Primary Button */
.btn-primary {
    background-color: var(--primary-accent);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #B83A4A;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(192, 74, 90, 0.3);
}

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

/* Secondary Button */
.btn-outline-primary {
    border: 1.5px solid var(--secondary-accent);
    color: var(--secondary-accent);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--secondary-accent);
    color: white;
    border-color: var(--secondary-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(15, 76, 92, 0.2);
}

.btn-outline-secondary {
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--hover-bg);
    color: var(--primary-text);
    border-color: var(--border-color);
}

/* Success outline (e.g. Download as Excel) - green border + text, same pattern as outline-danger */
.btn-outline-success {
    border: 1.5px solid #198754;
    color: #198754;
    background: transparent;
}

.btn-outline-success:hover {
    background-color: #198754;
    color: white;
    border-color: #198754;
}

/* Danger Button */
.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-outline-danger {
    border: 1.5px solid var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background-color: var(--danger);
    color: white;
}

.sidebar-logout-btn {
    width: auto;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    margin: 0 auto;
    border-radius: 6px;
}

.sidebar:hover .sidebar-logout-btn,
.sidebar.expanded .sidebar-logout-btn {
    justify-content: center;
    width: auto;
    min-width: auto;
    padding: 0.5rem 1rem;
}

.sidebar-logout-btn i {
    margin-right: 0;
    flex-shrink: 0;
    transition: margin-right 0.3s ease;
}

.sidebar:hover .sidebar-logout-btn i,
.sidebar.expanded .sidebar-logout-btn i {
    margin-right: 0.375rem;
}

.sidebar-logout-btn span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
}

.sidebar:hover .sidebar-logout-btn span,
.sidebar.expanded .sidebar-logout-btn span {
    opacity: 1;
    width: auto;
}

/* Small Buttons */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ============================================
   Forms
   ============================================ */

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

.form-control,
.form-select {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: var(--card-bg);
    color: var(--primary-text);
}

/* Native select: keep chevron inside the control (Bootstrap arrow + room on the right) */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.625rem 2.75rem 0.625rem 0.875rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%231f3326' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-accent);
    box-shadow: 0 0 0 3px rgba(15, 76, 92, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ============================================
   Badges
   ============================================ */

.badge {
    padding: 0.5em 0.875em;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.85rem;
    animation: badgePop 0.3s ease-out both;
    animation-delay: 0.4s;
    transition: transform 0.2s ease;
}

@keyframes badgePop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.badge:hover {
    transform: scale(1.1);
}

.badge.bg-secondary {
    background-color: #9CA3AF !important;
    color: white;
}

.badge.bg-info {
    background-color: var(--secondary-accent) !important;
    color: white;
}

.badge.bg-primary {
    background-color: var(--primary-accent) !important;
    color: white;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: white;
}

.badge.bg-success {
    background-color: var(--success) !important;
    color: white;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
    color: white;
}

/* ============================================
   Flash Messages
   ============================================ */

.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    max-width: 500px;
}

.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.25rem;
    font-weight: 400;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid var(--info);
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--warning);
}

/* ============================================
   Modals
   ============================================ */

/* Prevent background scroll when any modal is open */
html.modal-open,
body.modal-open {
    overflow: hidden;
}

/* Center modal vertically in viewport; all CRM modals (Selected Leads, Bulk Actions, Advanced Filters) */
.modal-dialog {
    display: flex;
    align-items: center;
    min-height: 100vh;
    margin: 0 auto;
}

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    flex-shrink: 0;
}

.modal-body {
    padding: 1.5rem;
    color: var(--primary-text);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.logout-modal-content {
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow:
        0 28px 56px rgba(15, 23, 42, 0.14),
        0 8px 20px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    background: #ffffff;
    animation: modalFadeIn 0.3s ease-out;
}

.logout-modal-accent {
    height: 4px;
    background: linear-gradient(
        90deg,
        #db2777 0%,
        #f97316 22%,
        #14b8a6 44%,
        #3b82f6 66%,
        #7c3aed 100%
    );
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.logout-icon-wrapper {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(145deg, #fff1f2 0%, #fef2f2 100%);
    border: 1px solid #fecdd3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e11d48;
    font-size: 1.65rem;
    box-shadow: 0 6px 18px rgba(225, 29, 72, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: iconPulse 0.6s ease-out 0.2s both;
}

@keyframes iconPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.logout-icon-wrapper:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 22px rgba(225, 29, 72, 0.18);
}

.logout-modal-content .modal-body {
    padding: 2rem 2rem 2.25rem;
    color: #0f172a;
}

.logout-modal-title {
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.4s ease-out 0.3s both;
}

.logout-modal-text {
    margin: 0 0 1.75rem;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1.5;
    animation: fadeInUp 0.4s ease-out 0.35s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logout-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
    animation: fadeInUp 0.4s ease-out 0.4s both;
}

.logout-modal-actions .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    min-width: 118px;
}

.logout-btn-cancel {
    color: #475569;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
}

.logout-btn-cancel:hover {
    color: #0f172a;
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.logout-btn-confirm {
    color: #ffffff;
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    border: none;
    box-shadow: 0 6px 16px rgba(225, 29, 72, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
}

.logout-btn-confirm:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.35);
}

/* Full-viewport overlay: fixed to viewport, above sidebar (z 1000) and all page content */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1045 !important;
}

/* Modal above overlay; above sidebar and backdrop */
.modal {
    position: fixed !important;
    z-index: 1050 !important;
}

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

/* ============================================
   Utility Classes
   ============================================ */

.text-muted {
    color: var(--text-muted) !important;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content.with-sidebar {
        margin-left: 0;
    }

    .main-content .container-fluid {
        padding: 1rem;
    }

    .flash-messages {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

/* ============================================
   Additional Polish
   ============================================ */

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--secondary-accent);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background-color: rgba(192, 74, 90, 0.2);
    color: var(--primary-text);
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Empty state styling */
.text-center.py-5 {
    color: var(--text-muted);
    animation: fadeIn 0.5s ease-out 0.3s both;
}

.text-center.py-5 i {
    opacity: 0.5;
}

/* Page header spacing */
.d-flex.justify-content-between.align-items-center.mb-4 {
    margin-bottom: 2rem !important;
}

/* Card header icons */
.card-header i {
    color: var(--secondary-accent);
    margin-right: 0.5rem;
}

/* Table responsive improvements */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

/* Table font sizes */
.table {
    font-size: 0.875rem;
}

.table tbody td {
    font-size: 0.875rem;
}

/* Form improvements */
.invalid-feedback {
    font-size: 0.875rem;
    color: var(--danger);
}

/* Link styling */
a {
    color: var(--primary-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #B83A4A;
}

/* Icon improvements */
i.bi {
    vertical-align: middle;
}

/* ============================================
   Uptrix Theme (logo palette: teal, blue, purple)
   ============================================ */

:root {
    --primary-text: #0f172a;
    --page-bg: #f1f5f9;
    --card-bg: #ffffff;
    --primary-accent: #0d9488;
    --primary-accent-dark: #0f766e;
    --primary-accent-deep: #115e59;
    --secondary-accent: #2563eb;
    --sidebar-bg: #121826;
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;
    --text-muted: #64748b;
    --success: #0d9488;
    --warning: #ea580c;
    --danger: #e11d48;
    --info: #7c3aed;
    --uptrix-teal: #0d9488;
    --uptrix-blue: #2563eb;
    --uptrix-purple: #7c3aed;
    --uptrix-magenta: #db2777;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background:
        radial-gradient(circle at 8% 12%, rgba(13, 148, 136, 0.08), transparent 44%),
        radial-gradient(circle at 92% 18%, rgba(37, 99, 235, 0.06), transparent 42%),
        radial-gradient(circle at 50% 100%, rgba(124, 58, 237, 0.04), transparent 38%),
        linear-gradient(165deg, #f0f4f8 0%, #f8fafc 48%, #eef2f7 100%);
}

/* Full-height main column: cool slate tone top-to-bottom */
.main-content {
    min-height: 100vh;
    background: linear-gradient(165deg, #f0f4f8 0%, #f8fafc 48%, #eef2f7 100%);
    background-color: #f1f5f9;
}

body.login-page .main-content {
    background: transparent !important;
    background-color: transparent !important;
}

.sidebar {
    background: linear-gradient(180deg, #1a2332 0%, #121826 55%, #0f172a 100%);
    color: #e8eef7;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: 14px 0 34px rgba(15, 23, 42, 0.35);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo-wrapper {
    gap: 0.7rem;
    align-items: center;
}

/* High-contrast mark so colorful logo reads on dark sidebar */
.sidebar-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 3px 14px rgba(0, 0, 0, 0.32),
        0 0 0 1px rgba(13, 148, 136, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.sidebar-logo-icon {
    height: 30px;
    width: auto;
    max-width: 32px;
    object-fit: contain;
    display: block;
    opacity: 1;
}

.sidebar-logo-text {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.sidebar:hover .sidebar-logo-text,
.sidebar.expanded .sidebar-logo-text {
    font-size: 1.5rem;
}

.sidebar-nav .nav-link {
    color: rgba(234, 241, 247, 0.88);
    border-left: 3px solid transparent;
    border-radius: 0 12px 12px 0;
    margin-right: 0.6rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-left-color: #38bdf8;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.38), rgba(37, 99, 235, 0.14));
    color: #ffffff;
    border-left-color: #2dd4bf;
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.22);
}

.sidebar-nav .nav-link i,
.sidebar-nav .nav-link.active i {
    color: #7dd3fc;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.user-info {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.user-info i {
    color: #d6eaf9;
}

.user-info .user-info-text-wrapper > span {
    color: #f3f8fc;
}

.user-info .user-info-text-wrapper small {
    color: rgba(224, 236, 247, 0.88);
}

/* Logout: default outline-danger is too dim on dark sidebar */
.sidebar .sidebar-logout-btn.btn-outline-danger {
    color: #ffe4e6;
    border-color: #fb7185;
    border-width: 1.5px;
    background: rgba(251, 113, 133, 0.18);
    font-weight: 600;
}

.sidebar .sidebar-logout-btn.btn-outline-danger i {
    color: #fecdd3;
}

.sidebar .sidebar-logout-btn.btn-outline-danger:hover,
.sidebar .sidebar-logout-btn.btn-outline-danger:focus-visible {
    color: #ffffff;
    border-color: #fda4af;
    background: #e11d48;
    box-shadow: 0 4px 16px rgba(225, 29, 72, 0.45);
}

.sidebar .sidebar-logout-btn.btn-outline-danger:hover i,
.sidebar .sidebar-logout-btn.btn-outline-danger:focus-visible i {
    color: #ffffff;
}

.main-content .container-fluid {
    padding: 2.2rem;
    min-height: 100vh;
    background: transparent;
    border-left: 1px solid #e2e8f0;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.7);
}

.card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
    background: #ffffff;
}

.card:hover {
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.card-header {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

.btn {
    border-radius: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--uptrix-teal) 0%, var(--uptrix-blue) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-accent-dark) 0%, #1d4ed8 100%);
    box-shadow: 0 8px 18px rgba(13, 148, 136, 0.28);
}

.btn-outline-primary {
    border: 1.5px solid var(--primary-accent);
    color: var(--primary-accent);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--uptrix-teal) 0%, var(--uptrix-blue) 100%);
    border-color: transparent;
    color: #fff;
}

.form-control,
.form-select {
    border-color: #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.625rem 2.75rem 0.625rem 0.875rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%231f3326' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.table-responsive {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.table thead th {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

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

.badge.bg-primary {
    background: linear-gradient(135deg, var(--uptrix-teal), var(--uptrix-blue)) !important;
}

.badge.bg-info {
    background-color: var(--uptrix-purple) !important;
}

a {
    color: var(--primary-accent);
}

a:hover {
    color: var(--primary-accent-dark);
}

.flash-messages .alert {
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

