/* Tag-chip input (see js/tags.js) */
.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    min-height: calc(1.5em + .5rem + 2px);
    cursor: text;
    height: auto;
}
.tag-chips { display: contents; }
.tag-entry {
    border: 0;
    outline: 0;
    flex: 1 1 60px;
    min-width: 60px;
    padding: 1px 2px;
    background: transparent;
    font: inherit;
    color: inherit;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    background: #e7f1ff;
    color: #0d6efd;
    border: 1px solid #b6d4fe;
    border-radius: 1rem;
    padding: 0 .35rem 0 .55rem;
    font-size: .78rem;
    line-height: 1.5;
    white-space: nowrap;
}
.tag-chip-x {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    opacity: .7;
}
.tag-chip-x:hover { opacity: 1; color: #dc3545; }

/* ── Library browse landing (category tiles + collection cards) ── */
.browse-hero {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1.4rem 1.6rem; border-radius: 16px;
    background: linear-gradient(120deg, #1e3a8a 0%, #4338ca 55%, #6d28d9 100%);
    color: #fff; text-decoration: none;
}
.browse-hero:hover { color: #fff; filter: brightness(1.05); }
.browse-hero .hero-count { font-size: 2rem; font-weight: 700; line-height: 1; }

.browse-tile {
    display: flex; align-items: center; gap: .75rem;
    padding: .8rem .9rem; height: 100%;
    border: 1px solid #e5e7eb; border-radius: 12px; background: #fff;
    text-decoration: none; color: inherit;
    transition: box-shadow .12s ease, transform .12s ease, border-color .12s ease;
}
.browse-tile:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); border-color: #c7d2fe; transform: translateY(-1px); color: inherit; }
.browse-tile.active { border-color: #4338ca; box-shadow: 0 0 0 2px rgba(67,56,202,.15); }
.tile-mono {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 1.05rem;
}
.tile-name { font-weight: 600; line-height: 1.15; }
.tile-count { color: #6b7280; font-size: .8rem; }

.collection-card {
    display: block; text-decoration: none; color: inherit;
    border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; background: #fff;
    transition: box-shadow .12s ease, transform .12s ease;
}
.collection-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); transform: translateY(-1px); color: inherit; }
.thumb-mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 55px; gap: 1px; background: #eef0f3; }
.thumb-mosaic img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb-mosaic .empty { background: #f6f7f9; }

/* ══ Global dashboard theme — loaded on every page via _Layout, so all pages match the
      library/landing look: white surfaces, soft rounded cards, indigo accent. ══ */
body { background: #ffffff; color: #1f2937; }
main.container { max-width: 1180px; }
h1, h2, h3, h4, h5 { color: #0f172a; letter-spacing: -.01em; }

/* Cards */
.card { border: 1px solid #e9ebef; border-radius: 14px; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.card:hover { box-shadow: 0 10px 26px rgba(16, 24, 40, .07); }
.card-img-top { background: #fff; border-bottom: 1px solid #f0f1f4; }
.card-footer { background: #fbfcfd; border-top: 1px solid #f0f1f4; }
/* Empty "No preview" slot — white, defined by a hairline + a faint icon, not a grey fill. */
.thumb-blank { background: #fff; color: #b4bac4; border-bottom: 1px solid #f0f1f4; }

/* Buttons — indigo accent to match the hero + monogram tiles */
.btn { border-radius: 9px; font-weight: 500; }
.btn-primary { background: #4338ca; border-color: #4338ca; }
.btn-primary:hover, .btn-primary:focus { background: #3730a3; border-color: #3730a3; }
.btn-outline-primary { color: #4338ca; border-color: #cfd3f2; }
.btn-outline-primary:hover { background: #4338ca; border-color: #4338ca; color: #fff; }

/* Forms */
.form-control, .form-select { border-radius: 9px; border-color: #e2e5ea; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(67, 56, 202, .14); }
.form-label { font-weight: 600; color: #374151; font-size: .9rem; }

/* Badges */
.badge.bg-secondary { background: #eef1f6 !important; color: #475569 !important; font-weight: 600; }
.badge.bg-light { background: #f4f6f9 !important; }

/* Tables */
.table > thead > tr > th { color: #6b7280; font-weight: 600; border-bottom-color: #e9ebef; }
.table > tbody > tr { border-color: #f0f1f4; }

/* Navbar + alerts */
.navbar.bg-dark { background: #0f172a !important; }
.alert { border-radius: 12px; }

/* ── monday-style grouped batch editor ── */
.table.monday { border-collapse: separate; border-spacing: 0; }
.table.monday thead th {
    background: #fff; border-bottom: 2px solid #eef0f4; color: #6b7280;
    font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
    padding: 8px 10px;
}
.table.monday tbody, .table.monday tfoot { border: none; }
/* Group header row — coloured left bar + tinted band, monday-style */
.table.monday .mgroup > td {
    border: none; padding: 14px 12px; border-radius: 8px 8px 0 0;
    box-shadow: inset 5px 0 0 var(--g);
    background: color-mix(in srgb, var(--g) 7%, #fff);
}
.table.monday .mgroup .mgname { font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; }
.table.monday .mgroup .mgcount,
.table.monday .mgroup .mgsize { color: #8791a3; font-size: .82rem; margin-left: 14px; font-variant-numeric: tabular-nums; }
.table.monday .mdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 9px 1px 0; vertical-align: middle; }
.mcaret { border: 0; background: transparent; cursor: pointer; color: var(--g); font-size: .85rem; margin-right: 6px;
          padding: 0 2px; transition: transform .15s ease; display: inline-block; }
.mcaret.collapsed { transform: rotate(-90deg); }
/* Data rows: coloured left accent per group, subtle hover, roomy cells */
.table.monday .mrow > td { background: #fff; border-top: 1px solid #f1f2f6; border-bottom: 0; padding: 6px 10px; vertical-align: middle; }
.table.monday .mrow > td:first-child { box-shadow: inset 5px 0 0 var(--g); }
.table.monday .mrow:hover > td { background: #f8f9fc; }
.table.monday .mrow:last-child > td { border-bottom: 1px solid #f1f2f6; }
/* Small revit-version pill */
.mpill { display: inline-block; font-size: .74rem; font-weight: 600; color: #475569;
         background: #eef1f6; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.msize { font-variant-numeric: tabular-nums; color: #475569; }
/* Footer total */
.table.monday tfoot .mfoot > td { border-top: 2px solid #eef0f4; padding: 12px 10px; }

/* "Published to plugin" status pill (monday-style) */
.mstatus { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
           padding: 3px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.mstatus input { position: absolute; opacity: 0; width: 0; height: 0; }
.mstatus .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.mstatus.on  { background: #e6f9f0; color: #037f4c; } .mstatus.on  .dot { background: #00c875; }
.mstatus.off { background: #eef1f6; color: #8791a3; } .mstatus.off .dot { background: #c2c9d6; }
.mstatus.ro  { cursor: default; }
.mlock { display: inline-block; font-size: .66rem; font-weight: 600; color: #b4bac4; margin-left: 8px;
         text-transform: uppercase; letter-spacing: .04em; }
.table.monday .mrow-locked > td { background: #fbfcfd; }

/* Card publish badge */
.pub-badge { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pub-badge.on { background: #e6f9f0; color: #037f4c; } .pub-badge.off { background: #eef1f6; color: #8791a3; }
