/**
 * Cimcor Brand Theme
 * Based on Cimcor Brand Style Guide 2025
 *
 * This file contains all brand colors, fonts, and design tokens
 * Use this file to maintain brand consistency across the portal
 */

/* Import Fonts */
/* Removed Google Fonts dependency - using system font stack */

/* ===== ALPINE.JS UTILITIES ===== */
/* Hide elements with x-cloak until Alpine.js removes the attribute */
[x-cloak] {
    display: none !important;
}

/* ===== BRAND COLORS ===== */
:root {
    /* Primary Brand Colors */
    --cimcor-primary-blue: #0655A3;
    --cimcor-medium-blue: #6894CD;
    --cimcor-light-blue: #ACC2E4;
    --cimcor-dark-blue: #182F58;

    /* Background Colors */
    --cimcor-dark-blue-2: #012040;
    --cimcor-black: #0C0D0D;

    /* Accent Colors */
    --cimcor-green: #78C8AA;
    --cimcor-blue-accent: #209BCC;
    --cimcor-magenta: #B1004C;

    /* UI Colors */
    --cimcor-white: #FFFFFF;
    --cimcor-gray-light: #F8F9FA;
    --cimcor-gray: #6C757D;
    --cimcor-gray-dark: #495057;

    /* Status Colors */
    --cimcor-success: #78C8AA;
    --cimcor-warning: #209BCC;
    --cimcor-danger: #B1004C;

    /* Gradients */
    --cimcor-gradient-primary: linear-gradient(135deg, var(--cimcor-primary-blue) 0%, var(--cimcor-dark-blue) 100%);
    --cimcor-gradient-bg: linear-gradient(135deg, var(--cimcor-dark-blue-2) 0%, var(--cimcor-black) 100%);
    --cimcor-gradient-secondary: linear-gradient(135deg, var(--cimcor-medium-blue) 0%, var(--cimcor-light-blue) 100%);
}

/* ===== TYPOGRAPHY ===== */
:root {
    --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Base Typography */
body {
    font-family: var(--font-body);
    color: var(--cimcor-gray-dark);
    line-height: 1.6;
    background: var(--cimcor-gray-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--cimcor-dark-blue);
}

h1 { font-size: 36px; margin-bottom: 16px; }
h2 { font-size: 28px; margin-bottom: 14px; }
h3 { font-size: 22px; margin-bottom: 12px; }
h4 { font-size: 18px; margin-bottom: 10px; }

/* ===== BUTTONS ===== */
.btn {
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6, 85, 163, 0.4);
}

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

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(104, 148, 205, 0.4);
}

/* ===== CARDS ===== */
.card {
    background: var(--cimcor-white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-primary {
    border-left: 4px solid var(--cimcor-primary-blue);
}

/* Compact cards for dashboards - more vertical density */
.card-compact {
    padding: 16px 20px !important;
}

.card-compact .card-body {
    padding: 0 !important;
}

.card-compact h3, .card-compact .h5 {
    margin-bottom: 8px !important;
    font-size: 1rem !important;
}

.card-compact p {
    margin-bottom: 12px !important;
    font-size: 0.875rem !important;
}

/* Compact stats blocks */
.stats-compact {
    padding: 12px 20px !important;
}

.stats-compact .card-body {
    padding: 0 !important;
}

.stats-compact h2, .stats-compact .h4 {
    font-size: 0.875rem !important;
    margin-bottom: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cimcor-gray-dark);
}

.stats-compact .stat-number {
    font-size: 1.75rem !important;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stats-compact .stat-label {
    font-size: 0.75rem !important;
    margin-bottom: 0;
}

/* Modal z-index fixes - ensure modals appear above navigation */
.modal-backdrop {
    z-index: 2040 !important;
}

.modal {
    z-index: 2050 !important;
}

/* Specific modals */
#impersonationModal,
#viewAsModal,
#inviteModal,
#editUserModal,
#createUserModal {
    z-index: 2050 !important;
}


/* Minimal styling for View As modal - clean Bootstrap appearance */
.user-item {
    cursor: pointer;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.user-item:hover {
    background-color: #f8f9fa;
}

/* ===== HEADER ===== */
.cimcor-header {
    background: var(--cimcor-gradient-primary);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cimcor-logo {
    height: 40px;
    width: auto;
}

/* ===== NAVIGATION HEADER ===== */
/* Main navigation bar for app pages */
.nav-header {
    background: var(--cimcor-gradient-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    height: 60px;
    max-height: 60px;
    overflow: visible;
    position: relative;
    z-index: 1030;
}

/* Partner Navigation Component Styles */
.partner-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--cimcor-white);
}

/* Force navigation logo size - highest specificity */
.nav-header .partner-nav .nav-brand .nav-logo,
.partner-nav .nav-brand .nav-logo,
img.nav-logo {
    height: 32px !important;
    width: auto !important;
    max-height: 32px !important;
    max-width: none !important;
}

.nav-brand .nav-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cimcor-white);
    font-family: var(--font-heading);
}

