/* Custom */

:root {
    --primary: #EE2A7B;
    --primary-hover: #D0246E;
    --primary-active: #C01E63;

    /* Standard control sizing (text-sm = 0.875rem across tables, fields, buttons) */
    --erp-control-height: 2.5rem;
    --erp-control-padding-x: 0.75rem;
    --erp-control-font-size: 0.875rem;
    --erp-control-line-height: 1.25rem;
    --erp-control-icon-size: 1.125rem;
    --erp-control-radius: 0.375rem;
    --erp-control-border-color: #d1d5db;
}

/*
 * ERP typography: tables, form fields, labels, and buttons use text-sm.
 * Normalizes Tailwind text-xs / text-base on data-entry surfaces.
 */
main label,
.popup label,
.form-label,
label.form-label {
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height);
}

main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
main select,
main textarea,
.popup input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.popup select,
.popup textarea {
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height);
}

main div.table .table-cell,
.popup div.table .table-cell,
main table th,
main table td,
.popup table th,
.popup table td,
.overflow-x-scroll .table .table-cell {
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height) !important;
}

main button,
.popup button,
main a.erp-btn,
main a.crm-primary-btn,
main a.crm-secondary-btn,
.pagination select,
.pagination button {
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height) !important;
}

main .text-xs,
.popup .text-xs {
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height) !important;
}

/* Livewire datatable column sort chevrons (fallback if package classes remain) */
.overflow-x-scroll .table .table-cell span.inline.text-blue-400,
.overflow-x-scroll .table .table-cell span.inline.text-blue-400 svg,
div.table .table-cell span.inline.text-xs.text-blue-400 svg {
    color: #111827 !important;
}

/* Boolean / success check icons stay green in datatable cells */
.overflow-x-scroll .table .table-cell svg.text-green-600,
div.table .table-cell svg.text-green-600 {
    color: #16a34a !important;
}

a {
color: #3465f4;
}
a:hover {
color: #000000;
}

a.crm-primary-btn,
button.crm-primary-btn,
a.crm-primary-btn:hover,
a.crm-primary-btn:focus,
button.crm-primary-btn:hover,
button.crm-primary-btn:focus {
    color: #fff !important;
    text-decoration: none;
}

a.crm-primary-btn,
button.crm-primary-btn {
    background-color: var(--primary) !important;
}

/* Shared sizing: page header, reports, forms, toolbar, CRM buttons */
.crm-primary-btn,
.crm-secondary-btn,
.erp-btn,
button.crm-primary-btn,
a.crm-primary-btn,
button.crm-secondary-btn,
a.crm-secondary-btn,
.datatable-toolbar-btn,
header.bg-white.shadow button:not(.row-action-btn):not(.action-button),
header.bg-white.shadow a.inline-flex[class*="btn"],
.timesheet-grid-filters .crm-primary-btn,
.timesheet-grid-filters .timesheet-grid-btn-secondary,
.timesheet-grid-filters .erp-btn,
#report-period-filter-grid .crm-primary-btn,
#report-period-filter-grid button,
.popup button.w-32,
.popup .mt-10.flex.justify-center button,
.popup .erp-sales-modal-footer button,
.qq-form-actions button,
.qq-form-actions a.qq-cancel-btn,
.qq-item-modal-actions button,
button.module-form-cancel-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.375rem;
    min-height: var(--erp-control-height) !important;
    padding: 0 var(--erp-control-padding-x) !important;
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height) !important;
    border-radius: var(--erp-control-radius) !important;
    box-sizing: border-box;
    text-transform: uppercase;
}

/* Form footer width (legacy w-32) */
.erp-form-btn,
button.w-32,
.popup button.w-32 {
    min-width: 8rem;
}

.erp-btn--muted,
button.w-32.bg-gray-600,
.popup button.bg-gray-600:not(.bg-red-600) {
    background-color: #4b5563 !important;
    border: 1px solid transparent !important;
    color: #fff !important;
}

