/* SIMAPP standardized stylesheet (Bootstrap 5.3.3, jQuery 3.7.1, Font Awesome 6.4.0,
   DataTables 2.1.8, Chart.js 4.4.7, Quill 2.0.3) */

/* Theme tokens (ported from PepApp) */

:root {
    --pep-primary:      #667eea;
    --pep-primary-2:    #764ba2;
    --pep-primary-dark: #5a67d8;
    --pep-success:      #48bb78;
    --pep-warn:         #ed8936;
    --pep-danger:       #f56565;
    --pep-info:         #38b2ac;
}

/* Global layout & base styles */

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 94px; /* two-row navbar: 50px brand row + 44px menu row */
    padding-bottom: 40px;
}

/* Top navbar */

.top-navbar {
    background: linear-gradient(135deg, var(--pep-primary) 0%, var(--pep-primary-2) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Row 1: brand (left) + user menu (right) */
.top-navbar .navbar-main {
    height: 50px;
    padding: 0.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Row 2: centered navigation menu */
.top-navbar .navbar-menu {
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    overflow-x: auto; /* scroll instead of clip if items overflow on small screens */
}

.top-navbar .navbar-menu .nav-link {
    color: #ecf0f1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 8px;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.top-navbar .navbar-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.top-navbar .navbar-menu .nav-link.active,
.top-navbar .navbar-menu .nav-link[aria-current="page"] {
    background: rgba(255, 255, 255, 0.22);
    color: white;
    font-weight: 600;
}

.top-navbar .navbar-menu .nav-link i {
    font-size: 0.95rem;
}

.top-navbar .brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.top-navbar .brand .logo-image {
    max-height: 40px;
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

.top-navbar .user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar navigation */

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--pep-primary) 0%, var(--pep-primary-2) 100%);
    color: white;
    position: fixed;
    top: 50px;
    bottom: 40px;
    left: 0;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1020;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar .nav-section {
    padding: 0.5rem 0;
}

.sidebar .nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #95a5a6;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar .nav-link {
    color: #ecf0f1;
    padding: 0.4rem 1.25rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.sidebar .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: white;
    border-left-color: var(--pep-primary);
    padding-left: 1.5rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.sidebar .nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left: 3px solid var(--pep-primary);
    font-weight: 500;
}

.sidebar .nav-link i,
.sidebar .nav-link svg {
    width: 20px;
    margin-right: 10px !important;
    font-size: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: block;
}

.sidebar.sidebar-collapsed {
    left: -250px;
}

.sidebar.sidebar-collapsed ~ .main-content {
    margin-left: 0;
}

/* Collapsible Navigation Menus */
.nav-collapse-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.nav-collapse-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: white;
}

.nav-collapse-toggle .collapse-icon {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

.nav-collapse-toggle[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

/* Nested Navigation Links */
.sidebar .nav-link-sub {
    padding-left: 2.5rem;
    font-size: 0.875rem;
    border-left: none;
}

.sidebar .nav-link-sub:hover {
    padding-left: 2.75rem;
}

.sidebar .nav-link-sub i {
    font-size: 0.85rem;
    width: 18px;
}

/* Collapse container styling */
.sidebar .collapse {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar .collapse .nav-link-sub {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar .collapse .nav-link-sub:last-child {
    border-bottom: none;
}

/* Main content area */

.content-wrapper {
    display: flex;
    flex: 1;
}

.main-content {
    flex: 1;
    padding: 1.75rem;
    background: #f5f6fa;
    min-height: calc(100vh - 134px); /* viewport minus 94px navbar and 40px footer */
    overflow-x: hidden;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 2000;
}

.loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.loading-overlay-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

body.loading-overlay-active {
    overflow: hidden;
}

/* Footer */

.footer {
    background: linear-gradient(135deg, var(--pep-primary) 0%, var(--pep-primary-2) 100%);
    color: white;
    padding: 0.65rem 1.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 1025;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

/* Form controls */

.form-control:focus,
.form-select:focus {
    border-color: var(--pep-primary);
    box-shadow: 0 0 0 0.2rem rgba(27, 110, 194, 0.25);
}

.form-control-lg {
    transition: all 0.3s ease;
}

.form-control-lg:focus {
    transform: translateY(-2px);
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--pep-primary-2);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Hide empty validation summary */
.validation-summary-valid {
    display: none;
}

/* Buttons */

.btn {
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--pep-primary) 0%, var(--pep-primary-2) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--pep-primary-dark) 0%, var(--pep-primary-2) 100%);
}

/* Align Bootstrap utility colors with the PepApp palette (modal headers, spinners, etc.) */
.bg-primary {
    background-color: var(--pep-primary) !important;
}

.text-primary {
    color: var(--pep-primary) !important;
}

.btn-success {
    background: var(--pep-success);
    border: none;
}

.btn-success:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-warning {
    background: #f39c12;
    border: none;
}

.btn-danger {
    background: #e74c3c;
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-info {
    background: #16a085;
    border: none;
}

.btn-secondary {
    background: #95a5a6;
    border: none;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Cards */

.card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: white;
    border-bottom: 2px solid #f0f0f0;
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Dropdown menus */

.dropdown-toggle::after {
    margin-left: 0.5em;
}

.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

/* Tables */

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #495057;
    padding: 0.85rem;
}

.table tbody td {
    padding: 0.85rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    overflow-x: auto;
}

.table-actions button {
    margin-right: 5px;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

/* DataTables customization */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_filter input {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem;
    margin-left: 0.5rem;
}

/* Badges */

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.badge-primary {
    background: #cfe2ff;
    color: #084298;
}

/* Shadow utilities */

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Dashboard components */

/* Dashboard collapse */
.metrics-collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
    opacity: 1;
}

.metrics-collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0 !important;
}

#dashboardCollapseBtn {
    transition: all 0.2s ease;
}

#dashboardCollapseBtn:hover {
    transform: scale(1.05);
}

.dashboard-section {
    position: relative;
    transition: all 0.4s ease-in-out;
    flex: 0 0 auto;
    min-height: 60px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dashboard-section.collapsed-dashboard {
    flex: 0 0 60px;
    min-height: 60px;
    padding: 0.75rem 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    height: 100%;
}

.dashboard-row-2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

/* Metric Cards */
.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.metric-card.blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.metric-card.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.metric-card.orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.metric-card.purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.metric-card.red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.metric-card.teal {
    background: linear-gradient(135deg, #16a085 0%, #1abc9c 100%);
}

.metric-card.pink {
    background: linear-gradient(135deg, #c471ed 0%, #f64f59 100%);
}

.metric-card.indigo {
    background: linear-gradient(135deg, #5f72bd 0%, #9b23ea 100%);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 500;
}

/* Stat Cards (Alternative style) */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.stat-card.assets {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card.services {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card.tasks-pending {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card.tasks-progress {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card h3 {
    margin: 0;
    font-size: 2.5rem;
}

.stat-card p {
    margin: 5px 0 0 0;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Menu Cards */
.menu-card {
    transition: all 0.3s ease;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
}

.menu-card:active {
    transform: translateY(-2px);
}

/* Tab systems */

/* Menu section */
.menu-section {
    flex: 1;
    min-height: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
}

.menu-tabs {
    border-bottom: 2px solid #f0f0f0;
    padding: 0 1.5rem;
    display: flex;
    gap: 0.5rem;
    background: #fafafa;
}

.menu-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.menu-tab:hover {
    color: var(--pep-primary);
    background: rgba(102, 126, 234, 0.05);
}

.menu-tab.active {
    color: var(--pep-primary);
    border-bottom-color: var(--pep-primary);
    background: white;
}

.menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}


/* Nav tabs (Bootstrap override) */
.nav-tabs .nav-link {
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--pep-primary);
    color: var(--pep-primary);
}

.nav-tabs .nav-link.active {
    color: var(--pep-primary);
    border-bottom-color: var(--pep-primary);
    background: transparent;
}

/* Tab panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
    height: 100%;
    min-height: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Module-specific containers */

.crm-container,
.sales-container,
.ecommerce-container,
.hr-container,
.payroll-container,
.utility-container,
.bookkeeping-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: calc(100vh - 130px);
    padding: 0;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Sales / POS interface */

.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.product-search-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    height: 100%;
}

.search-bar {
    display: flex;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--pep-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-chip {
    padding: 0.4rem 0.85rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.category-chip:hover,
.category-chip.active {
    background: var(--pep-primary);
    color: white;
    border-color: var(--pep-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    align-content: start;
}

.product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.product-card:hover {
    border-color: var(--pep-primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-price {
    color: var(--pep-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Cart section */
.cart-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    height: 100%;
}

/* Reduce spacing for form groups within cart section */
.cart-section .form-group {
    margin-bottom: 0.5rem;
}

/* Compact empty state in cart */
.cart-items .empty-state {
    padding: 2rem 1rem;
}

.cart-items .empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.cart-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #ddd;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.cart-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.cart-item-price {
    color: #666;
    font-size: 0.85rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.qty-btn:hover {
    background: var(--pep-primary);
    color: white;
    border-color: var(--pep-primary);
}

.qty-value {
    width: 40px;
    text-align: center;
    font-weight: 600;
}

.cart-remove {
    color: #e74c3c;
    cursor: pointer;
    padding: 0.5rem;
}

.cart-remove:hover {
    color: #c0392b;
}

.cart-totals {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
}

.total-row.grand-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--pep-primary-2);
    border-top: 2px solid #ddd;
    padding-top: 0.75rem;
    margin-top: 0.35rem;
}

.cart-actions {
    display: flex;
    gap: 0.5rem;
}

/* Autocomplete */

.autocomplete-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

/* Modals */

.modal-xl {
    max-width: 1200px;
}

.modal-lg {
    max-width: 900px;
}

.modal .close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: #95a5a6;
    background: none;
    border: none;
    padding: 0.5rem;
    line-height: 1;
}

.modal .close-btn:hover {
    color: #e74c3c;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pep-primary-2);
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-body {
    scrollbar-width: thin;
    scrollbar-color: #95a5a6 #ecf0f1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #ecf0f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}

@media (max-width: 991.98px) {
    .modal-lg {
        max-width: 90%;
    }
}

/* File manager */

.file-list-item {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background 0.2s;
}

.file-list-item:hover {
    background: #f8f9fa;
}

.file-list-item .file-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.file-list-item.folder {
    color: #ffc107;
}

.file-list-item.file {
    color: #6c757d;
}

.breadcrumb-nav {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
}

/* User roles / avatars */

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--pep-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

#usersTable tbody tr {
    transition: background-color 0.2s;
}

#usersTable tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* HR application form */

.application-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 2rem;
}

.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.required-indicator {
    color: #e74c3c;
}

.btn-submit {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

/* Quill editor */

.ql-container {
    min-height: 200px;
    font-size: 1rem;
}

.ql-editor {
    min-height: 200px;
}

/* Stock indicators */

.stock-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.stock-indicator.in-stock {
    background: var(--pep-success);
}

.stock-indicator.low-stock {
    background: #f39c12;
}

.stock-indicator.out-of-stock {
    background: #e74c3c;
}

/* Empty states */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #95a5a6;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Loading spinners */

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--pep-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive design */

@media (max-width: 768px) {
    .sidebar {
        left: -220px;
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .dashboard-grid,
    .dashboard-row-2 {
        grid-template-columns: 1fr;
    }

    .pos-container {
        grid-template-columns: 1fr;
    }
}

/* Partial-specific styles */

/* General ledger partial */
.card-header button[data-bs-toggle="collapse"] {
    color: #333;
    font-weight: 500;
}

.card-header button[data-bs-toggle="collapse"]:hover {
    color: #0056b3;
}

#generalLedgerTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* Journal entries partial */
.group-start {
    border-top: 2px solid #dee2e6;
}

/* Financial Statements */
.financial-statement {
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.statement-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pep-primary-2);
    margin-bottom: 0.5rem;
}

.statement-header h5 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--pep-primary);
    margin-bottom: 0.5rem;
}

.section-title {
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 0;
}

.statement-section table {
    margin-bottom: 0;
}

.statement-section table td {
    padding: 0.5rem;
    border: none;
}

.statement-section table tr.border-top td {
    border-top: 2px solid #dee2e6 !important;
    padding-top: 0.75rem;
}

/* CRM Ticket Modal */
.email-body {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    word-wrap: break-word;
}

.note-content {
    padding: 0.5rem;
    background-color: #f0f8f0;
    border-radius: 4px;
    word-wrap: break-word;
}

/* Subscription system styles */

/* Subscription warning banner (dashboard) */
.subscription-warning-banner {
    margin-bottom: 1.5rem;
    border-left: 4px solid #ffc107;
    animation: fadeInDown 0.5s ease-in-out;
}

.subscription-warning-banner.alert-danger {
    border-left-color: #dc3545;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar subscription footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.subscription-info small {
    font-size: 0.75rem;
    line-height: 1.2;
}

.subscription-info strong {
    font-size: 0.85rem;
}

/* Subscription tab (settings page) */
#subscription .card-header {
    border-bottom: 2px solid #dee2e6;
}

#subscription .border.rounded {
    transition: all 0.2s ease-in-out;
}

#subscription .border.rounded:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Available plans grid */
#availablePlansContainer .plan-card {
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

#availablePlansContainer .plan-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

#availablePlansContainer .plan-card.selected {
    border-color: var(--pep-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* Renewal modal */
#renewalModal .alert-info {
    background-color: #e7f3ff;
    border-color: #b3d9ff;
}

#renewalModal .alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Admin subscription plans table */
#subscriptionPlansTable .badge {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
}

/* Website registration modal */
#registrationModal .alert-success {
    background-color: #d1f2eb;
    border-color: #a8e6cf;
}

#registrationModal .form-control:focus {
    border-color: var(--pep-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Website pricing cards */
.price-tier-card {
    transition: all 0.3s ease-in-out;
}

.price-tier-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.price-tier-card .card.border-success {
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.price-tier-card .card-header {
    font-size: 1.25rem;
    font-weight: 600;
}

.price-tier-card .pricing-options h3 {
    color: var(--pep-primary-2);
    margin-bottom: 0.25rem;
}

.price-tier-card .feature-list {
    list-style: none;
    padding-left: 0;
}

.price-tier-card .feature-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.price-tier-card .feature-list li:last-child {
    border-bottom: none;
}

.price-tier-card .feature-list i {
    margin-right: 0.5rem;
    font-size: 1.1em;
}

/* PayPal secret toggle */
#togglePayPalSecret {
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

#togglePayPalSecret:hover {
    color: var(--pep-primary);
}

/* Status badges */
.badge.bg-trial {
    background-color: #17a2b8 !important;
}

.badge.bg-expired {
    background-color: #6c757d !important;
}

.badge.bg-disabled {
    background-color: #dc3545 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .subscription-info {
        font-size: 0.85rem;
    }

    #availablePlansContainer .col-12 {
        margin-bottom: 1rem;
    }

    .price-tier-card {
        margin-bottom: 1.5rem;
    }
}

/* Toastr overrides — keep notifications above Bootstrap 5 modals */
#toast-container {
    z-index: 1100 !important;
}

/* Relationship diagram */

#diagramModal .modal-dialog {
    max-width: 95%;
}

#diagramModal .modal-body {
    background: #f8f9fa;
    min-height: 500px;
    height: 80vh;
}

#cy {
    min-height: 500px;
}