.nav-main {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-section {
    position: relative;
}

.nav-section-toggle {
    color: var(--cimcor-light-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    padding: 8px 12px;
    border-radius: 4px;
}

.nav-section-toggle:hover {
    color: var(--cimcor-white);
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-section-items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--cimcor-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    z-index: 9999;
}

.nav-section-items .nav-item {
    display: block;
    padding: 8px 16px;
    color: var(--cimcor-dark-blue);
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-section-items .nav-item:hover {
    background-color: var(--cimcor-gray-light);
}

/* ===== PARTNER HORIZONTAL NAVIGATION DROPDOWNS ===== */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    color: var(--cimcor-light-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown-toggle:hover {
    color: var(--cimcor-white);
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.nav-dropdown-items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--cimcor-white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 200px;
    z-index: 9999;
    margin-top: 4px;
}

.nav-dropdown-items .nav-child-item {
    display: block;
    padding: 8px 16px;
    color: var(--cimcor-dark-blue);
    text-decoration: none;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-dropdown-items .nav-child-item:hover {
    background-color: var(--cimcor-gray-light);
    text-decoration: none;
}

.nav-icon {
    margin-right: 8px;
}

.dropdown-arrow {
    font-size: 0.8em;
    margin-left: 4px;
}

/* Make sure horizontal nav items don't wrap */
.nav-main {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

/* Direct nav items (non-dropdown) */
.nav-main > .nav-item {
    color: var(--cimcor-light-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.nav-main > .nav-item:hover {
    color: var(--cimcor-white);
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.nav-user {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: var(--cimcor-white);
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.user-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--cimcor-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 180px;
    z-index: 9999 !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 8px;
}

/* Ensure the user menu container has proper positioning */
.nav-user {
    position: relative;
}

.user-menu {
    position: relative;
}

.user-menu-item {
    display: block;
    padding: 8px 16px;
    color: var(--cimcor-dark-blue);
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-menu-item:hover {
    background-color: var(--cimcor-gray-light);
}

/* Legacy navigation styles for compatibility */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--cimcor-white);
    font-family: var(--font-heading);
}

.nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav a {
    color: var(--cimcor-light-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.nav a:hover {
    color: var(--cimcor-white);
}

.nav button {
    background: none;
    border: none;
    color: var(--cimcor-light-blue);
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-body);
    transition: color 0.3s;
}

.nav button:hover {
    color: var(--cimcor-white);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--cimcor-dark-blue);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--cimcor-light-blue);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--cimcor-primary-blue);
    box-shadow: 0 0 0 4px rgba(6, 85, 163, 0.1);
}

.form-section {
    margin-bottom: 32px;
}

.form-section h3 {
    color: var(--cimcor-dark-blue);
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cimcor-light-blue);
    font-family: var(--font-heading);
}

.help-text {
    font-size: 13px;
    color: #6B7280;
    margin-top: 4px;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #FFF3CD;
    color: #856404;
}

.status-approved {
    background: #D4EDDA;
    color: #155724;
}

.status-denied {
    background: #F8D7DA;
    color: #721C24;
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--cimcor-primary-blue); }
.text-secondary { color: var(--cimcor-medium-blue); }
.text-muted { color: var(--cimcor-gray); }

.bg-primary { background: var(--cimcor-primary-blue); }
.bg-gradient { background: var(--cimcor-gradient-bg); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cimcor-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
}

/* ===== HERO SECTION ===== */
/* Full-width hero banner for page headers */
.hero {
    background: var(--cimcor-gradient-primary);
    color: white;
    padding: 60px 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin: -32px -32px 32px -32px;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 16px;
    font-family: var(--font-heading);
    color: white;
}

.hero p {
    font-size: 18px;
    opacity: 0.95;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
}

/* ===== CONTAINER ===== */
/* Centered content container with max-width */
.container {
    max-width: 1400px;
    margin: 24px auto 60px;
    padding: 0 24px;
}

/* ===== SECTION CARDS ===== */
/* Reusable card sections for content blocks */
.section-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--cimcor-light-blue);
}

.section-header h2 {
    font-size: 28px;
    color: var(--cimcor-dark-blue);
    font-family: var(--font-heading);
    margin: 0;
}

/* ===== STAT BOXES ===== */
/* Statistics display cards */
.stat-box,
.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(6, 85, 163, 0.15);
}

/* ===== STATS - COMPACT DESIGN FOR ALL PAGES ===== */
.stat-number,
.stat-value {
    font-size: 1.75rem !important;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 4px;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem !important;
    color: var(--cimcor-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0;
}

/* Apply compact styling to all stat containers */
.stats,
.stats-grid,
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.stat-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 2rem;
    opacity: 0.2;
}

.stat-change {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: var(--cimcor-green);
}

.stat-change.negative {
    color: var(--cimcor-magenta);
}


/* ===== FILTER SECTION ===== */
/* Filter controls for data tables and lists */
.filter-section,
.filter-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-row,
.filter-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--cimcor-dark-blue);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--cimcor-light-blue);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--font-body);
    transition: border-color 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--cimcor-primary-blue);
    box-shadow: 0 0 0 4px rgba(6, 85, 163, 0.1);
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== PROGRESS BARS ===== */
/* Progress indicators and bars */
.progress-bars {
    display: grid;
    gap: 24px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-weight: 600;
    color: var(--cimcor-dark-blue);
    font-size: 12px;
}

