/* Hide x-show elements until Alpine initialises (prevents modal flash on load) */
[x-cloak] { display: none !important; }

/* OrderlyPO - legacy overrides only (Phase 14 redesign).
   Component styling has moved to frontend/input.css's Tailwind @layer
   components (compiled to frontend/dist/output.css) - do NOT add unlayered
   rules for class names already defined there (.card, .btn*, .modal*,
   .toast*, .table-container, table/th/td, .form-group, input/select/
   textarea, .company-tab*, .dash-card*, .auth-*, .perm-*, .pagination,
   .search-bar, .placeholder-*, .admin-panel, .rte-*, .grid, .supplier-card,
   .disabled-sku, .empty-state, .nav-user): per CSS Cascade Layers, an
   unlayered rule here always wins over an @layer rule in output.css
   regardless of <link> order, so redefining any of those classes here would
   silently break the redesign.

   :root variables are kept (updated to the new palette) only because many
   inline style="..." attributes throughout index.html still reference them
   directly - a full sweep to Tailwind classes is tracked as follow-up work,
   not yet done in every view. Once that sweep is complete, this file should
   shrink to just the Quill/native-<option> overrides below.
*/

:root {
    --primary: #465fff;
    --primary-hover: #3641f5;
    --secondary: #12b76a;
    --bg-main: #f9fafb;
    --card-bg: #ffffff;
    --text-main: #1d2939;
    --text-muted: #667085;
    --border: #e4e7ec;
    --radius: 12px;
}

/* Native <option> highlighting cannot be targeted with Tailwind utilities. */
.bg-green-100 {
    background-color: #f0fff4;
    color: #22543d;
    font-weight: 600;
}

option[data-added="true"] {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    font-weight: 600;
}

select option:checked {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

/* Quill (vendored) deep-selector overrides. */
.rte-ql {
    border-radius: 6px;
}

.rte-ql .ql-toolbar {
    border-radius: 6px 6px 0 0;
}

.rte-ql .ql-container {
    border-radius: 0 0 6px 6px;
    font-size: 0.95rem;
}

.rte-ql .ql-editor {
    min-height: 110px;
}

.email-preview-frame {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

/* ==========================================================================
   Full-height workspace views (Categories).
   The section fills the viewport between the sticky header and the fixed
   footer; each of its columns scrolls independently instead of the whole
   page scrolling.
   ========================================================================== */
.view-workspace {
    display: flex;
    flex-direction: column;
    /* sticky header (~64px) + main's pt-8 (32px) + fixed footer clearance */
    height: calc(100vh - 152px);
    min-height: 460px;
}
.view-workspace .header-row {
    flex-shrink: 0;
}
.view-workspace > p {
    flex-shrink: 0;
    margin-top: -1rem !important;
}
.view-workspace .workspace-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 1.5rem;
    align-items: stretch;
    grid-template-columns: minmax(250px, 1fr) minmax(300px, 1.15fr) minmax(230px, 0.9fr);
}
.view-workspace .workspace-col {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px; /* room for scrollbar so card borders don't sit under it */
}
/* Narrow screens: back to normal page flow, page-level scrolling */
@media (max-width: 1023px) {
    .view-workspace { height: auto; min-height: 0; }
    .view-workspace .workspace-grid { grid-template-columns: 1fr; }
    .view-workspace .workspace-col { overflow: visible; }
}