.erp-btn--muted:hover,
button.w-32.bg-gray-600:hover,
.popup button.bg-gray-600:hover:not(.bg-red-600) {
    background-color: #374151 !important;
    color: #fff !important;
}

.erp-btn--danger-solid,
button.w-32.bg-red-600,
.popup button.bg-red-600 {
    background-color: #dc2626 !important;
    border: 1px solid transparent !important;
    color: #fff !important;
}

.erp-btn--danger-solid:hover,
button.w-32.bg-red-600:hover,
.popup button.bg-red-600:hover {
    background-color: #b91c1c !important;
    color: #fff !important;
}

.crm-secondary-btn,
a.crm-secondary-btn,
button.crm-secondary-btn,
.erp-btn--secondary,
.datatable-toolbar-btn:not(.erp-btn--danger) {
    border: 1px solid var(--erp-control-border-color) !important;
    background-color: #fff !important;
    color: #1f2937 !important;
}

.erp-btn--primary,
button.erp-btn--primary {
    background-color: var(--primary) !important;
    border: 1px solid transparent !important;
    color: #fff !important;
}

.erp-btn--primary:hover,
button.erp-btn--primary:hover {
    background-color: var(--primary-hover) !important;
    color: #fff !important;
}

.erp-btn--danger,
button.erp-btn--danger {
    border: 1px solid #f87171 !important;
    background-color: #fff !important;
    color: #dc2626 !important;
}

.erp-btn--danger:hover,
button.erp-btn--danger:hover {
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
}

.datatable-toolbar-btn {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Icons inside standard controls */
.row-action-btn svg,
.action-button svg,
.crm-primary-btn svg,
.crm-secondary-btn svg,
.erp-btn svg,
.datatable-toolbar-btn svg,
header.bg-white.shadow button svg,
header.bg-white.shadow a.inline-flex svg,
.timesheet-grid-filters button svg,
#report-period-filter-grid button svg,
.popup button.w-32 svg,
.popup button svg:not([class*="h-6"]):not([class*="h-9"]),
.search .erp-control-icon svg {
    width: var(--erp-control-icon-size) !important;
    height: var(--erp-control-icon-size) !important;
    flex-shrink: 0;
}

header.bg-white.shadow button svg.m-2,
.timesheet-grid-filters button svg.m-2,
#report-period-filter-grid button svg {
    margin: 0 !important;
}

/* Standard text inputs/selects (datatable + Livewire forms) */
input.erp-field,
select.erp-field,
textarea.erp-field,
input.block.p-2.w-full.rounded-lg.border.border-gray-300,
select.block.p-2.w-full.rounded-lg.border.border-gray-300,
.datatables input[type="text"],
.datatables select {
    min-height: var(--erp-control-height);
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height);
    border-radius: var(--erp-control-radius);
    box-sizing: border-box;
}

input.block.p-2.w-full.rounded-lg.border.border-gray-300,
select.block.p-2.w-full.rounded-lg.border.border-gray-300,
input.erp-field:not([type="checkbox"]):not([type="radio"]),
select.erp-field {
    padding: 0 var(--erp-control-padding-x) !important;
}

textarea.erp-field,
textarea.block.p-2.w-full.rounded-lg.border.border-gray-300 {
    min-height: auto;
    padding: var(--erp-control-padding-x) !important;
}

.search input.rounded-md.border-gray-300 {
    min-height: var(--erp-control-height);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height);
}

a.crm-primary-btn:hover,
a.crm-primary-btn:focus,
button.crm-primary-btn:hover,
button.crm-primary-btn:focus {
    background-color: var(--primary-hover) !important;
}

a.crm-secondary-btn:hover,
a.crm-secondary-btn:focus {
    color: #1f2937 !important;
    text-decoration: none;
}

.app-loading-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.crm-datatable-spinner {
    color: var(--primary) !important;
}

.border-primary-active {
    border-color: var(--primary) !important;
}