.progress-value {
    font-weight: 700;
    color: var(--cimcor-primary-blue);
}

.progress-bar {
    height: 12px;
    background: var(--cimcor-light-blue);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--cimcor-gradient-primary);
    border-radius: 6px;
    transition: width 1s ease-out;
}

/* ===== TABS ===== */
/* Tab navigation component */
.tabs {
    background: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab {
    flex: 1;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--cimcor-gray);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background: #F8F9FA;
}

.tab.active {
    color: var(--cimcor-primary-blue);
    border-bottom-color: var(--cimcor-primary-blue);
}

.tab-content {
    padding: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
}

/* ===== MODAL ===== */
/* Modal/dialog overlays */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--cimcor-dark-blue);
    font-family: var(--font-heading);
    margin: 0;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-body textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--cimcor-light-blue);
    border-radius: 8px;
    font-family: var(--font-body);
    resize: vertical;
    min-height: 100px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== EMPTY STATE ===== */
/* Empty state messages */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state h3 {
    font-size: 24px;
    color: var(--cimcor-gray-dark);
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.empty-state p {
    color: var(--cimcor-gray);
    font-size: 16px;
}

/* ===== LOADING STATE ===== */
/* Loading indicators */
.loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    color: var(--cimcor-gray);
}

/* ===== BACK LINK ===== */
/* Navigation back links */
.back-link {
    color: var(--cimcor-primary-blue);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-link:hover {
    background: var(--cimcor-light-blue);
    transform: translateX(-4px);
}

/* ===== TABLE STYLES ===== */
/* Data tables */
.deals-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--cimcor-gradient-primary);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-heading);
}

td {
    padding: 15px;
    border-bottom: 1px solid #E9ECEF;
    color: #495057;
}

tbody tr:hover {
    background: #F8F9FA;
}

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

@media (max-width: 768px) {
    .deals-table {
        overflow-x: auto;
    }

    table {
        min-width: 800px;
    }
}

