/* ============================================================
   ORIENT ECOSYSTEMS — Brand Color System
   ============================================================
   Deep Crimson  : #6f231d
   Vivid Red     : #ac1b1c
   Forest Green  : #4d8f2d
   Sage Green    : #99c188
   Background    : #ffffff / #fafafa
   ============================================================ */

:root {
    --crimson: #6f231d;
    --red: #ac1b1c;
    --red-light: #f9eaea;
    --red-mid: #f0c8c8;
    --forest: #4d8f2d;
    --sage: #99c188;
    --sage-light: #edf6e8;
    --white: #ffffff;
    --surface: #fafafa;
    --border: #ecdcdc;
    --border-subtle: #f3eded;
    --text-primary: #1a0f0f;
    --text-secondary: #5c3d3d;
    --text-muted: #9e7f7f;
    --shadow-sm: 0 1px 3px rgba(111, 35, 29, 0.08);
    --shadow-md: 0 4px 12px rgba(111, 35, 29, 0.12);
    --shadow-lg: 0 10px 25px rgba(111, 35, 29, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--surface);
    color: var(--text-primary);
}

/* NAVBAR */
.navbar-nav {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--red);
}

/* SIDEBAR */
.main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow: visible;
    /* Allow arrow to peek out */
}

.sidebar {
    width: 210px;
    height: 100vh;
    background: #ffffff;
    border-right: 2px solid var(--red-mid);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* COLLAPSED */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .menu-title,
.sidebar.collapsed span,
.sidebar.collapsed .profile-info {
    opacity: 0;
    visibility: hidden;
    width: 0;
    pointer-events: none;
}

.sidebar.collapsed {
    overflow: visible;
}

.sidebar.collapsed .menu {
    overflow: visible;
}


/* LOGO */
.logo {
    display: flex;
    align-items: center;
    padding: 12px 12px;
    /* As requested */
    height: 70px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    /* Allow extension feel */
}

.sidebar.collapsed .logo {
    padding: 12px 0;
    justify-content: center;
}

.logo-img {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
}

.logo-small {
    width: 40px;
    height: 40px;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    left: 15px;
    /* Centered in 70px collapsed state */
}

.logo-full {
    width: 130px;
    height: auto;
    opacity: 1;
    visibility: visible;
    transform-origin: left center;
}

.sidebar.collapsed .logo-small {
    opacity: 1;
    visibility: visible;
}

.sidebar.collapsed .logo-full {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateX(-10px);
}

/* MENU */
.menu {
    flex: 1;
    padding: 0 12px;
    overflow-y: auto;
}

.menu-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 24px 12px 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    margin-bottom: 4px;
    transition: all 0.2s ease;
    position: relative;
    /* For tooltip positioning */
}

.menu-item i {
    font-style: normal;
    font-size: 20px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.menu-item span {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.menu-item:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

.menu-item:hover i {
    color: var(--text-primary);
}

/* ACTIVE STATE - CURVE & COLOR */
.menu-item.active {
    background: linear-gradient(90deg, var(--red-light) 0%, transparent 100%);
    color: var(--crimson);
    border-left: 3px solid var(--red);
    border-radius: 10px;
}

.menu-item.active i {
    background: var(--red-light);
    color: var(--red);
    box-shadow: 0 4px 6px -1px rgba(172, 27, 28, 0.15);
}

.menu-item.active span {
    font-weight: 700;
    color: var(--crimson);
}

.profile {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 16px;
    background: #ffffff;

    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.avatar {
    min-width: 35px;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--red), var(--crimson));
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    transition: opacity 0.3s ease;
}

.profile-info .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-info .email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TOOLTIP (collapsed mode) */
.sidebar.collapsed .menu-item::before {
    content: '';
    position: absolute;
    left: 100%;
    margin-left: 4px;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid var(--crimson);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.sidebar.collapsed .menu-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    margin-left: 10px;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background: var(--crimson);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.sidebar.collapsed .menu-item:hover::before,
.sidebar.collapsed .menu-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}



.main-sidebar {
    width: 210px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-sidebar.collapsed-container {
    width: 70px;
}

/* NAVBAR / HEADER */
.main-header {
    background: #ffffff;
    border-bottom: 2px solid var(--red-mid);
    padding: 0 32px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-left: 210px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 2px 8px rgba(172, 27, 28, 0.06);
}

.sidebar-collapsed .main-header {
    margin-left: 70px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--red) !important;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--red-light);
}