.popup .lg\:px-8 {
padding-left: 0;
padding-right: 0;
}
.popup .py-12 {
padding-bottom: 0;
padding-top: 0;
}
.popup h3 {
margin-bottom: 20px;
}
.popup .p-6 {
padding: 15px;
}
.popup .mt-10 {
margin-top: 20px;
}
.popup .mt-3 {
margin-top: 0;
}

.search .py-3 {
padding-bottom: 10px;
padding-top: 10px;
}

.pagination .px-4, .pagination .px-2 {
padding-left: 12px;
padding-right: 12px;
}
.pagination .py-2 {
padding-bottom: 9px;
padding-top: 9px;
}
.pagination .py-2.form-select {
padding-bottom: 8px;
padding-top: 8px;
}
.pagination .divide-gray-300 {
padding-left: 4px;
}
.pagination .-mx-1 {
margin-right: 0;
}
.pagination.rounded {
border-radius: 5px;
}

.pagination.border-blue-500 {
border: 0;
}

.bg-orange-400.text-gray-500 {
color: #fff;
}

header button.mb-2 {
margin-bottom: 0;
}

.select2-container .select2-selection--single {
height: var(--erp-control-height) !important;
min-height: var(--erp-control-height) !important;
padding: 0 var(--erp-control-padding-x) !important;
font-size: var(--erp-control-font-size) !important;
display: flex !important;
align-items: center !important;
}

/* table input, .select2.select2-container {
min-width: 150px;
} */

.menu-dropdown {
position: absolute;
right: 0;
top: 10px;
}

/* Datatable row action icon buttons (square, same height as fields) */
.row-action-btn,
a.row-action-btn,
button.row-action-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: var(--erp-control-height);
height: var(--erp-control-height);
min-width: var(--erp-control-height);
min-height: var(--erp-control-height);
padding: 0;
border: none;
border-radius: var(--erp-control-radius);
box-sizing: border-box;
flex-shrink: 0;
cursor: pointer;
transition: background-color 0.15s ease, color 0.15s ease;
}
.row-action-btn--view {
color: #111827;
}
.row-action-btn--view:hover {
background-color: #111827;
color: #fff;
}
.row-action-btn--edit {
color: #2563eb;
}
.row-action-btn--edit:hover {
background-color: #2563eb !important;
color: #fff !important;
}
.row-action-btn--delete {
color: #dc2626;
}
.row-action-btn--delete:hover {
background-color: #dc2626 !important;
color: #fff !important;
}
.row-action-btn--duplicate {
color: #4b5563;
}
.row-action-btn--duplicate:hover {
background-color: #4b5563 !important;
color: #fff !important;
}
.row-action-btn--approve {
color: #16a34a;
}
.row-action-btn--approve:hover {
background-color: #16a34a !important;
color: #fff !important;
}
.row-action-btn--reject {
color: #dc2626;
}
.row-action-btn--reject:hover {
background-color: #dc2626 !important;
color: #fff !important;
}

/* Timesheet grid — 4-4-2-2 filter row on desktop (not reliant on Tailwind col-span build) */
.timesheet-grid-filters {
display: grid;
gap: 0.5rem; /* gap-2 — same as order date-range filter */
align-items: end;
margin-bottom: 1rem;
grid-template-columns: 1fr;
}
@media (min-width: 768px) {
.timesheet-grid-filters {
grid-template-columns: 4fr 4fr 2fr 2fr;
}
}

/* Report / filter grid — Clear & secondary actions */
.timesheet-grid-btn-secondary,
#report-period-filter-grid .erp-btn--secondary {
    border: 1px solid var(--erp-control-border-color) !important;
    background-color: #d1d5db !important;
    color: #374151 !important;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.timesheet-grid-btn-secondary:hover,
.timesheet-grid-btn-secondary:focus,
#report-period-filter-grid .erp-btn--secondary:hover {
    background-color: #9ca3af !important;
    color: #1f2937 !important;
}

