/* --- CSS Orchestrator Imports --- */
@import "css/tailwind.generated.css";
/* --- End Orchestrator Imports --- */

html,
body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Global Rounded & VermaSoft Primary Styling (matched to MessagingPlatform) */
:root {
    --rz-border-radius: 6px !important;

    --rz-primary: #f97316 !important;
    --rz-primary-light: #fb923c !important;
    --rz-primary-dark: #ea580c !important;
    --rz-primary-lighter: #fed7aa !important;
    --rz-series-1: #f97316 !important;
}

/* Global Radzen button style: flat buttons without border/shadow */
body .rz-button,
body .rz-splitbutton .rz-button,
body .rz-button:hover,
body .rz-button:focus,
body .rz-button:active,
body .rz-button:focus-visible {
    border: none !important;
    box-shadow: none !important;
}

body .rz-button,
body .rz-card,
body .rz-dropdown,
body .rz-input,
body .rz-textbox,
body .rz-password,
body .rz-numeric,
body .rz-textarea,
body .form-control {
    border-radius: var(--rz-border-radius) !important;
}

/* Toast Notification Positioning - Lower Right */
.rz-notification {
    position: fixed !important;
    bottom: 1rem !important;
    left: unset !important;
    top: unset !important;
    right: 1rem !important;
}