.logout-btn i {
    width: 18px;
    height: 18px;
}


/* CONTENT WRAPPER */
.content-wrapper {
    margin-left: 260px;
    padding: 20px;
    min-height: calc(100vh - 70px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface);
}

.sidebar-collapsed .content-wrapper {
    margin-left: 80px;
}


/* COLLAPSE ARROW TOGGLE */
.collapse-toggle {
    position: absolute;
    right: -10px;
    top: 8%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.collapse-toggle:hover {
    background: linear-gradient(135deg, var(--red), var(--crimson));
    color: #ffffff;
    border-color: var(--red);
    box-shadow: var(--shadow-md);
}

.collapse-toggle i {
    width: 14px;
    height: 14px;
}

/* Ensure icons are visible when collapsed */
.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
}

.sidebar.collapsed .menu-item i {
    margin: 0;
}

/* TABLES */

.table-container {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.table-responsive {
    max-height: calc(100vh - 300px);
    /* Adjust to fit the page */
    overflow-y: auto;
    overflow-x: auto;
}


.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 14px;
    margin: 0 auto;
    /* Center the table if it has a max-width */
}

.data-table th {
    background: linear-gradient(180deg, var(--red-light) 0%, #fff0f0 100%);
    padding: 10px 12px;
    text-align: center;
    font-weight: 700;
    color: var(--crimson);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.06em;
    border: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--red-mid);
}

.data-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    height: auto;
    min-height: 45px;
    vertical-align: middle;
    text-align: center;
    /* Center content horizontally */
}

/* STRIPED EFFECT */
.table-striped tbody tr:nth-of-type(even) {
    background-color: rgba(111, 35, 29, 0.02);
}

.data-table tr td:first-child,
.data-table tr td:nth-child(2) {
    font-weight: 700;
    color: var(--crimson);
}

.data-table tr:hover {
    background: var(--red-light) !important;
    /* Override striped background on hover */
    transition: background 0.15s ease;
}

/* Specific column adjustments for compactness */
.data-table th:first-child,
.data-table td:first-child {
    width: 50px;
    text-align: center;
}

.data-table th:last-child,
.data-table td:last-child {
    text-align: center;
}

.data-table td {
    white-space: nowrap;
}

.data-table td.wrap {
    white-space: normal;
}



/* STATUS INDICATORS */
.status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

/* .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
} */

.status-dot.active {
    color: var(--forest);
    filter: drop-shadow(0 0 3px rgba(77, 143, 45, 0.4));
}

.status-dot.inactive {
    color: var(--red);
    filter: drop-shadow(0 0 3px rgba(172, 27, 28, 0.4));
}

/* ACTIONS */
.action-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.action-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /* border: 1px solid var(--border); */
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--red-light);
    color: var(--red);
}

.action-btn.edit:hover {
    color: var(--red);
}

.action-btn.delete:hover {
    color: var(--crimson);
}

.action-btn i {
    width: 10px;
    height: 10px;
}

/* FORMS */
.card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    transition: all 0.2s ease;
    background: var(--surface);
}

