/* Port-call operational status palette.
   Structural styles live in css/*.css; this final stylesheet owns only the
   domain colours that must override generic table and form presentation. */

:root {
    --pc-dark-ink: #172033;
    --pc-light-ink: #fff;
    --pc-services-bg: #d49bd7;
    --pc-services-ink: #51356e;
    --pc-sailed-bg: #e3e2f1;
    --pc-sailed-ink: #7a2020;
    --pc-canceled-bg: #69737d;
}

.app-alert-stack {
    position: sticky;
    top: var(--sb-app-header-height, 58px);
    z-index: 99;
    display: grid;
    gap: 5px;
    width: min(100%, var(--sb-layout-max));
    margin: 0 auto;
    padding: 5px 14px;
    background: var(--sb-surface);
    border-bottom: 1px solid var(--sb-border);
    box-shadow: 0 3px 8px rgba(5, 18, 32, .12);
}
.app-alert-stack[hidden] { display: none !important; }
.app-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
}
.app-alert-item__text { flex: 1 1 auto; min-width: 0; }
.app-alert-item__close {
    display: grid;
    flex: 0 0 32px;
    place-items: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    align-self: center;
    padding: 0;
    border: 1px solid var(--sb-border-strong);
    border-radius: var(--sb-radius-sm);
    background: var(--sb-surface);
    color: var(--sb-text);
    font-family: Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}
.app-alert-item__close:hover { background: var(--sb-surface-muted); }
.app-alert-stack .app-alert-item.message.success {
    background: #d0f0d5;
    border-color: #64b578;
    border-left-color: #16803c;
    color: #14532d;
}
@media (max-width: 560px) {
    .app-alert-stack { padding-inline: 8px; }
}