/* ===== CONFLICT INDICATOR ===== */
/* Deal conflict indicators */
.conflict-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.conflict-yes {
    background: var(--cimcor-magenta);
    box-shadow: 0 0 8px rgba(177, 0, 76, 0.4);
}

.conflict-no {
    background: var(--cimcor-green);
}

.conflict-alert {
    background: #F8D7DA;
    border-left: 4px solid #DC3545;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #721C24;
}

.conflict-alert h3 {
    margin-bottom: 5px;
    font-size: 18px;
}

/* ===== INFO GRID ===== */
/* Information display grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-item {
    margin-bottom: 15px;
}

.info-label {
    font-size: 12px;
    color: var(--cimcor-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
    display: block;
}

.info-value {
    font-size: 16px;
    color: #1A2B3C;
    font-weight: 500;
}

.info-value.empty {
    color: #ADB5BD;
    font-style: italic;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== ALERTS ===== */
/* Alert/notification messages */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.alert.success {
    background: rgba(120, 200, 170, 0.2);
    border: 1px solid var(--cimcor-green);
    color: var(--cimcor-green);
}

.alert.error {
    background: #F8D7DA;
    border: 1px solid #DC3545;
    color: #721C24;
}

.alert.info {
    background: rgba(32, 155, 204, 0.2);
    border: 1px solid var(--cimcor-blue-accent);
    color: var(--cimcor-blue-accent);
}

/* ===== BUTTON EXTENSIONS ===== */
/* Additional button styles beyond base buttons */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-view {
    background: var(--cimcor-primary-blue);
    color: white;
}

.btn-view:hover {
    background: var(--cimcor-medium-blue);
    transform: translateY(-1px);
}

.btn-approve {
    background: var(--cimcor-green);
    color: white;
}

.btn-approve:hover {
    background: #66B999;
    transform: translateY(-1px);
}

.btn-deny {
    background: var(--cimcor-magenta);
    color: white;
}

.btn-deny:hover {
    background: #990042;
    transform: translateY(-1px);
}

.btn-submit {
    padding: 14px 32px;
    background: var(--cimcor-gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6, 85, 163, 0.4);
}

.btn:disabled,
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== FORM ROW ===== */
/* Multi-column form layouts */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label.required::after {
    content: " *";
    color: var(--cimcor-magenta);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== TIMELINE ===== */
/* Event timeline display */
.timeline {
    margin-top: 20px;
}

.timeline-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #E9ECEF;
}

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

.timeline-icon {
    width: 40px;
    height: 40px;
    background: var(--cimcor-gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    color: #1A2B3C;
    margin-bottom: 3px;
}

.timeline-date {
    font-size: 14px;
    color: var(--cimcor-gray);
}

/* ===== HEADER CARDS ===== */
/* Page header sections */
.header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: var(--cimcor-dark-blue);
    font-size: 32px;
    margin-bottom: 10px;
    font-family: var(--font-heading);
}

.header p {
    color: var(--cimcor-gray);
    font-size: 16px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--cimcor-dark-blue);
    font-family: var(--font-heading);
    margin: 0;
}

.page-header p {
    font-size: 16px;
    color: var(--cimcor-gray);
    margin: 0;
}

/* ===== VALUE HIGHLIGHTS ===== */
/* Special value displays */
.value-highlight {
    font-size: 24px;
    font-weight: 700;
    color: var(--cimcor-green);
}

.amount-highlight {
    font-size: 20px;
    font-weight: 700;
    color: var(--cimcor-green);
}

/* ===== RED VARIANT BUTTON ===== */
/* For delete/danger actions */
.btn-red,
.btn-danger {
    background: var(--cimcor-magenta);
    color: white;
}

.btn-red:hover,
.btn-danger:hover {
    background: #990042;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(177, 0, 76, 0.4);
}

/* ===== LAYOUT UTILITIES ===== */
/* Common page layout patterns */
.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--cimcor-dark-blue);
    font-family: var(--font-heading);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--cimcor-gray);
    margin-bottom: 32px;
}