.form-control:focus {
    outline: none;
    border-color: var(--red);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(172, 27, 28, 0.12);
    transition: all 0.2s ease;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red), var(--crimson));
    color: #ffffff;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--crimson), #5a1a16);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: #ffffff;
    border-top: 1px solid var(--border-subtle);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: auto;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.page-btn:hover:not(.disabled) {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-light);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--red), var(--crimson));
    color: #ffffff;
    border-color: var(--crimson);
    box-shadow: var(--shadow-sm);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--surface);
    pointer-events: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    /* border-top: 1px solid var(--border); */
    display: flex;
    justify-content: center;
    gap: 12px;
    /* background: var(--surface); */
}

.modal-footer .btn {
    width: 100%;
    justify-content: center;
}

.bu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bu-item:hover {
    background: var(--border-subtle);
}

.bu-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bu-item label {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.bu-item.selected {
    border-color: var(--red);
    background: var(--red-light);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

.bu-mapping-btn {
    padding: 6px 12px;
    background: var(--sage-light);
    color: var(--forest);
    border: 1px solid var(--sage);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    margin: 0 auto;
}

.bu-mapping-btn:hover {
    background: var(--forest);
    color: #ffffff;
    border-color: var(--forest);
    box-shadow: var(--shadow-sm);
}

/* QUOTATION STYLES */
.quotation-container {
    padding: 25px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
}

.form-section {
    padding: 24px 40px;

}

.section-title {
    margin-bottom: 25px;
    font-weight: 600;
    text-transform: uppercase;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.input-group label {
    justify-content: space-between;
    /* For the flex label with icon */
}

.input-group .form-control {
    width: 100%;

    /* Prevent it from getting too wide in centered layout */
}

.quotation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border: 1px solid var(--border);
}

.quotation-table th {
    background: var(--border-subtle) !important;
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
    border: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.quotation-table td {
    padding: 12px;
    border: 1px solid var(--border);
    vertical-align: top;
}

.item-desc-cell {
    min-width: 250px;
}

.item-note {
    width: 100%;
    margin-top: 8px;
    font-size: 0.8rem;
    padding: 6px;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    resize: vertical;
}

.view-mode .item-note {
    display: none !important;
}

.edit-mode .note-display {
    display: none !important;
}

.totals-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    width: 300px;
    float: right;
    margin-top: 24px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.total-row.final {
    border-top: 2px solid var(--border);
    padding-top: 12px;
    font-weight: 700;
    color: var(--forest);
    font-size: 1.1rem;
}

.terms-section {
    margin-top: 24px;
    display: flex;
    gap: 24px;
    clear: both;
}

.terms-box {
    flex: 1;
}

.action-btns-row {
    display: flex;
    gap: 8px;
}

.edit-mode .read-only {
    display: none;
}

.view-mode .edit-only {
    display: none;
}

/* Autocomplete basic styles */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
}

.autocomplete-item:hover {
    background: var(--surface);
    color: var(--red);
}

/* Select2 Custom Styling */
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    min-height: 42px;
}

/* SAAS STEP INDICATOR */
.steps-container {
    display: flex;
    justify-content: space-between;
    position: sticky;
    top: 70px;
    /* Offset for main header height */
    background: #ffffff;
    z-index: 900;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 80px;
    right: 80px;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step-item {
    position: relative;
    z-index: 1;
    text-align: center;
    cursor: pointer;
    flex: 1;
}

.step-icon {
    width: 42px;
    height: 42px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s;
    margin-top: -15px;
}

.step-item.active .step-icon {
    background: linear-gradient(135deg, var(--red), var(--crimson));
    border-color: var(--crimson);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(172, 27, 28, 0.12);
}

.step-item.completed .step-icon {
    background: linear-gradient(135deg, var(--forest), #3d7022);
    border-color: var(--forest);
    color: #fff;
    box-shadow: 0 4px 8px rgba(77, 143, 45, 0.2);
}

.step-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.step-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.step-item.active .step-title {
    color: var(--crimson);
}

/* INFO BOX */
.info-banner {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;


    align-items: center;
}

.info-banner i {
    color: var(--red);
}

.info-banner p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--crimson);
    line-height: 1.5;
}

/* MULTI-STEP VISIBILITY */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* BUTTONS */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--surface);
    border-color: #cbd5e1;
}

