/* Dialog */
.p-dialog {
    min-width: 350px;
    border-radius: 0.25rem;
}

.p-dialog .p-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-style: var(--tw-border-style);
    border-bottom-width: 1px;
    border-color: var(--color-border-color);
    padding: calc(var(--spacing) * 4);
}

.p-dialog-header h3,  .p-dialog-header .modal-title {
    font-size: 1.125rem !important;
    --tw-leading: 1.2;
    line-height: 1.2!important;
    --tw-font-weight: var(--font-weight-bold);
    font-weight: var(--font-weight-bold)!important;
    color: var(--color-gray-900)!important;
}

.p-dialog-header .p-dialog-close-button {
    border-radius: 50%;
    height: 30px;
    width: 30px;
}

.p-dialog-header .p-dialog-close-button .p-icon {
    width: 13px;
    height: 13px;
}

.p-dialog-content {
    padding: calc(var(--spacing) * 4);
}

.p-dialog-footer {
    border-top-style: var(--tw-border-style);
    border-top-width: 1px;
    border-color: var(--color-border-color);
    padding: calc(var(--spacing) * 4);
}

.p-dialog-footer .btn {
    min-width: 85px;
}

.p-dialog.p-confirmdialog {
    max-width: 450px;
}

/* ConfirmDialog button overrides — ensure button text is always visible */
.p-confirmdialog .p-dialog-footer .p-button:last-child {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.p-confirmdialog .p-dialog-footer .p-button:last-child:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
}

.p-confirmdialog .p-dialog-footer .p-button:first-child {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
}

.p-confirmdialog .p-dialog-footer .p-button:first-child:hover {
    background-color: #f9fafb !important;
}

/* Password input */
.p-password .p-icon {
    cursor: pointer;
}

/* Calendar */
.p-datepicker-panel table {
    margin-top: 0;
}

.p-datepicker-panel table tr th, .p-datepicker-panel table tr td {
    padding: 2px;
    text-align: center;
    border-bottom: 0;
}

.p-datepicker-panel table tr th .p-datepicker-weekday {
    font-weight: 700;
}

.p-datepicker-day {
    border-radius: 0.25rem;
}

.p-datepicker-day-selected {
    background: #0866ff;
}

/* Datatable */
table tr.border-b:last-child {
    border-bottom: 0!important;
}

/* Paginator */
.p-paginator {
    padding: 0;
}

.p-paginator-page, .p-paginator-next, .p-paginator-last, .p-paginator-first, .p-paginator-prev {
    min-width: 2rem;
    height: 2rem;
}

/* Custom Wizard Component */
.vr-wizard--footer {
    /* width: calc(100% + ((var(--spacing) * 4) * 2)); */
    margin: 0 calc((var(--spacing) * 4) * -1) calc((var(--spacing) * 4) * -1);
    border-top-style: var(--tw-border-style);
    border-top-width: 1px;
    border-color: var(--color-border-color);
    padding: calc(var(--spacing) * 4);
}

/* Toast */
.p-toast {
    --p-toast-width: 20rem;
}

.p-toast-message:last-child {
    margin-bottom: 0;
}

.p-toast-message-icon {
    --p-toast-icon-size: 0.95rem;
}

.p-toast-close-icon {
    --p-toast-close-icon-size: 0.9125rem;
}

.p-toast-message-text {
    --p-toast-text-gap: 0.0525rem;
}

.p-toast-summary {
    --p-toast-summary-font-size: 0.87125rem;
    --p-toast-summary-font-weight: 600;
    line-height: normal;
}

.p-toast-detail {
    --p-toast-detail-font-size: 0.8125rem;
    --p-toast-summary-font-weight: 600;
    line-height: normal;
}

.p-toast-message-success {
    border: 1px solid var(--p-toast-success-border-color);
}

.p-toast-message-info {
    border: 1px solid var(--p-toast-info-border-color);
}

.p-toast-message-warn {
    border: 1px solid var(--p-toast-warn-border-color);
}

.p-toast-message-error {
    border: 1px solid var(--p-toast-error-border-color);
}

.p-toast-message-secondary {
    border: 1px solid var(--p-toast-secondary-border-color);
}

.p-toast-message-contrast {
    border: 1px solid var(--p-toast-contrast-border-color);
}

/* ToggleSwitch (p-switch)
 * --------------------------------------------------------------------------
 * Bug: PrimeVue Aura's `.p-toggleswitch-input { opacity: 0 }` rule isn't
 * winning against the Tailwind v4 preflight reset in this project's CSS-layer
 * setup (see CLAUDE.md gotcha #11). The native browser <input type=checkbox>
 * stays visible at opacity:1 and shows ON TOP of the proper PrimeVue track +
 * handle, producing the "checkbox-in-a-pill" broken appearance.
 *
 * Loaded outside CSS layers via app.blade.php, so `!important` here outranks
 * Aura. Keep the rule TIGHT — only the input visibility needs forcing; track
 * color, handle position, and slide animation are still owned by Aura.
 */
.p-toggleswitch-input {
    opacity: 0 !important;
    /* Make the hidden input fill the whole toggle area so clicks anywhere on
       the track register — Aura wires up its own handler on the input. */
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    cursor: pointer;
}

/* Checked-state styles — Aura's `.p-toggleswitch-checked` rules also lose to
 * Tailwind preflight (same root cause as the input opacity issue above), so
 * the track stayed gray and the handle stayed at left:4px even after the
 * underlying state flipped to true. Force the visual swap here so users get
 * the expected ON/OFF feedback.
 */
.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider {
    background-color: var(--color-primary, #0866ff) !important;
}

.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-handle {
    /* 40px track − 16px handle − 4px right inset = 20px from left */
    left: 20px !important;
}

/* Smooth slide for the handle + smooth color fade for the track */
.p-toggleswitch-slider {
    transition: background-color 0.2s ease !important;
}

.p-toggleswitch-handle {
    transition: left 0.2s ease !important;
}

/* TODO(you, optional): swap the ON color to project-branded green or another
 * accent. Edit the `--color-primary` fallback above (#0866ff) — the var falls
 * back to that hex if your theme doesn't define `--color-primary`. Use the
 * same token used by .bg-primary in the rest of the app for visual coherence.
 */

/* TabView */
.p-tabview .p-tabview-nav {
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    gap: 0;
}

.p-tabview .p-tabview-nav li {
    margin-bottom: -2px;
}

.p-tabview .p-tabview-nav li .p-tabview-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    text-decoration: none;
    cursor: pointer;
}

.p-tabview .p-tabview-nav li .p-tabview-nav-link:hover {
    color: #334155;
    background: #f8fafc;
    border-bottom-color: #cbd5e1;
}

.p-tabview .p-tabview-nav li.p-highlight .p-tabview-nav-link,
.p-tabview .p-tabview-nav li.p-tabview-selected .p-tabview-nav-link {
    color: var(--color-primary, #0866ff);
    border-bottom-color: var(--color-primary, #0866ff);
    font-weight: 600;
    background: transparent;
}

.p-tabview .p-tabview-panels {
    padding: 0;
    background: transparent;
}