.diagram-loading,
.diagram-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    margin-right: 1rem;
    font-size: 0.85rem;
    color: #555;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    display: inline-block;
}

.legend-filter {
    cursor: pointer;
    transition: opacity 0.2s ease;
    user-select: none;
}

.legend-filter:hover {
    opacity: 0.8;
}

.legend-filter.legend-dimmed {
    opacity: 0.35;
}

/* Project management stepper */
.stage-stepper {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 1rem;
}

.stage-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.stage-step:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.stage-step--active {
    background-color: rgba(13, 110, 253, 0.06);
    border-left-color: var(--pep-primary);
}

.stage-step--completed {
    border-left-color: #198754;
}

.stage-step--completed .stage-step__icon {
    background-color: #198754;
    color: #fff;
}

.stage-step--in-progress {
    border-left-color: var(--pep-primary);
}

.stage-step--in-progress .stage-step__icon {
    background-color: var(--pep-primary);
    color: #fff;
    animation: pulse-step 2s infinite;
}

.stage-step--skipped {
    border-left-color: #6c757d;
    opacity: 0.55;
}

.stage-step--skipped .stage-step__name {
    text-decoration: line-through;
}

.stage-step__icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background-color: #e9ecef;
    color: #6c757d;
    transition: all 0.2s ease;
}