.step-actions {
    display: flex;
    justify-content: space-between;

    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.project-link:hover {
    text-decoration: underline !important;
    opacity: 0.8;
}

/* SIDE PANEL MODAL */
.modal-overlay.side-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: flex-end;
    align-items: flex-start;
}

.side-panel {
    width: 650px;
    max-width: 95%;
    height: 100vh;
    background: #ffffff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-overlay.active .side-panel {
    transform: translateX(0);
}

.side-panel-header {
    padding: 20px 28px;
    border-bottom: 2px solid var(--red-mid);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--red-light), #fff);
}

.panel-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--red-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
    border: 1px solid var(--red-mid);
}

.panel-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.panel-close-btn:hover {
    background: var(--red-light);
    color: var(--red);
}

.modal-header-premium {
    background: linear-gradient(135deg, var(--red-light), #fff);
    padding: 18px 22px;
    border-bottom: 2px solid var(--red-mid);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-premium .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header-premium .header-title {
    margin: 0;
    font-size: 1rem;
    color: var(--crimson);
    font-weight: 700;
}

.modal-header-premium .header-subtitle {
    margin: 3px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.side-panel-footer {
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.side-panel-footer .btn {
    width: 100%;
    justify-content: center;
}

/* PRODUCT CHIP & MODAL */
.product-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sage-light);
    color: var(--forest);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--sage);
    transition: all 0.2s ease;
}

.product-count-chip:hover {
    background: var(--forest);
    color: #ffffff;
    border-color: var(--forest);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);

}

.product-count-chip i {
    width: 13px;
    height: 13px;
}

.product-list-item {
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-subtle);
}

.product-list-item i {
    color: var(--red);
    width: 16px;
    height: 16px;
}

/* GLOBAL SEARCH NAV */
.search-container {
    display: flex;
    align-items: center;
    position: relative;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: #f3eded;
    padding: 8px 12px;
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 40px;
    height: 40px;
    overflow: visible;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.search-wrapper.expanded {
    width: 280px;
    background: #ffffff;
    border-color: var(--red-mid);
    box-shadow: 0 4px 12px rgba(172, 27, 28, 0.08);
    overflow: visible;
}

.search-wrapper.expanded .global-search-input {
    width: 220px;
    margin-left: 10px;
    padding-right: 10px;
}

.search-wrapper.focused {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(172, 27, 28, 0.12);
}

.search-icon-nav {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.global-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    width: 0;
    padding: 0;
    margin-left: 0;
    transition: all 0.4s ease;
    font-weight: 500;
}

/* Dropdown */
.global-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(111, 35, 29, 0.12);
    z-index: 3000;
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
}

.global-search-dropdown.visible {
    display: block;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

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

.search-result-item:hover {
    background: var(--red-light);
    color: var(--crimson);
}

.search-result-item .result-icon {
    width: 28px;
    height: 28px;
    background: var(--red-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
    flex-shrink: 0;
}

.search-result-item .result-label {
    font-weight: 600;
}

.search-result-item .result-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.search-no-results {
    padding: 16px 14px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Group labels */
.search-group-label {
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-content {
    flex: 1;
    min-width: 0;
}

/* Icons per type */
.result-icon-lead {
    background: var(--red-light);
    color: var(--red);
}

.result-icon-quote {
    background: var(--sage-light);
    color: var(--forest);
}

/* Status badges */
.result-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.result-badge-lead {
    background: var(--red-light);
    color: var(--crimson);
    border: 1px solid var(--red-mid);
}

.result-badge-quote {
    background: var(--sage-light);
    color: var(--forest);
    border: 1px solid var(--sage);
}

/* See all */
.search-see-all {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--red);
    cursor: pointer;
    text-align: right;
    background: var(--red-light);
    border-top: 1px solid var(--border-subtle);
    transition: background 0.15s;
}

.search-see-all:hover {
    background: var(--red-mid);
}

/* Spinner */
.search-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--red-mid);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Print Overrides */
@media print {
    .pdf-print-footer {
        display: block;
        position: fixed;
        bottom: 0;
        width: 100%;
        text-align: center;
        font-size: 10px;
        color: #64748b;
        padding: 10px;
        border-top: 1px solid #e2e8f0;
    }

    .no-print,
    .login-footer {
        display: none !important;
    }

    .pdf-page {
        page-break-after: always;
        display: block !important;
    }
}

/* ============================================================
   AUTH PAGES (Login, Forgot Password, Reset)
   ============================================================ */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f8fafc;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    margin: 0;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(135deg, var(--red), var(--crimson));
    border-radius: 24px 24px 0 0;
}

.logo-box {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--red), var(--crimson));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #fff;
    font-size: 2rem;
}

