/*
 * Colours reference the site's Astra global colour palette custom properties
 * (Customizer > Global > Colors) so the portal stays in sync if that palette
 * ever changes. Hex fallbacks match the palette at the time of writing:
 * 0 Theme/green #00a651, 1 Link hover/dark green #005329,
 * 2 Heading #14261C, 3 Text/grey #4E5652, 4 Background #f4f4f4,
 * 5 White #ffffff, 6 Black #000000, 7 Grey #4B4F58, 8 Light grey #f6f6f6.
 */

.blackmore-portal-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
}

.blackmore-portal-intro {
    margin: 0 0 2rem;
    text-align: left;
}

.blackmore-portal-intro h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--ast-global-color-0, #00a651);
}

.blackmore-portal-collections h3 {
    color: var(--ast-global-color-0, #00a651);
}

.blackmore-portal-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.blackmore-portal-summary-item {
    flex: 1 1 220px;
    padding: 1rem;
    background: var(--ast-global-color-8, #f6f6f6);
    border: 1px solid var(--ast-global-color-4, #f4f4f4);
    border-top: 3px solid var(--ast-global-color-0, #00a651);
    border-radius: 0.5rem;
}

.blackmore-portal-summary-item strong {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--ast-global-color-3, #4E5652);
}

.blackmore-portal-summary-item span {
    display: block;
    font-size: 1.125rem;
    color: var(--ast-global-color-2, #14261C);
}

.blackmore-portal-collections {
    overflow-x: auto;
}

.blackmore-portal-table {
    width: 100%;
    border-collapse: collapse;
}

.blackmore-portal-table th,
.blackmore-portal-table td {
    padding: 0.85rem 0.75rem;
    border: 1px solid var(--ast-global-color-4, #f4f4f4);
    text-align: left;
    vertical-align: top;
}

.blackmore-portal-table th {
    background: var(--ast-global-color-2, #14261C);
    color: var(--ast-global-color-5, #ffffff);
}

.blackmore-portal-table tbody tr:nth-child(even) {
    background: var(--ast-global-color-8, #f6f6f6);
}

.blackmore-portal-empty {
    padding: 1.5rem 1.5rem 1.5rem 0;
    border: 1px solid var(--ast-global-color-4, #f4f4f4);
    border-left: none;
    border-radius: 0 0.5rem 0.5rem 0;
    background: var(--ast-global-color-8, #f6f6f6);
}

.blackmore-portal-empty p {
    margin: 0 0 0.5rem;
}

.blackmore-portal-empty p:last-child {
    margin-bottom: 0;
}

.blackmore-portal-empty-text {
    color: var(--ast-global-color-3, #4E5652);
    font-size: 0.875rem;
}

.blackmore-portal-document-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--ast-global-color-0, #00a651);
    border-radius: 0.25rem;
    color: var(--ast-global-color-5, #ffffff);
    background: var(--ast-global-color-0, #00a651);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.blackmore-portal-document-link:hover {
    background: transparent;
    color: var(--ast-global-color-0, #00a651);
    text-decoration: none;
}

.blackmore-portal-table .blackmore-portal-document-link {
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.blackmore-portal-back-link {
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.blackmore-portal-back-link a {
    font-weight: 600;
    color: var(--ast-global-color-0, #00a651);
    text-decoration: none;
}

.blackmore-portal-back-link a:hover {
    text-decoration: underline;
}

.blackmore-portal-company-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blackmore-portal-company-list li {
    margin-bottom: 0.75rem;
}

.blackmore-portal-company-list a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--ast-global-color-4, #f4f4f4);
    border-radius: 0.5rem;
    background: var(--ast-global-color-5, #ffffff);
    color: var(--ast-global-color-2, #14261C);
    text-decoration: none;
    font-weight: 600;
}

.blackmore-portal-company-list a:hover {
    border-color: var(--ast-global-color-0, #00a651);
    color: var(--ast-global-color-0, #00a651);
}

.blackmore-portal-logged-out {
    padding: 2rem;
    border: 1px solid var(--ast-global-color-4, #f4f4f4);
    background: var(--ast-global-color-5, #ffffff);
    max-width: 640px;
    margin: 2rem auto;
}

.blackmore-portal-logged-out p {
    margin-bottom: 1rem;
}

.blackmore-portal-notice {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.blackmore-portal-notice p {
    margin: 0;
}

.blackmore-portal-notice-success {
    background: var(--ast-global-color-8, #f6f6f6);
    border: 1px solid var(--ast-global-color-0, #00a651);
    color: var(--ast-global-color-2, #14261C);
}

.blackmore-portal-notice-error {
    background: #fdf3f2;
    border: 1px solid #c0392b;
    color: #7a2418;
}

.blackmore-portal-account-form {
    max-width: 420px;
}

.blackmore-portal-account-form h3 {
    color: var(--ast-global-color-2, #14261C);
    margin: 0 0 1.25rem;
}

.blackmore-portal-account-form label {
    display: block;
    font-weight: 600;
    color: var(--ast-global-color-2, #14261C);
    margin-bottom: 0.4rem;
}

/* The login and change-password forms use a literal <br /> after each label
   (no CSS grid there) to force the line break onto the input below it. Now
   that the label itself is display:block and already forces that break, the
   <br /> would double up the gap - collapse it back down to a single break. */
.blackmore-portal-account-form label + br {
    display: none;
}

.blackmore-portal-account-form p {
    margin-bottom: 1.25rem;
}

.blackmore-portal-account-form input[type="text"],
.blackmore-portal-account-form input[type="email"],
.blackmore-portal-account-form input[type="tel"],
.blackmore-portal-account-form input[type="password"],
.blackmore-portal-account-form input[type="date"],
.blackmore-portal-account-form textarea,
.blackmore-portal-account-form select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.9rem 1rem;
    border: 1px solid #b9c2bd;
    border-radius: 0.35rem;
    background: var(--ast-global-color-8, #f6f6f6);
    font-size: 1rem;
    font-family: inherit;
    color: var(--ast-global-color-2, #14261C);
}

.blackmore-portal-account-form input:focus,
.blackmore-portal-account-form textarea:focus,
.blackmore-portal-account-form select:focus {
    outline: none;
    border-color: var(--ast-global-color-0, #00a651);
}

.blackmore-portal-app-passwords {
    max-width: 640px;
    margin-top: 2.5rem;
}

.blackmore-portal-app-passwords h4 {
    color: var(--ast-global-color-2, #14261C);
    margin: 1.5rem 0 1rem;
}

.blackmore-portal-inline-form {
    margin: 0;
}

.blackmore-portal-remove-link {
    border-color: #c0392b;
    background: #c0392b;
}

.blackmore-portal-remove-link:hover {
    background: transparent;
    color: #c0392b;
}

.blackmore-portal-app-password-reveal .blackmore-portal-app-password-value {
    margin-top: 0.5rem;
}

.blackmore-portal-app-password-reveal code {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background: var(--ast-global-color-5, #ffffff);
    border: 1px solid var(--ast-global-color-0, #00a651);
    border-radius: 0.35rem;
    font-size: 1rem;
    letter-spacing: 0.03em;
    user-select: all;
}

.blackmore-portal-request-form {
    max-width: 760px;
}

.blackmore-portal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.blackmore-portal-form-field-full {
    grid-column: 1 / -1;
}

.blackmore-portal-form-static {
    margin: 0;
    padding: 0.7rem 0;
    color: var(--ast-global-color-2, #14261C);
}

.blackmore-portal-form-hint {
    display: block;
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--ast-global-color-3, #4E5652);
    margin: 0.25rem 0 0.75rem;
}

.blackmore-portal-csv-link {
    color: var(--ast-global-color-0, #00a651);
    font-weight: 600;
    text-decoration: none;
}

.blackmore-portal-csv-link:hover {
    text-decoration: underline;
}

.bcl-photo-dropzone {
    position: relative;
    border: 1px dashed var(--ast-global-color-3, #4E5652);
    border-radius: 0.5rem;
    background: var(--ast-global-color-5, #ffffff);
    padding: 2rem 1rem;
    text-align: center;
}

.bcl-photo-dropzone.is-dragover {
    border-color: var(--ast-global-color-0, #00a651);
    background: var(--ast-global-color-8, #f6f6f6);
}

.bcl-photo-dropzone-label {
    display: block;
    font-weight: 600;
    color: var(--ast-global-color-2, #14261C);
    cursor: pointer;
}

.bcl-photo-browse {
    color: var(--ast-global-color-0, #00a651);
    text-decoration: underline;
    font-weight: 600;
}

.bcl-photo-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bcl-photo-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.bcl-photo-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 0.35rem;
    overflow: hidden;
    border: 1px solid var(--ast-global-color-4, #f4f4f4);
}

.bcl-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bcl-photo-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Layout/width tweaks supplied by Blackmore's developer (25/09/2026). */
/* Widens the dashboard, lets the collections table use full width and */
/* wrap on narrow columns, and stops the request form being width-     */
/* capped. Kept as its own block, as given, rather than merged into    */
/* the rules above.                                                    */
/* ------------------------------------------------------------------ */

.entry-content.clear {
    background-color: white;
}

.blackmore-portal-request-form {
    max-width: 100%!important;
}

.blackmore-portal-dashboard {
  box-sizing: border-box;
  width: 90%;
  max-width: 90% !important;
  min-width: 0;
  margin: 0 auto;
  padding-left: 55px !important;
  padding-right: 55px !important;
}

.blackmore-portal-collections {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.blackmore-portal-collections .blackmore-portal-table {
  width: 100% !important;
  min-width: 0;
  max-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse;
  font-size: smaller;
}

.blackmore-portal-table th,
.blackmore-portal-table td {
  padding: 0.5rem;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.blackmore-portal-table th:nth-child(2),
.blackmore-portal-table td:nth-child(2),
.blackmore-portal-table th:nth-child(3),
.blackmore-portal-table td:nth-child(3),
.blackmore-portal-table th:nth-child(5),
.blackmore-portal-table td:nth-child(5){
  white-space: nowrap;
}

/*
 * The items table (10 columns) shares .blackmore-portal-table with the
 * collections table (6 columns) above, but only columns 2/3/5 (Qty/Item
 * Class/Model) get the nowrap protection those rules give by position -
 * on the items table that left Barcode/Manufacturer/Serial no./Asset no./
 * the three Sanitisation columns with no protection at all, so
 * table-layout:auto + overflow-wrap:anywhere could squeeze them down to
 * near-zero width and wrap their header text one letter per line. Scoped
 * to .blackmore-portal-items-table specifically, so this doesn't touch the
 * collections table's Site Address column, which is supposed to wrap.
 */
.blackmore-portal-items-table th:nth-child(1),
.blackmore-portal-items-table td:nth-child(1),
.blackmore-portal-items-table th:nth-child(4),
.blackmore-portal-items-table td:nth-child(4),
.blackmore-portal-items-table th:nth-child(6),
.blackmore-portal-items-table td:nth-child(6),
.blackmore-portal-items-table th:nth-child(7),
.blackmore-portal-items-table td:nth-child(7),
.blackmore-portal-items-table th:nth-child(8),
.blackmore-portal-items-table td:nth-child(8),
.blackmore-portal-items-table th:nth-child(9),
.blackmore-portal-items-table td:nth-child(9),
.blackmore-portal-items-table th:nth-child(10),
.blackmore-portal-items-table td:nth-child(10) {
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .blackmore-portal-dashboard {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}