/* Scroll mode icon (datatable) — force 8px vertical margin */
#scrollModeIcon svg {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Datatable toolbar — uses shared .datatable-toolbar-btn rules above */

.qq-edit-add-status-btn-icon {
    margin-top: 10px;
    margin-bottom: 10px;
}

.qq-edit-preview-pdf-btn-icon {
    margin-top: 2px;
    margin-bottom: 2px;
}

/* Pikaday popup — selected/hover styling aligned with IoT native date picker */
.pika-single {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.pika-single .pika-button {
    border-radius: 0.25rem;
    background: transparent;
    color: #111827;
    box-shadow: none;
}

.pika-single .pika-button:hover,
.pika-single .pika-button:focus {
    background-color: #eff6ff !important;
    color: #2563eb !important;
    box-shadow: inset 0 0 0 1px #2563eb !important;
}

.pika-single td.is-selected .pika-button,
.pika-single td.is-selected .pika-button:hover {
    background-color: #2563eb !important;
    color: #fff !important;
    box-shadow: none !important;
}

.pika-single td.is-today:not(.is-selected) .pika-button {
    color: #2563eb;
    font-weight: 600;
}

.action-button,
button.action-button {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
width: var(--erp-control-height) !important;
height: var(--erp-control-height) !important;
min-height: var(--erp-control-height) !important;
padding: 0 !important;
border: none;
border-radius: var(--erp-control-radius);
box-sizing: border-box;
color: #111827;
font-size: var(--erp-control-font-size) !important;
line-height: var(--erp-control-line-height) !important;
text-transform: uppercase;
cursor: pointer;
transition: background-color 0.15s ease, color 0.15s ease;
}
.action-button:hover {
background-color: #111827;
color: #fff;
}
.action-button-dropdown {
min-width: 200px;
margin-left: -200px;
}
.action-button span {
padding: 0;
}

@media only screen and (max-width: 767px) {
header button.mb-2 {
    margin-bottom: 0.5rem;
}
}
@media (min-width: 640px) {
.popup .sm\:max-w-lg:not(.erp-sales-modal-panel):not(.erp-module-modal-panel):not(.erp-compact-modal-panel) {
    max-width: 1024px;
}
.popup .erp-sales-modal-panel {
    width: 90vw;
    max-width: 90vw;
}
}

/* Module form Submit/Cancel — sizing via rules above; keep uppercase */
.qq-form-actions button,
.qq-form-actions a.qq-cancel-btn,
.qq-item-modal-actions button,
.popup .mt-10.flex.justify-center button.w-32,
button.module-form-cancel-btn {
    text-transform: uppercase;
}

/* In-page filter cards (dashboard, reports) */
.page-section-gap .erp-btn,
.page-section-gap button.erp-btn--secondary {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Accounts → Reports (Livewire report screens) */
section .mt-6.flex.justify-center button.bg-blue-600,
section .mt-6.flex.justify-center button.w-36,
section .mt-6.flex.justify-center button.w-44 {
    min-height: var(--erp-control-height) !important;
    padding: 0 var(--erp-control-padding-x) !important;
    font-size: var(--erp-control-font-size) !important;
    line-height: var(--erp-control-line-height) !important;
    border-radius: var(--erp-control-radius) !important;
}

/* Primary action buttons — brand color #EE2A7B */
.bg-blue-500,
.bg-blue-600,
.bg-pink-600 {
    background-color: var(--primary) !important;
}

.hover\:bg-blue-600:hover,
.hover\:bg-blue-700:hover,
.hover\:bg-pink-700:hover {
    background-color: var(--primary-hover) !important;
}

.hover\:bg-blue-800:hover {
    background-color: var(--primary-active) !important;
}

.active\:bg-blue-700:active {
    background-color: var(--primary-hover) !important;
}

.focus\:border-blue-700:focus {
    border-color: var(--primary) !important;
}

/* Top nav menu underline — brand #EE2A7B */
nav .nav-top-items {
    gap: 10px;
    overflow: visible;
}

nav.bg-white,
nav.bg-white > div,
nav .nav-top-items,
nav .nav-menu-dropdown {
    overflow: visible;
}

nav .nav-submenu-w-150 {
    width: 150px;
    min-width: 150px;
}

nav .nav-submenu-w-200 {
    width: 200px;
    min-width: 200px;
}

nav .nav-profile-menu-group {
    gap: 10px;
}

nav .nav-mobile-header-actions {
    gap: 10px;
}

nav .nav-mobile-header-actions .nav-menu-dropdown {
    height: auto;
}

nav .nav-mobile-header-actions button.nav-menu-link {
    padding: 0.5rem;
    height: auto;
}

nav .nav-mobile-header-actions button.nav-menu-link span.absolute {
    top: 0.375rem;
    right: 0.375rem;
}

nav .nav-profile-menu-dropdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
}

nav .nav-profile-menu-dropdown .block {
    margin: 0;
}

.page-section-gap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Dashboard — consistent 16px gaps (matches Tailwind gap-4 / page-section-gap) */
.dashboard-tat-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.dashboard-cp-hn-grid {
    gap: 16px;
}

/* Warning alerts — amber Tailwind utilities are not in compiled app.css */
.erp-alert-warning {
    color: #92400e;
    background-color: #fef3c7;
}

/* AI Insights — neutral generation metadata note under report title */
.erp-generation-info {
    display: inline-flex;
    margin-top: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.25rem;
    font-weight: 500;
    border-radius: 0.25rem;
    color: #374151;
    background-color: #f3f4f6;
}

/* ERP modals — quotation Add size: 90vw × 90vh, scrollable alerts/body, pinned footer */
.erp-sales-modal-panel,
.erp-module-modal-panel,
.erp-compact-modal-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 90vw;
    height: 90vh;
    max-height: 90vh;
}