.brand-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.brand-text span {
    color: var(--crimson);
}

.portal-subtitle {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 40px;
    font-weight: 600;
}

.auth-body .welcome-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    text-align: left;
}

.auth-body .welcome-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 32px;
    text-align: left;
}

.auth-body .form-group {
    text-align: left;
    margin-bottom: 24px;
}

.auth-body .form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.auth-body .input-container {
    position: relative;
}

.auth-body .input-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
}

.auth-body .input-container input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    color: #1e293b;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.auth-body .input-container input::placeholder {
    color: #94a3b8;
}

.auth-body .input-container input:focus {
    background: #ffffff;
    border-color: var(--red);
    box-shadow: 0 0 0 4px var(--red-light);
    outline: none;
}

.auth-body .password-toggle {
    position: absolute;
    right: 16px !important;
    left: auto !important;
    cursor: pointer;
    z-index: 10;
}

.auth-body .btn-primary {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.auth-body .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.auth-body .remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    cursor: pointer;
}

.auth-body .remember-me input {
    width: 18px;
    height: 18px;
    accent-color: var(--crimson);
}

.auth-body .forgot-link {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.auth-body .forgot-link:hover {
    opacity: 1;
}

.auth-body .login-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
    color: #94a3b8;
    font-size: 0.8rem;
}