.stage-step__content {
    flex: 1;
    min-width: 0;
}

.stage-step__name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    display: block;
}

.stage-step__dates {
    font-size: 0.75rem;
    color: #6c757d;
    display: block;
    margin-top: 0.15rem;
}

.stage-step__badge {
    font-size: 0.65rem;
    margin-top: 0.25rem;
}

@keyframes pulse-step {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(13, 110, 253, 0); }
}

/* Stage detail panel */
.stage-panel {
    display: none;
}

.stage-panel.active {
    display: block;
}

/* Document reference rows */
.doc-ref-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.doc-ref-row:last-child {
    border-bottom: none;
}

.doc-ref-name {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.doc-ref-url {
    flex: 2;
    min-width: 0;
}

/* Progress bar for document completion per stage */
.stage-progress {
    height: 6px;
    border-radius: 3px;
    margin-top: 0.25rem;
}

/* Modal form improvements for project management */
.pm-modal .form-label {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Kanban board */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    min-height: 400px;
}

.kanban-column {
    flex: 1;
    min-width: 240px;
    max-width: 320px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.kanban-column__header {
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-column__body {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    max-height: 60vh;
}

.kanban-column__body.drag-over {
    background: rgba(13, 110, 253, 0.05);
}

.kanban-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: grab;
    transition: box-shadow 0.15s, transform 0.15s;
}

.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-card__title {
    font-weight: 600;
    font-size: 0.875rem;
}

.kanban-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Gantt chart overrides */
.gantt-high .bar-progress, .gantt-high .bar { fill: #dc3545 !important; }
.gantt-medium .bar-progress, .gantt-medium .bar { fill: #ffc107 !important; }
.gantt-low .bar-progress, .gantt-low .bar { fill: #198754 !important; }
.gantt-milestone .bar-progress, .gantt-milestone .bar {
    fill: #212529 !important;
    rx: 2;
    ry: 2;
    height: 10px !important;
    y: 5 !important;
}

/* Milestone kanban card */
.kanban-card--milestone {
    border-left: 4px solid #212529;
    background: #f8f9fa;
}

#ganttChart {
    overflow-x: auto;
}

#ganttChart svg {
    min-width: 100%;
}

.badge.bg-purple {
    background-color: #6f42c1 !important;
}

/* Utility classes (replace scattered inline `style="..."` usage) */

/* L9: section heading variant for sidebar nav-section-titles; replaces inline
   font-size/underline formerly on "Main", "IT Request", "Administration" labels. */
.nav-section-title.section-heading {
    font-size: 1rem;
    text-decoration: underline;
    color: #ffffff;
}

/* Print stylesheet — L6: collapse sidebar/nav/footer/gradient chrome so EA Output
   reports print cleanly on A4/Letter with black-on-white text. */

@media print {
    @page {
        margin: 1.5cm;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt;
    }

    .top-navbar,
    .sidebar,
    .footer,
    .sidebar-toggle,
    .user-menu,
    #loading-overlay,
    .modal,
    .modal-backdrop,
    button,
    .btn,
    .no-print {
        display: none !important;
    }

    .wrapper {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .content-wrapper,
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Force-print background colors where the visual is part of the data. */
    .badge,
    .print-keep-bg {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555;
    }

    /* Avoid splitting headings, tables, and figures across pages. */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    table, figure, .card {
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }
    tfoot {
        display: table-footer-group;
    }
}

