/* Import Google Fonts: Outfit (Headings) and Inter (Body) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;700&display=swap');

/* Apply Inter to the main body for readability */
body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Apply Outfit to headings and buttons to match the logo style */
h1, h2, h3, h4, h5, h6,
button, .btn, .nav-link {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-monospace {
    font-family: "Roboto Mono", monospace !important;
    font-optical-sizing: auto;
    font-style: normal;
}

.hover-shadow {
    transition: box-shadow 0.15s ease-in-out;
}

.hover-shadow:hover {
    box-shadow: 0 0 0.375rem rgba(0, 0, 0, 0.1);
}

.overlay-card img {
    filter: brightness(0.7);
    transition: filter 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.overlay-card:hover img {
    filter: brightness(0.9);
    transform: scale(1.04);
}

/* Pulse an urgent purchase-order badge so it stands out in the dashboard list. */
@keyframes urgent-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.urgent-pulse {
    animation: urgent-pulse 1.5s ease-in-out infinite;
}

@keyframes slide-chevron-pulse {
    0%, 100% {
        opacity: 0.35;
    }
    50% {
        opacity: 1;
    }
}

@keyframes slide-check-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Connector line behind the PO workflow step circles. The fill percentage is
   bound inline (Alpine) since it is computed; only the colors live here. */
.workflow-progress-line {
    --workflow-line-color: #2E7D32;
    --workflow-line-track: #dee2e6;
}

.workflow-progress-denied .workflow-progress-line {
    --workflow-line-color: #D32F2F;
}

/* Hide native number-input spinners on fields that ship their own +/- stepper. */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinner {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Barcode tag chips on the purchase-order receiving tab. A dedicated style so
   the resting and hover colors stay consistent, instead of inheriting the
   conflicting link-hover (green) and outline-button-hover (white) rules. */
.barcode-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: 50rem;
    text-decoration: none;
    background-color: var(--app-layer-two);
    border: 1px solid var(--app-border-color);
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.barcode-chip,
.barcode-chip:link,
.barcode-chip:visited {
    color: var(--app-default-text-color) !important;
}

.barcode-chip:hover,
.barcode-chip:focus,
.barcode-chip:link:hover,
.barcode-chip:visited:hover {
    color: #ffffff !important;
    background-color: var(--app-secondary);
    border-color: var(--app-secondary);
}

.trace-border-soft {
    --bs-card-border-color: color-mix(in srgb, var(--app-secondary) 25%, transparent);
    border-color: color-mix(in srgb, var(--app-secondary) 25%, transparent) !important;
    opacity: 1;
}

.trace-chip {
    background-color: var(--app-success-soft);
    transition: background-color 0.12s ease;
}

.trace-chip:hover,
.trace-chip:focus {
    background-color: color-mix(in srgb, var(--app-success) 18%, var(--app-success-soft));
}


/* Custom checkbox with EXPLICIT colors - no CSS variable dependency */
.row-select-checkbox {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #495057;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    margin: 0;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
}

.row-select-checkbox:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.row-select-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.row-select-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.row-select-checkbox:hover {
    border-color: #0d6efd;
}

/* Checkbox cell */
.row-select-cell {
    text-align: center;
    vertical-align: middle;
    width: 50px;
    min-width: 50px;
    padding: 0.5rem;
    background-color: #f8f9fa;
}

/* Row hover */
.record-row {
    transition: background-color 0.1s ease-in-out;
}

.record-row:hover {
    cursor: pointer;
    background-color: #f1f3f5;
}

.record-row.is-selected {
    background-color: #cfe2ff !important;
}

.record-row.is-selected:hover {
    background-color: #b6d4fe !important;
}

/* Barcode link */
.record-row .barcode-link {
    position: relative;
    z-index: 1;
}

/* Actions column */
.record-row .actions-cell {
    text-align: center;
    vertical-align: middle;
    width: 60px;
    min-width: 60px;
}

.record-row .edit-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Date columns */
.date-col {
    white-space: nowrap;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .row-select-checkbox {
        background-color: #ffffff;
        border-color: #adb5bd;
    }

    .row-select-cell {
        background-color: #2b3035;
    }

    .record-row:hover {
        background-color: #2b3035;
    }

    .record-row.is-selected {
        background-color: #1c3a5e !important;
    }

    .record-row.is-selected:hover {
        background-color: #1f4068 !important;
    }
}

/* Device prevent horizontal scroll */
.scroll-lock-horizontal {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior-x: none;
    overscroll-behavior-y: none;
}

/* Device prevent vertical scroll */
.scroll-lock-vertical {
  max-height: 100vh;
  overflow-y: hidden;
  overscroll-behavior-y: none;
}