.erp-sales-modal-panel > form.erp-sales-modal-form,
.erp-sales-modal-panel > .erp-modal-layout,
.erp-module-modal-panel > form.erp-sales-modal-form,
.erp-module-modal-panel > .erp-modal-layout,
.erp-compact-modal-panel > form.erp-sales-modal-form,
.erp-compact-modal-panel > .erp-modal-layout {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.erp-sales-modal-header {
    flex: 0 0 auto;
}

.erp-sales-modal-alerts {
    max-height: 8rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.erp-sales-modal-body {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Form content fills the modal body (matches Add Quotation width) */
.erp-sales-modal-form {
    align-items: stretch;
}

.erp-sales-modal-header,
.erp-sales-modal-footer {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
}

.erp-modal-form-grid {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .erp-modal-form-grid.erp-modal-form-grid--2col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .erp-modal-form-grid.erp-modal-form-grid--4col {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .erp-modal-form-grid.erp-modal-form-grid--4col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.erp-sales-modal-body [data-qo-item-root],
.erp-sales-modal-body .erp-modal-subform {
    width: 100%;
    max-width: 100%;
}

.erp-sales-modal-footer {
    flex: 0 0 auto;
    flex-shrink: 0;
    min-height: 3.75rem;
    margin-top: 0;
    padding-top: 1rem;
    padding-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    background-color: #f3f4f6;
}

.erp-status-log-form-fields {
    flex: 0 0 auto;
}

.erp-status-log-history {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.erp-status-log-grid {
    min-width: 36rem;
}

.delivery-service-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .delivery-service-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.token-usage-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .token-usage-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .token-usage-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Dashboard KPI data boxes — left border by category */
.dashboard-kpi-box {
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
}

.dashboard-kpi-box--sales {
    border-left-color: #16a34a;
}

.dashboard-kpi-box--alert {
    border-left-color: #dc2626;
}

.dashboard-kpi-box--neutral {
    border-left-color: #9ca3af;
}

/* Sales pipeline step pills — aligned with CRM status badge styling */
.sales-pipeline-step {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    border: 1px solid transparent;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}
.sales-pipeline-step--done {
    background-color: #87eeab;
    color: #000;
    border-color: #86efac;
}
.sales-pipeline-step--current {
    background-color: #87ceeb;
    color: #000;
    border-color: #7dd3fc;
}
.sales-pipeline-step--blocked {
    background-color: #fecaca;
    color: #7f1d1d;
    border-color: #f87171;
}
.sales-pipeline-step--pending {
    background-color: #fff;
    color: #6b7280;
    border-color: #d1d5db;
}
a.sales-pipeline-step:hover {
    opacity: 0.9;
}

nav .nav-submenu-panel {
    top: 100%;
    margin-top: 0;
    padding-top: 0.5rem;
}

nav .nav-submenu-panel.left-0 {
    left: 0;
    right: auto;
}

nav .nav-submenu-panel.right-0 {
    left: auto;
    right: 0;
}

nav .nav-submenu-panel-inner {
    width: 100%;
}

nav .nav-menu-dropdown {
    display: flex;
    align-items: stretch;
    position: relative;
}

.notification-bell-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-bell-badge {
    position: absolute;
    top: 50%;
    right: -0.125rem;
    z-index: 10;
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background-color: #ef4444;
    box-shadow: 0 0 0 2px #fff;
    transform: translateY(-50%);
}

.notification-bell-dismiss {
    flex-shrink: 0;
}

.notification-bell-dismiss svg {
    display: block;
    width: 1rem;
    height: 1rem;
}

nav .nav-menu-link {
    border-bottom-width: 2px;
    border-bottom-color: transparent;
    box-sizing: border-box;
}

.section-tab-nav .nav-menu-link {
    display: inline-flex;
    align-items: center;
    padding-bottom: 0.75rem;
    padding-top: 0.75rem;
    margin-right: 10px;
}

.section-tab-nav .nav-menu-link:last-child {
    margin-right: 0;
}

.crm-row-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 0.25rem;
}

.crm-row-actions > .flex {
    display: inline-flex;
    flex-wrap: nowrap;
}

nav button.nav-menu-link {
    background: transparent;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    cursor: pointer;
}

nav .nav-menu-link:hover,
nav .nav-menu-link:focus {
    border-bottom-color: var(--primary) !important;
    color: var(--primary) !important;
}

nav .nav-menu-link--active,
nav .nav-menu-link--active:hover,
nav .nav-menu-link--active:focus {
    border-bottom-color: var(--primary) !important;
    color: var(--primary) !important;
}

nav a.nav-menu-link.nav-menu-link--active[class*="border-l"] {
    border-left-color: var(--primary) !important;
    color: var(--primary) !important;
    background-color: rgb(238 42 123 / 0.08);
}

nav a.nav-menu-link[class*="border-l"]:hover,
nav a.nav-menu-link[class*="border-l"]:focus {
    border-left-color: var(--primary) !important;
    color: var(--primary) !important;
    background-color: rgb(238 42 123 / 0.05);
}

/* Gemini ERP Assistant (floating chat) */
.gemini-assistant-root {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    left: auto;
    z-index: 9990;
}

.gemini-assistant-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    background: #fff;
    border: none;
    padding: 0.625rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gemini-assistant-fab-icon {
    width: 100%;
    height: 100%;
}

.gemini-assistant-fab:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 10px 28px rgb(238 42 123 / 0.35), 0 0 0 1px rgb(238 42 123 / 0.15);
}

.gemini-assistant-fab--open {
    transform: none;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    opacity: 0.92;
}

.gemini-assistant-panel {
    position: absolute;
    right: 0;
    left: auto;
    bottom: 5rem;
    width: 24rem;
    max-width: calc(100vw - 2rem);
    height: 32rem;
    max-height: calc(100vh - 7rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2), 0 0 0 1px rgb(238 42 123 / 0.08);
    overflow: hidden;
}

.gemini-panel-enter,
.gemini-panel-leave {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gemini-panel-enter-start,
.gemini-panel-leave-end {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
}

.gemini-panel-enter-end,
.gemini-panel-leave-start {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gemini-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(120deg, var(--primary) 0%, var(--primary-hover) 55%, var(--primary-active) 100%);
}

.gemini-assistant-header-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.gemini-assistant-header-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #fff;
    padding: 0.25rem;
}

.gemini-assistant-header-icon svg,
.gemini-assistant-header-icon img,
.gemini-assistant-header-logo {
    width: 1.25rem;
    height: 1.25rem;
}

.gemini-logo-mark {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 50%, var(--primary-active) 100%);
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
}

.gemini-assistant-subtitle {
    font-size: 0.6875rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.82);
}

.gemini-assistant-icon-btn {
    padding: 0.375rem;
    color: #6b7280;
    border-radius: 0.375rem;
    border: none;
    background: transparent;
    cursor: pointer;
}

.gemini-assistant-icon-btn--light {
    color: rgba(255, 255, 255, 0.85);
}

.gemini-assistant-icon-btn:hover {
    color: #111827;
    background: #f3f4f6;
}

.gemini-assistant-icon-btn--light:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.gemini-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.gemini-msg-user {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 0.375rem;
}

.gemini-msg-assistant {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 0.375rem;
    align-self: flex-start;
    width: 100%;
}

.gemini-msg-assistant--typing {
    flex-shrink: 0;
}

.gemini-msg-avatar {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gemini-msg-avatar--assistant {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 0.125rem;
}

.gemini-msg-avatar--assistant img,
.gemini-msg-avatar--assistant .gemini-logo-mark {
    width: 0.875rem;
    height: 0.875rem;
}

.gemini-msg-bubble {
    max-width: 85%;
    padding: 0.625rem 0.75rem;
    border-radius: 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.gemini-msg-user .gemini-msg-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
    box-shadow: 0 2px 8px rgb(238 42 123 / 0.25);
}

.gemini-msg-assistant .gemini-msg-bubble {
    background: #fff;
    color: #1f2937;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.gemini-msg-bubble--typing {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
}

.gemini-typing-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background: var(--primary);
    animation: gemini-typing-bounce 1.2s infinite ease-in-out;
}

.gemini-typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.gemini-typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes gemini-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.gemini-msg-time {
    margin-top: 0.375rem;
    font-size: 0.625rem;
    opacity: 0.7;
}

.gemini-assistant-error {
    margin: 0 0.875rem 0.5rem;
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
}

.gemini-assistant-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.gemini-assistant-input {
    flex: 1;
    resize: none;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    background: #f9fafb;
}

.gemini-assistant-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgb(238 42 123 / 0.15);
}

.gemini-assistant-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    align-self: flex-end;
    border: none;
    border-radius: 0.625rem;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgb(238 42 123 / 0.35);
}

.gemini-assistant-send:hover:not(:disabled) {
    background: var(--primary-hover);
}

.gemini-assistant-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.iot-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (min-width: 1024px) {
    .iot-dashboard-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .iot-dashboard-grid > .iot-dashboard-widget {
        grid-column: span var(--iot-grid-span, 6) / span var(--iot-grid-span, 6);
    }
}

.iot-switcher-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: inline-block;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
    background-color: #9ca3af;
    box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.08);
}

.iot-switcher-circle--on {
    background-color: #16a34a;
    border-color: #15803d;
    box-shadow: 0 0 0 3px rgb(22 163 74 / 0.15);
}

.iot-switcher-circle--off {
    background-color: #dc2626;
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgb(220 38 38 / 0.12);
}

.iot-switcher-circle--unknown {
    background-color: #9ca3af;
    border-color: #6b7280;
}

.iot-switcher-circle--interactive {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.iot-switcher-circle--interactive:hover {
    transform: scale(1.05);
}

.iot-switcher-circle--interactive:disabled {
    opacity: 0.6;
    cursor: wait;
}