/* ===== BUTTON SIZE OVERRIDES ===== */
/* Fix: Buttons were too tall and disproportionate to text */
.btn {
    padding: 8px 16px !important;  /* Reduced from 14px 28px */
    font-size: 13px !important;    /* Reduced from 15px */
}

.btn-sm {
    padding: 6px 12px !important;  /* Even smaller for btn-sm */
    font-size: 12px !important;
}

.btn-lg {
    padding: 12px 24px !important;
    font-size: 16px !important;
}

/* ===== SECTION SWITCHER (for admin navigation) ===== */
.section-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 20px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.section-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.section-tab i {
    font-size: 16px;
}

.section-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.section-tab.active {
    background: var(--cimcor-primary-blue);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive section switcher */
@media (max-width: 768px) {
    .section-switcher {
        margin: 10px 0;
        width: 100%;
    }
    
    .section-tab {
        flex: 1;
        justify-content: center;
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* ===== PARTNER NAVIGATION DROPDOWN STYLES ===== */
/* Horizontal navigation with dropdown functionality for partner portal */

.partner-nav {
    background: var(--cimcor-gradient-primary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    padding: 0 20px;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.nav-logo {
    height: 32px;
    width: auto;
}

.nav-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    padding: 0 20px;
}

.nav-user {
    padding: 0 20px;
}

/* Navigation dropdown containers */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    padding: 20px 16px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    white-space: nowrap;
}

.nav-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu items */
.nav-dropdown-items {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    z-index: 9999;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.nav-dropdown-items.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.nav-child-item {
    display: block;
    padding: 12px 20px;
    color: var(--cimcor-dark-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

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

.nav-child-item:hover {
    background: var(--cimcor-light-blue);
    color: var(--cimcor-dark-blue);
}

.nav-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Simple navigation items (non-dropdown) - scoped to navbar only */
.navbar .nav-item {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    padding: 20px 16px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    white-space: nowrap;
}

.navbar .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* User menu styles */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    z-index: 9999;
    display: none;
}

.user-menu-item {
    display: block;
    padding: 12px 20px;
    color: var(--cimcor-dark-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

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

.user-menu-item:hover {
    background: var(--cimcor-light-blue);
    color: var(--cimcor-dark-blue);
}

/* Section navigation (for admin/marketing vertical dropdowns) */
.nav-section {
    position: relative;
    display: inline-block;
}

.nav-section-toggle {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    padding: 20px 16px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    white-space: nowrap;
}

.nav-section-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-section-items {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    z-index: 9999;
    display: none;
}

/* Impersonation banner */
.impersonation-banner {
    background: var(--cimcor-magenta);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    z-index: 1030; /* Above navbar */
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.impersonation-banner button {
    margin-left: 12px;
    padding: 6px 16px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
}

/* Responsive navigation */
@media (max-width: 768px) {
    .partner-nav {
        flex-direction: column;
        min-height: auto;
    }
    
    .nav-main {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        padding: 10px;
        gap: 10px;
    }
    
    .nav-dropdown-toggle,
    .navbar .nav-item {
        padding: 12px;
        font-size: 14px;
    }
    
    .nav-dropdown-items {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.95);
        margin-top: 10px;
        border-radius: 8px;
    }
}

/* ========================================
   MDF (Marketing Development Funds) STYLES
   ======================================== */

/* MDF Budget Cards */
.budget-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.budget-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.budget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cimcor-gradient-primary);
}

.budget-label {
    font-size: 12px;
    color: var(--cimcor-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.budget-amount {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 4px;
}

.budget-subtitle {
    font-size: 12px;
    color: var(--cimcor-gray);
}

/* MDF Forms and Cards */
.form-card {
    background: white;
    border-radius: 0 0 12px 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.requests-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* MDF Request Items */
.request-item {
    padding: 24px;
    border-bottom: 1px solid var(--cimcor-light-blue);
    transition: background 0.3s;
}

.request-item:hover {
    background: #F8F9FA;
}

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

.request-header {
    display: flex;
    justify-content-between;
    align-items-center;
    margin-bottom: 12px;
}

.request-id {
    font-size: 14px;
    color: var(--cimcor-gray);
    font-weight: 600;
}

/* MDF Status Badges */
.request-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: rgba(32, 155, 204, 0.2);
    color: var(--cimcor-blue-accent);
}

.status-approved {
    background: rgba(120, 200, 170, 0.2);
    color: var(--cimcor-green);
}

.status-rejected {
    background: rgba(177, 0, 76, 0.2);
    color: var(--cimcor-magenta);
}

.status-denied {
    background: rgba(177, 0, 76, 0.2);
    color: var(--cimcor-magenta);
}

.status-completed {
    background: rgba(6, 85, 163, 0.2);
    color: var(--cimcor-primary-blue);
}

/* MDF Request Details */
.request-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cimcor-dark-blue);
    margin-bottom: 8px;
    font-family: var(--font-heading);
}

.request-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.meta-item {
    font-size: 14px;
    color: var(--cimcor-gray);
}

.meta-label {
    font-weight: 600;
    color: var(--cimcor-gray-dark);
}

/* MDF Guidelines */
.guidelines-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.guidelines-section {
    margin-bottom: 32px;
}

.guidelines-section h3 {
    font-size: 20px;
    color: var(--cimcor-dark-blue);
    margin-bottom: 16px;
    font-family: var(--font-heading);
}

.guidelines-list {
    list-style: none;
    padding: 0;
}

.guidelines-list li {
    padding: 12px 0;
    padding-left: 32px;
    position: relative;
    line-height: 1.6;
    color: var(--cimcor-gray-dark);
}

.guidelines-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--cimcor-green);
    font-weight: 700;
    font-size: 18px;
}

/* MDF Activity Types */
.activity-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.activity-type {
    padding: 20px;
    border: 2px solid var(--cimcor-light-blue);
    border-radius: 12px;
    transition: all 0.3s;
    cursor: pointer;
}

.activity-type:hover {
    border-color: var(--cimcor-primary-blue);
    background: rgba(6, 85, 163, 0.05);
}

.activity-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.activity-name {
    font-weight: 700;
    color: var(--cimcor-dark-blue);
    margin-bottom: 4px;
}

.activity-desc {
    font-size: 13px;
    color: var(--cimcor-gray);
}

/* MDF Responsive */
@media (max-width: 768px) {
    .request-meta {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   PARTNER SCORECARD STYLES
   ======================================== */

/* Tier Badge */
.tier-badge {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: 700;
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    font-family: var(--font-heading);
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.achievement {
    text-align: center;
    padding: 24px;
    border: 2px solid var(--cimcor-light-blue);
    border-radius: 12px;
    transition: all 0.3s;
}

.achievement.unlocked {
    background: var(--cimcor-gradient-primary);
    border-color: var(--cimcor-primary-blue);
    color: white;
}

.achievement.locked {
    opacity: 0.4;
    background: #F8F9FA;
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.achievement-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    font-family: var(--font-heading);
}

.achievement-desc {
    font-size: 12px;
    opacity: 0.9;
}

/* Tier Progress */
.tier-progress {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tier-track {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    position: relative;
}

.tier-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--cimcor-light-blue);
    z-index: 0;
}

.tier-milestone {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--cimcor-light-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    position: relative;
    transition: all 0.3s;
}

.tier-milestone.active {
    background: var(--cimcor-gradient-primary);
    border-color: var(--cimcor-primary-blue);
    color: white;
    transform: scale(1.1);
}

.tier-milestone.completed {
    background: var(--cimcor-green);
    border-color: var(--cimcor-green);
    color: white;
}

.tier-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

.tier-icon {
    font-size: 24px;
}

/* Leaderboard */
.leaderboard {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #F8F9FA;
    border-radius: 8px;
    transition: background 0.3s;
}

.leaderboard-item:hover {
    background: var(--cimcor-light-blue);
}

.leaderboard-item.current-user {
    background: var(--cimcor-gradient-primary);
    color: white;
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-heading);
    min-width: 40px;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.leaderboard-score {
    font-size: 14px;
    opacity: 0.8;
}

/* Scorecard Responsive */
@media (max-width: 768px) {
    .tier-track {
        flex-direction: column;
        gap: 20px;
    }

    .tier-track::before {
        display: none;
    }
}

/* ========================================
   DEAL REGISTRATION FORM STYLES
   ======================================== */

.deal-form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3e6f0;
}

.form-section {
    border-left: 4px solid var(--cimcor-primary-blue);
    padding-left: 1rem;
    margin-left: -1rem;
    background: #f8f9fc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.form-section h3 {
    color: var(--cimcor-primary-blue);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ========================================
   SUPPORT TICKETS STYLES
   ======================================== */

.ticket-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.ticket-row:hover {
    background-color: #f8f9fa;
}

.comment-thread {
    max-height: 400px;
    overflow-y: auto;
}

.comment-item {
    border-left: 3px solid #007bff;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.comment-item.staff-comment {
    border-left-color: #28a745;
}

/* ========================================
   MODAL Z-INDEX FIXES
   ======================================== */

.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

/* ========================================
   CAROUSEL STYLES
   ======================================== */

.carousel-preview {
    height: 200px;
    object-fit: cover;
    background: #0655A3;
}

/* ========================================
   CERTIFICATION SYSTEM IMPROVEMENTS
   ======================================== */

/* Tab navigation hover improvements */
.nav-tabs .nav-link:hover {
    background-color: var(--cimcor-light-blue) !important;
    color: var(--cimcor-dark-blue) !important;
    border-color: var(--cimcor-medium-blue) !important;
}

/* Course selection buttons with borders */
.course-selection-btn {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    background-color: #fff !important;
    margin-bottom: 0.5rem !important;
}

.course-selection-btn:hover {
    border-color: var(--cimcor-primary-blue) !important;
    background-color: var(--cimcor-gray-light) !important;
    color: var(--cimcor-primary-blue) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Button text overlap prevention */
.btn [x-show] {
    display: inline-block;
}

.btn [x-show="saving"] {
    display: none;
}

.btn[disabled] [x-show="saving"] {
    display: inline-block;
}

.btn[disabled] [x-show="!saving"] {
    display: none;
}

/* Improved table hover colors */
.table-hover tbody tr:hover {
    background-color: var(--cimcor-gray-light) !important;
    color: var(--cimcor-dark-blue) !important;
}

/* Link hover improvements for better visibility */
.nav-tabs .nav-link,
.certification-nav .nav-link {
    color: var(--cimcor-dark-blue) !important;
    font-weight: 500;
}

.nav-tabs .nav-link:hover,
.certification-nav .nav-link:hover {
    background-color: var(--cimcor-light-blue) !important;
    color: var(--cimcor-dark-blue) !important;
    text-decoration: none !important;
}

.nav-tabs .nav-link.active {
    background-color: var(--cimcor-primary-blue) !important;
    color: var(--cimcor-white) !important;
    border-color: var(--cimcor-primary-blue) !important;
}

/* ========================================================================
   PETER PARTNER AI ASSISTANT STYLES
   ======================================================================== */

/* Backdrop overlay - click to close sidebar */
.peter-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1055;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.peter-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Floating action button - bottom right corner */
.peter-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cimcor-primary-blue), var(--cimcor-gradient-blue));
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.peter-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, var(--cimcor-gradient-blue), var(--cimcor-primary-blue));
}

.peter-trigger:active {
    transform: scale(0.95);
}

/* Sidebar container */
.peter-sidebar {
    position: fixed;
    top: 0;
    right: -450px; /* Hidden by default */
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.peter-sidebar.open {
    right: 0;
}

/* Header */
.peter-header {
    background: linear-gradient(135deg, var(--cimcor-primary-blue), var(--cimcor-gradient-blue));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.peter-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.peter-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.peter-header .btn-close:hover {
    opacity: 1;
}

/* Messages container */
.peter-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual message */
.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
}

.message.assistant,
.message.error {
    align-self: flex-start;
}

/* Message bubble */
.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.message.user .message-bubble {
    background: var(--cimcor-primary-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    border: 1px solid #e9ecef;
}

.message.error .message-bubble {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
    border-bottom-left-radius: 4px;
}

/* Message timestamp */
.message-timestamp {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 4px;
}

.message.user .message-timestamp {
    text-align: right;
}

/* Suggested queries */
.message-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-btn {
    background: white;
    border: 1px solid var(--cimcor-primary-blue);
    color: var(--cimcor-primary-blue);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.suggestion-btn:hover {
    background: var(--cimcor-primary-blue);
    color: white;
}

/* Visualizations */
.visualization-container {
    margin-top: 12px;
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.visualization-container canvas {
    max-height: 300px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input container */
.peter-input {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

.peter-input input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.peter-input input:focus {
    outline: none;
    border-color: var(--cimcor-primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.peter-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cimcor-primary-blue);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.peter-input button:hover:not(:disabled) {
    background: var(--cimcor-gradient-blue);
    transform: scale(1.05);
}

.peter-input button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Voice input button (microphone) */
.peter-mic-btn {
    background: transparent !important;
    color: var(--cimcor-primary-blue) !important;
    width: 40px;
    height: 40px;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.peter-mic-btn:hover:not(:disabled) {
    background: rgba(6, 85, 163, 0.1) !important;
    color: var(--cimcor-dark-blue) !important;
    border-color: var(--cimcor-primary-blue);
    transform: scale(1.05);
}

.peter-mic-btn.recording {
    color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.1) !important;
    border-color: #dc3545;
    animation: pulse 1.5s infinite;
}

.peter-mic-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    background: transparent !important;
}

/* Voice output button (speaker) */
.peter-speaker-btn {
    background: transparent !important;
    color: #6c757d !important;
    width: 40px;
    height: 40px;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.peter-speaker-btn:hover {
    background: rgba(6, 85, 163, 0.1) !important;
    color: var(--cimcor-primary-blue) !important;
    border-color: var(--cimcor-primary-blue);
    transform: scale(1.05);
}

.peter-speaker-btn.active {
    color: var(--cimcor-primary-blue) !important;
    background: rgba(6, 85, 163, 0.1) !important;
    border-color: var(--cimcor-primary-blue);
}

.peter-speaker-btn.speaking {
    color: var(--cimcor-primary-blue) !important;
    background: rgba(6, 85, 163, 0.15) !important;
    border-color: var(--cimcor-primary-blue);
    animation: soundWave 1s infinite;
}

/* Pulse animation for recording */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Sound wave animation for speaking */
@keyframes soundWave {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Speak message button (inline with messages) */
.speak-message-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 14px;
    padding: 4px 8px;
    cursor: pointer;
    margin: 4px 0;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.speak-message-btn:hover {
    background: rgba(6, 85, 163, 0.1);
    color: var(--cimcor-primary-blue);
}

.speak-message-btn i {
    font-size: 16px;
}

/* Scrollbar styling for messages */
.peter-messages::-webkit-scrollbar {
    width: 8px;
}

.peter-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.peter-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.peter-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Keyboard shortcut hint */
.peter-shortcut-hint {
    position: absolute;
    bottom: -30px;
    right: 0;
    font-size: 0.75rem;
    color: #6c757d;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.peter-trigger:hover .peter-shortcut-hint {
    opacity: 1;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .peter-sidebar {
        width: 100%;
        right: -100%;
    }

    .peter-trigger {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .message {
        max-width: 90%;
    }
}

/* Clear conversation button */
.peter-clear-btn {
    background: none;
    border: none;
    color: white;
    opacity: 0.8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.peter-clear-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* ===== COMPACT TABLE STYLES ===== */
/* Smaller badges for table cells */
.badge-sm {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Compact table action buttons */
.btn-group-sm .btn {
    white-space: nowrap;
}

/* Slightly reduce table cell padding for more space */
.table > :not(caption) > * > * {
    padding: 0.4rem 0.5rem;  /* Bootstrap default is 0.5rem 0.5rem */
}

/* Ensure button groups wrap on small screens */
.btn-group {
    flex-wrap: wrap;
    gap: 2px;
}

/* MDF Status Badges - Override to ensure visibility */
.badge.bg-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.badge.bg-success {
    background-color: #198754 !important;
    color: #ffffff !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000000 !important;
}