/* SCALI rows: colour the imported MASK fields, ShipName and status; keep SCALO, marker and AZIONI white. */
.portcall-table__status--request { --pc-row-bg: #ffbe56; --pc-row-hover-bg: #ffce7f; }
.portcall-table__status--services { --pc-row-bg: #dfb4e1; --pc-row-hover-bg: #e9c2ec; }
.portcall-table__status--expected { --pc-row-bg: #f4e762; --pc-row-hover-bg: #f7ed88; }
.portcall-table__status--anchored { --pc-row-bg: #3accff; --pc-row-hover-bg: #63d7ff; }
.portcall-table__status--berthed { --pc-row-bg: #48ff7d; --pc-row-hover-bg: #71ff9a; }
.portcall-table__status--sailed { --pc-row-bg: #eae9f5; --pc-row-hover-bg: #f4f3fb; }
.portcall-table__status--canceled { --pc-row-bg: #7c8389; --pc-row-hover-bg: #8a9196; }
.data-table tbody tr[class*="portcall-table__status--"] td:nth-child(n+3):not(.portcall-table__status-column):not(.portcall-table__progress-column):not(:last-child) {
    background: var(--pc-row-bg);
}
.data-table.portcall-table--archived tbody tr[class*="portcall-table__status--"] td:nth-child(n+2):not(.portcall-table__status-column):not(.portcall-table__progress-column):not(:last-child) {
    background: var(--pc-row-bg);
}
.data-table tbody tr.portcall-table__status--canceled td:nth-child(n+3):not(.portcall-table__status-column):not(.portcall-table__progress-column):not(:last-child) {
    color: var(--pc-light-ink);
}
.data-table.portcall-table--archived tbody tr.portcall-table__status--canceled td:nth-child(n+2):not(.portcall-table__status-column):not(.portcall-table__progress-column):not(:last-child) {
    color: var(--pc-light-ink);
}
.data-table tbody tr[class*="portcall-table__status--"] td:first-child,
.data-table tbody tr[class*="portcall-table__status--"] td.portcall-table__status-column,
.data-table tbody tr[class*="portcall-table__status--"] td.portcall-table__progress-column,
.data-table tbody tr[class*="portcall-table__status--"] td:last-child { background: #fff; color: inherit; }

.portcall-vessel-name { font-weight: 750; }
.portcall-update-marker {
    display: inline-block;
    width: 1em;
    min-width: 1em;
    margin-right: 0;
    color: #34414c;
    font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
    font-size: 1.5em;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    vertical-align: baseline;
}
.portcall-table:not(.portcall-table--archived) td:nth-child(2) { padding: 0; }
.portcall-table:not(.portcall-table--archived) td:nth-child(2) .portcall-row-link { padding: 0; }
.portcall-table th:nth-child(1),
.portcall-table td:nth-child(1),
.portcall-table:not(.portcall-table--archived) th:nth-child(2),
.portcall-table:not(.portcall-table--archived) td:nth-child(2),
.portcall-table th:nth-last-child(2),
.portcall-table td:nth-last-child(2),
.portcall-table th:last-child,
.portcall-table td:last-child { text-align: center !important; }
.portcall-table td:last-child .actions { justify-content: center; }

/* Active and archived SCALI use the same column model. */
.portcall-table th,
.portcall-table td {
  overflow-wrap: anywhere;
}

/* Rollover colours preserve each status hue with a uniform lightness lift. */
.data-table tbody tr[class*="portcall-table__status--"].portcall-table__clickable-row:hover
td:nth-child(n+3):not(.portcall-table__status-column):not(.portcall-table__progress-column):not(:last-child),
.data-table tbody tr[class*="portcall-table__status--"].portcall-table__clickable-row:hover
td.portcall-table__status-column,
.data-table tbody tr[class*="portcall-table__status--"].portcall-table__clickable-row:hover
td.portcall-table__progress-column { background: var(--pc-row-hover-bg); }
.data-table tbody tr[class*="portcall-table__status--"].portcall-table__clickable-row:hover
td:nth-child(2) { background: var(--pc-row-hover-bg); }
.data-table.portcall-table--archived tbody tr[class*="portcall-table__status--"].portcall-table__clickable-row:hover
td:first-child,
.data-table.portcall-table--archived tbody tr[class*="portcall-table__status--"].portcall-table__clickable-row:hover
td:nth-child(2) { background: var(--pc-row-hover-bg); }
.data-table tbody tr.portcall-table__clickable-row:hover td,
.data-table tbody tr.portcall-table__clickable-row--updated:hover td {
    box-shadow: inset 0 1px 0 rgba(60,75,88,.24), inset 0 -1px 0 rgba(60,75,88,.24);
}
.data-table tbody tr.portcall-table__clickable-row:hover a,
.data-table tbody tr.portcall-table__clickable-row--updated:hover a { color: inherit; }

/* Rounded status tags use stronger versions of the row hues. */
.portcall-status-badge {
    min-width: 72px;
    border: 1px solid var(--pc-badge-border, rgba(45,55,65,.18));
    background: var(--pc-badge-bg);
    color: var(--pc-badge-ink, #27313a);
    text-align: center;
}
.portcall-status-badge--request { --pc-badge-bg: #ffaa23; --pc-badge-ink: var(--pc-dark-ink); }
.portcall-status-badge--services { --pc-badge-bg: var(--pc-services-bg); --pc-badge-ink: var(--pc-services-ink); }
.portcall-status-badge--expected { --pc-badge-bg: #f9e72a; --pc-badge-ink: var(--pc-dark-ink); }
.portcall-status-badge--anchored { --pc-badge-bg: #07bfff; --pc-badge-ink: var(--pc-dark-ink); }
.portcall-status-badge--berthed { --pc-badge-bg: #15ff59; --pc-badge-ink: var(--pc-dark-ink); }
.portcall-status-badge--sailed { --pc-badge-bg: var(--pc-sailed-bg); --pc-badge-ink: var(--pc-sailed-ink); }
.portcall-status-badge--canceled { --pc-badge-bg: var(--pc-canceled-bg); --pc-badge-border: #59636d; --pc-badge-ink: var(--pc-light-ink); }

/* Status selector colours in Modifica scalo. */
#id_status.portcall-status-select,
#id_status option {
    background: var(--pc-select-bg);
    color: var(--pc-select-ink);
}
#id_status.portcall-status-select { font-weight: 750; }
#id_status.portcall-status-select--request,
#id_status option[value="REQUEST"] { --pc-select-bg: #f6d49a; --pc-select-ink: #6b461a; }
#id_status.portcall-status-select--services,
#id_status option[value="SERVICES"] { --pc-select-bg: var(--pc-services-bg); --pc-select-ink: var(--pc-services-ink); }
#id_status.portcall-status-select--expected,
#id_status option[value="EXPECTED"] { --pc-select-bg: #e9e01c; --pc-select-ink: #665100; }
#id_status.portcall-status-select--anchored,
#id_status option[value="ANCHORED"] { --pc-select-bg: #169bea; --pc-select-ink: var(--pc-dark-ink); }
#id_status.portcall-status-select--berthed,
#id_status option[value="BERTHED"] { --pc-select-bg: #2de55e; --pc-select-ink: #245d31; }
#id_status.portcall-status-select--sailed,
#id_status option[value="SAILED"] { --pc-select-bg: var(--pc-sailed-bg); --pc-select-ink: var(--pc-sailed-ink); }
#id_status.portcall-status-select--canceled,
#id_status option[value="CANCELED"] { --pc-select-bg: var(--pc-canceled-bg); --pc-select-ink: var(--pc-light-ink); }