/* --- Embedded WebView (gloCOM / QtWebEngine / CEF) Robust Fallbacks --- */
.bg-gradient-vnavy {
    background-color: #0a4065 !important;
    background: linear-gradient(135deg, #072c47 0%, #0a4065 50%, #1e293b 100%) !important;
    color: #ffffff !important;
}

.bg-gradient-vnavy-r {
    background-color: #0a4065 !important;
    background: linear-gradient(90deg, #0a4065 0%, #072c47 100%) !important;
    color: #ffffff !important;
}

.bg-vnavy {
    background-color: #0a4065 !important;
}

.hover-vnavy-dark:hover {
    background-color: #072c47 !important;
    color: #ffffff !important;
}

.btn-vnavy {
    background-color: #0a4065 !important;
    color: #ffffff !important;
    transition: background-color 0.15s ease-in-out;
}

.btn-vnavy:hover {
    background-color: #072c47 !important;
    color: #ffffff !important;
}

/* Radzen dialog shell aligned with the portal's navy gradient header (same stops as .bg-gradient-vnavy-r). */
.portal-dialog {
    border-radius: var(--radius-app-xl);
}

.portal-dialog .rz-dialog-titlebar {
    background: linear-gradient(90deg, #0a4065 0%, #072c47 100%);
    border-block-end: none;
    padding-block: 1rem;
    padding-inline: 1.5rem;
}

.portal-dialog .rz-dialog-titlebar .rz-dialog-title {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 700;
}

.portal-dialog .rz-dialog-titlebar .rz-dialog-titlebar-close {
    color: #cbd5e1;
}

.portal-dialog .rz-dialog-titlebar .rz-dialog-titlebar-close:hover {
    color: #ffffff;
}

/* A confirmation's primary button performs the destructive action, so it reads red, not brand orange. */
.portal-dialog.rz-dialog-confirm .rz-dialog-confirm-buttons .rz-button.rz-primary {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.portal-dialog.rz-dialog-confirm .rz-dialog-confirm-buttons .rz-button.rz-primary:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

/*
   Editor and viewer dialogs keep one size across contents. Radzen sizes .rz-dialog to its content
   (max-height:100%), so switching tab or adding rows resized the window under the user's cursor. The
   dialog becomes a fixed-height flex column and only the body scrolls: the component renders
   `flex-1 min-h-0 overflow-y-auto` for its body and `shrink-0` for tabs/footer.
*/
.portal-dialog-form {
    height: min(92vh, 860px);
    max-height: min(92vh, 860px);
}

/* The dialog renders its own body/footer, so the Radzen content area must not add padding. */
.portal-dialog-form .rz-dialog-content {
    padding: 0;
    flex: 1 1 auto;
    /* Without min-height:0 a flex child refuses to shrink and pushes the dialog taller. */
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* The body inside the component owns the scrollbar, so this box must not scroll as well. */
    overflow: hidden;
}

.portal-dialog-form .rz-messages-error {
    color: #dc2626;
    font-size: 0.75rem;
    padding: 0.25rem 0 0;
}

/*
   Draft dialogs hold unsaved edits, and Radzen offers no cancelable close hook: the ✕ and ESC would drop
   them without a word. Hiding the ✕ and disabling ESC (see PortalDialogs.EditAsync draftMode) leaves the
   component's own Save/Close buttons as the only exits, both of which can warn before discarding.
*/
.portal-dialog-draft .rz-dialog-titlebar .rz-dialog-titlebar-close {
    display: none;
}

/* DID pool grid (Radzen) : keep the trial grid as compact as the Tailwind tables it replaces. */
.portal-grid {
    --rz-grid-cell-padding: 0.625rem 1rem;
    --rz-grid-cell-font-size: 0.75rem;
    --rz-grid-header-cell-padding: 0.75rem 1rem;
    --rz-grid-header-font-size: 0.6875rem;
    --rz-grid-header-color: #64748b;
}

/* Denser cells for grids whose column count cannot fit the default padding (Law Firms directory). */
.portal-grid.portal-grid-dense {
    --rz-grid-cell-padding: 0.625rem 0.5rem;
    --rz-grid-header-cell-padding: 0.75rem 0.5rem;
}

/* Column widths are content-driven; a fixed layout made the Actions column wider than the card. */
.portal-grid .rz-grid-table {
    table-layout: auto;
    width: 100%;
}

/*
   Radzen pads the column title asymmetrically (16px 0), which pushes every header label 16px right of
   the content below it — a header that does not sit over its own column. Reset it for the whole portal so
   a label starts on the same edge as the cells; a grid that wants a centred label opts in below.
*/
.portal-grid .rz-grid-table thead th .rz-column-title {
    padding-inline: 0;
}

/*
   The Actions header label is centred over the cell while its buttons stay right-aligned (the cell
   template flexes). Radzen's .rz-column-title is a flex child that fills the cell, so justify on the
   header cell does nothing; the content is centred on the title itself.
*/
.portal-grid thead th:is(.did-pool-actions-header, .firms-table-actions-header, .contact-directory-actions-header,
                          .agents-table-actions-header, .portal-users-table-actions-header, .roles-table-actions-header) .rz-column-title {
    justify-content: center;
    padding-inline: 0;
}


/* Radzen clips cell content with an ellipsis; the action buttons must never become "…". */
.portal-grid :is(.did-pool-actions, .firms-table-actions, .contact-directory-actions,
                 .agents-table-actions, .portal-users-table-actions, .roles-table-actions) .rz-cell-data {
    overflow: visible;
    text-overflow: unset;
}

/* Radzen's own header rule is more specific than a single-class selector, hence the full path. */
.portal-grid .rz-grid-table thead th .rz-column-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-grid .rz-pager {
    font-size: 0.75rem;
    --rz-pager-background-color: transparent;
    /* Material rounds the page buttons into pills; the portal's pages are minimalist squares. */
    --rz-pager-button-border-radius: 4px;
    --rz-pager-border: none;
    --rz-pager-padding: 0.5rem 1rem;
    --rz-pager-summary-font-size: 0.75rem;
    --rz-pager-summary-color: #64748b;
    --rz-pager-numeric-button-background-color: transparent;
    --rz-pager-numeric-button-color: #475569;
    --rz-pager-numeric-button-border: none;
    --rz-pager-numeric-button-hover-background-color: #f1f5f9;
    --rz-pager-numeric-button-hover-color: #0f172a;
    --rz-pager-numeric-button-selected-background-color: #e2e8f0;
    --rz-pager-numeric-button-selected-color: #0f172a;
    --rz-pager-numeric-button-selected-border: none;
    --rz-pager-back-button-background-color: transparent;
    --rz-pager-back-button-color: #64748b;
    --rz-pager-next-button-background-color: transparent;
    --rz-pager-next-button-color: #64748b;
}

.portal-grid .rz-pager-element {
    padding: 0.375rem;
}