.auth-body .error-alert,
.auth-body .success-alert {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-body .error-alert {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.auth-body .success-alert {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid #bbf7d0;
    color: #15803d;
}

/* Helper for debug otp banner */
.auth-body .debug-otp-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: left;
}

/* ============================================================
   QUOTATION PDF GENERATION STYLES
   ============================================================ */

@page {
    size: A4;
    margin: 0;
}

.pdf-body {
    font-family: 'Times New Roman', Times, serif;
    margin: 0;
    padding: 0;
    color: #1e293b;
    line-height: 1.3;
    background: #f1f5f9;
}

.pdf-page {
    width: 210mm;
    min-height: 297mm;
    padding: 15mm;
    margin: 10mm auto;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
    display: block;
    /* Changed from flex to block for better page breaks */
    font-size: 13px;
    page-break-after: always;
}

/* Fixed footer for printing on every page */
.pdf-print-footer {
    display: none;
}

@media print {
    .pdf-body {
        background: white;
    }

    .pdf-page {
        margin: 0;
        box-shadow: none;
        width: 100%;
        min-height: auto;
        padding: 15mm;
        padding-bottom: 40mm;
        box-sizing: border-box;
        background: transparent;
    }

    .pdf-footer {
        display: none;
        /* Hide individual page footers in print */
    }

    .pdf-print-footer {
        display: block;
        position: fixed;
        bottom: 0;
        left: 15mm;
        right: 15mm;
        width: auto;
        text-align: center;
        font-size: 13px;
        color: #475569;
        padding: 10mm 0 15mm 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        box-sizing: border-box;
        z-index: 1000;
    }
}

/* Table Hack for multi-page footer protection */
.pdf-print-container {
    width: 100%;
    border-collapse: collapse;
}

.pdf-print-footer-spacer {
    height: 35mm;
    /* Buffer to prevent overlap */
}

.pdf-print-header-spacer {
    height: 15mm;
}



@media print {
    .pdf-body {
        background: white;
        margin: 0;
    }

    .pdf-page {
        margin: 0;
        box-shadow: none;
        page-break-after: always;
    }

    .no-print {
        display: none;
    }
}

.pdf-header {
    text-align: left;
}

.pdf-logo {
    width: 280px;
    height: 150px;
    margin-left: -23px;
}

.pdf-footer {
    position: absolute;
    bottom: 15mm;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.pdf-footer-content {
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    margin: 0 15mm;
}

.pdf-tagline {
    margin-top: 20px;
    margin-bottom: 15px;
}

.pdf-tagline h1 {
    margin: 0;
    font-size: 20px;
    color: #b91c1c;
    font-weight: 700;
}

.pdf-tagline h1 span {
    color: #1e293b;
}

.pdf-tagline p {
    margin: 0;
    font-size: 16px;
    color: #b91c1c;
    font-weight: 600;
}

.pdf-divider {
    border-top: 2px solid #1e293b;
    margin: 15px 0 25px 0;
}

.pdf-info-grid {
    display: grid;
    grid-template-columns: 140px 10px 1fr;
    gap: 6px 0;
    margin-bottom: 45px;
    font-size: 13px;
}

.pdf-info-label {
    font-weight: 600;
}

.pdf-info-val {
    font-weight: 500;
}

.pdf-subject {
    margin-bottom: 10px;
    font-size: 14px;
}

.pdf-subject-label {
    font-weight: 700;
}

.pdf-subject-val {
    font-weight: 700;
    color: #6d28d9;
}

.pdf-salutation {
    margin-bottom: 10px;
    font-weight: 500;
}

.pdf-intro-text {
    margin-bottom: 20px;
    font-size: 13px;
}

.pdf-annexure-list {
    margin-bottom: 30px;
    font-size: 13px;
}

.pdf-annexure-list h4 {
    margin-bottom: 6px;
    text-decoration: underline;
}

.pdf-annexure-list ul {
    list-style: disc;
    margin-left: 40px;
}

.pdf-annexure-title {
    font-size: 18px;
    font-weight: 700;
    text-decoration: underline;
    margin-bottom: 15px;
}

.pdf-category-header {
    background: #f8fafc;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    margin-top: 15px;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;

    font-size: 12px;
    page-break-inside: auto;
}

.pdf-table thead {
    display: table-header-group;
}

.pdf-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
}

.pdf-table th,
.pdf-table td {
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    text-align: left;
}

.pdf-table th {
    background: #f1f5f9;
    font-weight: 700;
}

.pdf-subtotal-row td {
    font-weight: 700;
    background: #f8fafc;
    text-align: right;
}

.pdf-grand-total-box {
    margin-top: 20px;
    padding: 12px;
    border: 2px solid #1e293b;
    text-align: right;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    background: #f8fafc;
    page-break-inside: avoid;
}


.pdf-tc-list {
    list-style: decimal;
    margin-left: 20px;
    font-size: 13px;
}

.pdf-tc-item {
    display: grid;
    grid-template-columns: 165px 15px 1fr;
    margin-bottom: 5px;
}

.pdf-notes-section {
    margin-top: 20px;
    font-size: 12px;
}

.pdf-notes-section h4 {
    margin-bottom: 6px;
}

.pdf-closing-area {
    margin-top: 35px;
    font-size: 13px;
}

.pdf-company-profile {
    font-size: 12px;
    text-align: justify;
    line-height: 1.3;
}

.pdf-ecosystem-img {
    display: block;
    width: 100%;
    margin-top: 30px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
}

.login-footer a {
    color: var(--text-2);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.login-footer a:hover {
    color: #801919 !important;
}