:root {
    --navy: #0e2a63;
    --navy-light: #1b4596;
    --blue: #1d56b3;
    --blue-dark: #17468f;
    --sky: #eef4fc;
    --ink: #13234a;
    --ink-soft: #5a6785;
    --line: #e1e8f4;
    --field: #f6f9fd;
    --field-line: #d3ddee;
    --gold: #e8b23c;
    --red: #c43b3b;
    --green: #2e7d4f;
    --white: #ffffff;
    --shadow: 0 6px 24px rgba(16, 42, 99, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: #dcebfb url("../img/bg.jpg") center / cover no-repeat fixed;
}

h1,
h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 16px;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 20px;
}

a {
    color: var(--blue);
}

.muted {
    color: var(--ink-soft);
    font-size: 14px;
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.layout {
    display: flex;
    align-items: flex-start;
    padding: 32px;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 32px;
    height: calc(100vh - 64px);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(14, 42, 99, 0.25);
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 3px solid var(--gold);
    color: var(--white);
    text-decoration: none;
    font-family: Georgia, serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
}

.brand img {
    width: 54px;
    height: auto;
    flex-shrink: 0;
}

.brand small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #dbe4f5;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px;
    color: #dbe3f3;
    text-decoration: none;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.sidebar nav a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar nav a.active {
    color: var(--white);
    background: var(--navy-light);
    border-left-color: var(--gold);
}

.nav-count {
    margin-left: auto;
    min-width: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--gold);
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.mobile-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 30;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--navy);
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 4px 14px rgba(14, 42, 99, 0.2);
}

.nav-toggle,
.nav-close {
    position: relative;
    display: flex;
    padding: 8px;
    background: none;
    border: 0;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
}

.nav-toggle:hover,
.nav-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-toggle .icon {
    width: 24px;
    height: 24px;
}

.nav-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    text-decoration: none;
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: 700;
}

.mobile-brand img {
    width: 34px;
    height: auto;
}

.nav-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 10px;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(10, 25, 60, 0.45);
}

.sidebar-backdrop[hidden] {
    display: none;
}

.nav-logout {
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: #dbe3f3;
}

.sidebar-user .icon {
    flex-shrink: 0;
}

.sidebar-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name,
.sidebar-user-role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-name {
    color: var(--white);
    font-weight: 600;
}

.sidebar-user-role {
    font-size: 13px;
    color: #aebbd6;
}

.content {
    flex: 1;
    min-width: 0;
    min-height: calc(100vh - 88px);
    margin-top: 12px;
    padding: 32px 36px 48px;
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 0 16px 16px 0;
    box-shadow: var(--shadow);
}

.guest {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    overflow: hidden;
}

.guest>.alert {
    width: 100%;
    max-width: 520px;
}

.guest-login {
    justify-content: flex-start;
    padding-top: max(34vh, 19vw);
    background: #cfe4f8 url("../img/login-photo.jpg") center top / cover no-repeat;
}

.guest-login>.alert,
.guest-login .auth-card {
    max-width: 420px;
}

.guest-login .auth-card {
    padding: 26px 30px 20px;
}

.guest-login .auth-card h1 {
    margin: 0 0 4px;
}

.guest-login .auth-card .btn-primary {
    width: 100%;
    margin: 4px 0 14px;
}

.forgot {
    margin: -6px 0 12px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
}

.guest-logo {
    width: 200px;
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 12px rgba(14, 42, 99, 0.18));
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    padding: 34px 44px 26px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(16, 42, 99, 0.16);
}

.auth-head {
    text-align: center;
    margin-bottom: 24px;
}

.auth-head h1 {
    font-size: 40px;
    margin-bottom: 2px;
}

.auth-head .muted {
    font-size: 17px;
    margin: 0;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--blue);
    font-size: 18px;
    line-height: 1;
}

.divider span {
    width: 36px;
    height: 3px;
    border-radius: 2px;
    background: var(--blue);
}

.auth-foot {
    text-align: center;
    margin-bottom: 0;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.label-row a {
    font-size: 13px;
    font-weight: 600;
}

.code-input {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.4em;
}

.code-input::placeholder {
    letter-spacing: 0.4em;
    font-weight: 400;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--blue);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

textarea {
    resize: vertical;
}

.choices {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.choice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    background: var(--field);
    font-weight: 400;
    cursor: pointer;
}

.choice:has(input:checked) {
    border-color: var(--blue);
    background: var(--sky);
    box-shadow: 0 0 0 2px rgba(29, 86, 179, 0.15);
}

.choice:has(input:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
}

.choice input {
    width: auto;
    margin: 3px 0 0;
}

.choice>span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.choice strong {
    color: var(--navy);
}

.field {
    position: relative;
    margin: 5px 0 16px;
}

.field>.icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-soft);
    pointer-events: none;
}

.field input {
    margin-top: 0;
    padding-left: 44px;
}

.field input[type="password"],
.field input#password {
    padding-right: 48px;
}

.show-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    padding: 7px;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--ink-soft);
    cursor: pointer;
}

.show-password:hover,
.show-password[aria-pressed="true"] {
    color: var(--blue);
    background: var(--sky);
}

.password-field {
    position: relative;
    display: block;
    margin-top: 5px;
}

.password-field input {
    margin-top: 0;
}

input.has-password-toggle {
    padding-right: 48px;
}

.tagline {
    position: absolute;
    margin: 0;
    font-family: "Dancing Script", "Segoe Script", cursive;
    font-size: 46px;
    font-weight: 600;
    line-height: 1.05;
    transform: rotate(-12deg);
    pointer-events: none;
}

.tagline span {
    display: block;
}

.tagline span:nth-child(2) {
    padding-left: 0.5em;
}

.tagline span:nth-child(3) {
    padding-left: 1em;
}

.tagline span:nth-child(4) {
    padding-left: 1.5em;
}

.tagline-left {
    left: 7%;
    top: 47%;
    color: var(--white);
    text-shadow: 0 2px 12px rgba(14, 42, 99, 0.3);
}

.tagline-right {
    right: 6%;
    top: 8%;
    color: var(--navy);
    font-size: 40px;
}

.panel {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 24px;
    overflow-x: auto;
    box-shadow: var(--shadow);
}

.panel.narrow {
    max-width: 600px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 4px solid var(--gold);
    border-radius: 12px;
    padding: 18px 20px 20px;
    box-shadow: var(--shadow);
}

.card-value {
    font-family: Georgia, serif;
    font-variant-numeric: lining-nums;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--navy);
    margin-bottom: 4px;
    padding-right: 40px;
}

.card-label {
    color: var(--ink-soft);
    font-size: 15px;
}

.card-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    fill: none;
    stroke: var(--blue);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card-warn .card-icon {
    stroke: var(--gold);
}

a.card {
    display: block;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s;
}

a.card:hover {
    transform: translateY(-2px);
    border-color: #c6d5ef;
    border-top-color: var(--gold);
}

a.card h2 {
    margin-bottom: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 12px 14px;
    vertical-align: middle;
}

td {
    border-bottom: 1px solid var(--line);
}

th {
    font-size: 14px;
    color: var(--navy);
    font-weight: 700;
    white-space: nowrap;
}

thead th {
    background: var(--sky);
}

thead th:first-child {
    border-radius: 8px 0 0 8px;
}

thead th:last-child {
    border-radius: 0 8px 8px 0;
}

tbody th {
    color: var(--ink-soft);
    font-weight: 600;
    border-bottom: 1px solid var(--line);
}

.num {
    text-align: right;
}

td.actions {
    text-align: right;
    white-space: nowrap;
}

.nowrap {
    white-space: nowrap;
}

td.actions>* {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 6px;
}

td.actions form {
    margin-top: 0;
    margin-bottom: 0;
}

label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--navy);
    margin-bottom: 16px;
}

label[for] {
    margin-bottom: 0;
}

label.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 11px 13px;
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: 8px;
}

input::placeholder {
    color: #8a96b0;
}

label.inline input {
    margin-top: 0;
    width: auto;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(29, 86, 179, 0.18);
}

.btn:focus-visible,
a:focus-visible,
summary:focus-visible,
.show-password:focus-visible {
    outline: 3px solid rgba(29, 86, 179, 0.45);
    outline-offset: 2px;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font: inherit;
    font-weight: 600;
    color: var(--blue);
    background: var(--white);
    border: 1px solid #c6d5ef;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
    background: var(--sky);
    border-color: #9fb9e3;
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled,
.btn:disabled:hover {
    color: #8a96b0;
    background: #eef1f6;
    border-color: var(--field-line);
    cursor: not-allowed;
}

.btn-block {
    display: flex;
    width: 100%;
    padding: 14px;
    font-size: 17px;
    margin: 8px 0 18px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar h2 {
    margin: 0;
}

.sticky-bar,
.content > .toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    width: auto;
    margin-top: 0;
    padding: 9px 12px;
}

.filters input[type="search"] {
    min-width: 260px;
}

input.input-small,
.filters .input-small {
    width: 90px;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid;
    border-left-width: 4px;
    background: var(--white);
}

.alert-success {
    border-color: var(--green);
    color: var(--green);
    background: #effaf3;
}

.alert-error {
    border-color: var(--red);
    color: #a52c2c;
    background: #fdf1f1;
}

.alert-warning {
    border-color: var(--gold);
    color: #7a5a12;
    background: #fdf7e8;
}

.badge {
    display: inline-block;
    min-width: 30px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.badge-green {
    background: #dff1e6;
    color: var(--green);
}

.badge-gray {
    background: #e6ebf3;
    color: var(--ink-soft);
}

.badge-yellow {
    background: #fdf0c2;
    color: #7a5c00;
}

.badge-red {
    background: #fbdede;
    color: #b52a2a;
}

.badge-blue {
    background: #e0ebfb;
    color: var(--blue-dark);
}

.badge-teal {
    background: #d9f2ef;
    color: #17675e;
}

.notes {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notes li {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--line);
}

.notes li form {
    margin: 0;
}

.notes .note-main {
    flex: 1;
    min-width: 0;
}

.note-delete {
    display: inline-flex;
    padding: 6px;
    color: var(--ink-soft);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.note-delete .icon {
    width: 16px;
    height: 16px;
}

.note-delete:hover,
.note-delete:focus-visible {
    color: var(--red);
    background: #fdeeee;
}

.note-open {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 11px 10px;
    font: inherit;
    font-weight: inherit;
    color: var(--ink);
    text-align: left;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.note-open:hover,
.note-open:focus-visible {
    background: var(--sky);
}

.notes li.unread .note-open {
    background: #f4f8ff;
}

.notes li.unread .note-text::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--blue);
    vertical-align: middle;
}

.notes li.unread .note-open:hover {
    background: var(--sky);
}

.notes .muted {
    font-weight: 400;
    font-size: 13px;
}

.notes li:last-child {
    border-bottom: 0;
}

.notes li.unread {
    font-weight: 600;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.product-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    background: var(--sky);
    color: var(--ink-soft);
    font-size: 14px;
}

.product-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    padding: 12px 14px 14px;
}

.product-body h2 {
    font-size: 17px;
    margin: 0;
}

.product-body h2 a {
    color: var(--navy);
    text-decoration: none;
}

.product-body h2 a:hover {
    text-decoration: underline;
}

.product-price {
    font-weight: 700;
    font-size: 17px;
    color: var(--navy);
}

.product-body form {
    margin: auto 0 0;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 420px) 1fr;
    gap: 24px;
    align-items: start;
}

.card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qty {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
}

.qty input {
    width: 56px;
    margin: 0;
    padding: 6px 4px;
    text-align: center;
    border: 0;
    border-left: 1px solid var(--field-line);
    border-right: 1px solid var(--field-line);
    border-radius: 0;
    -moz-appearance: textfield;
}

.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-btn {
    width: 34px;
    font: inherit;
    font-size: 18px;
    font-weight: 600;
    color: var(--blue);
    background: var(--field);
    border: 0;
    cursor: pointer;
}

.qty-btn:hover {
    background: var(--sky);
}

.qty-left {
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.checkout-table td {
    vertical-align: top;
}

.pickup-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pickup-line .icon {
    flex-shrink: 0;
    color: var(--blue);
}

.product-body .product-choose {
    margin-top: auto;
    align-self: flex-start;
}

.size-label {
    margin-bottom: 6px;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.size-option {
    min-width: 48px;
    padding: 7px 14px;
    text-align: center;
    font-weight: 600;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--field-line);
    border-radius: 8px;
    text-decoration: none;
}

.size-option:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.size-option.active {
    border-color: var(--blue);
    background: var(--sky);
    color: var(--blue);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.size-option.out {
    color: #9aa3b5;
    background: #eef0f4;
    border-color: #dde1e8;
    text-decoration: line-through;
    cursor: not-allowed;
    pointer-events: none;
}

.size-option.out:hover {
    color: #9aa3b5;
    border-color: #c9cfda;
}

.size-option.out.active {
    color: var(--ink-soft);
    background: #e4e8ef;
    border-color: #9aa3b5;
    box-shadow: inset 0 0 0 1px #9aa3b5;
}

.specs-table th {
    width: 34%;
    white-space: normal;
    font-weight: 400;
    color: var(--ink-soft);
}

.product-description {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.product-thumb {
    max-width: 160px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.split .panel>.form-actions {
    margin-top: 18px;
}

.account {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

/* Cards sit in rows of two; the grid gap spaces them, and each pair stretches to the same height */
.account > .panel {
    margin-bottom: 0;
}

.profile {
    display: flex;
    gap: 28px;
    align-items: center;
}

.avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    background: linear-gradient(135deg, var(--navy-light), var(--navy));
    color: var(--white);
    font-family: Georgia, serif;
    font-size: 40px;
    font-weight: 700;
}

.profile-body {
    flex: 1;
    min-width: 0;
}

.profile-body h2 {
    font-size: 26px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-body h2 .badge {
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.profile-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    color: var(--ink);
}

.profile-line .icon {
    width: 18px;
    height: 18px;
    color: var(--ink-soft);
}

.profile-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.profile-stats a {
    display: grid;
    grid-template-columns: 42px auto;
    column-gap: 12px;
    align-items: center;
    padding: 6px 10px 6px 6px;
    margin: -6px -10px -6px -6px;
    border-radius: 12px;
    text-decoration: none;
}

.profile-stats a:hover,
.profile-stats a:focus-visible {
    background: var(--sky);
}

.profile-stats a:hover span {
    color: var(--blue);
}

.profile-stats .icon {
    grid-row: span 2;
    width: 42px;
    height: 42px;
    padding: 10px;
    border-radius: 10px;
    background: var(--sky);
    color: var(--blue);
}

.profile-stats strong {
    font-size: 20px;
    line-height: 1.1;
    color: var(--navy);
}

.profile-stats span {
    font-size: 13px;
    color: var(--ink-soft);
}

.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    margin: -6px 0 22px;
    overflow-x: auto;
}

.tabs a {
    padding: 10px 14px;
    color: var(--ink-soft);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}

.tabs a:hover {
    color: var(--navy);
}

.tabs a.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.narrow-form {
    max-width: 460px;
}

input:disabled {
    color: var(--ink-soft);
    background: #eef1f6;
    cursor: not-allowed;
}

.facts {
    margin: 0;
}

.facts div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.facts div:last-child {
    border-bottom: 0;
}

.facts dt {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.facts dt .icon {
    width: 18px;
    height: 18px;
    color: var(--blue);
}

.facts dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.recent-orders {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-orders li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.recent-orders li:last-child {
    border-bottom: 0;
}

.recent-orders a {
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
}

.recent-orders a:hover {
    text-decoration: underline;
}

.btn-block-soft {
    display: flex;
    width: 100%;
    margin-top: 14px;
    background: var(--sky);
    border-color: #d3e0f5;
}

.btn-block-soft:hover {
    background: #e2ecfa;
}

.quick-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.quick-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 4px;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.quick-links li:last-child a {
    border-bottom: 0;
}

.quick-links a:hover {
    color: var(--blue);
}

.quick-links a>.icon:first-child {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 9px;
    background: var(--sky);
    color: var(--blue);
}

.quick-links span {
    flex: 1;
    font-weight: 600;
}

.chevron-right {
    transform: rotate(-90deg);
    color: var(--ink-soft);
}

@media (max-width: 1100px) {
    .tagline {
        display: none;
    }

    .account {
        grid-template-columns: 1fr;
    }

    .split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile {
        flex-direction: column;
        text-align: center;
    }

    .profile-body h2,
    .profile-line,
    .profile-stats {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    body {
        background-attachment: scroll;
    }

    .mobile-bar {
        display: flex;
    }

    .layout {
        display: block;
        padding: 0;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 270px;
        max-width: 84vw;
        height: auto;
        border-radius: 0 16px 16px 0;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        z-index: 40;
    }

    .nav-open .sidebar {
        transform: none;
    }

    .nav-open {
        overflow: hidden;
    }

    .nav-close {
        display: flex;
    }

    .brand {
        padding-right: 52px;
    }

    .content {
        margin-top: 0;
        min-height: 0;
        padding: 22px 16px 40px;
        border-radius: 0;
    }

    .auth-card {
        padding: 26px 20px 20px;
    }

    .auth-head h1 {
        font-size: 32px;
    }

    .guest-logo {
        width: 150px;
    }

    .row {
        grid-template-columns: 1fr;
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .filters input[type="search"] {
        min-width: 0;
        width: 100%;
    }

    .sticky-bar,
    .content > .toolbar {
        top: 66px;
        padding: 8px 10px;
        gap: 6px;
    }

    .sticky-bar .filters {
        flex: 1 1 100%;
        gap: 6px;
    }

    .sticky-bar .filters input[type="search"] {
        flex: 1 1 60%;
        width: auto;
        order: 1;
    }

    .sticky-bar .filters button {
        order: 2;
    }

    .sticky-bar .filters select {
        flex: 1 1 40%;
        order: 3;
        padding: 7px 8px;
    }

    .sticky-bar .filters label.inline {
        order: 4;
        flex: 1 1 auto;
    }

    .sticky-bar>.btn {
        position: absolute;
        right: 10px;
        bottom: 8px;
        padding: 6px 12px;
        font-size: 13px;
    }

    .sticky-bar .filters label.inline {
        min-height: 32px;
    }
}

@media print {
    body {
        background: none;
    }

    .sidebar,
    .mobile-bar,
    .sidebar-backdrop,
    .toolbar,
    .alert,
    .flash-toast,
    .no-print {
        display: none;
    }

    .layout {
        display: block;
        padding: 0;
    }

    .content {
        padding: 0;
        margin: 0;
        background: none;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        min-height: 0;
    }

    .panel,
    .card {
        border: 0;
        padding: 0;
        box-shadow: none;
    }
}

.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block;
    }
}

@media print {
    .print-head {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 16px;
        padding-bottom: 10px;
        border-bottom: 2px solid #1f3b73;
    }

    .print-head img {
        width: 70px;
        height: auto;
    }

    .print-head h2 {
        margin: 0 0 2px;
    }

    .print-head p {
        margin: 0;
    }

    .content:has(.print-head)>h1 {
        display: none;
    }
}

@media print {
    .slip {
        font-size: 11px;
        line-height: 1.35;
        padding-bottom: 10px;
        border-bottom: 1px dashed #555;
        border-radius: 0;
    }

    .slip .print-head {
        gap: 10px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .slip .print-head img {
        width: 40px;
    }

    .slip .print-head h2 {
        font-size: 15px;
    }

    .slip .print-head p {
        font-size: 11px;
    }

    .slip .slip-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 16px;
        margin-bottom: 8px;
    }

    .slip-items th,
    .slip-items td {
        padding: 3px 6px;
        font-size: 11px;
    }

    .slip-items thead th {
        background: none;
        border-bottom: 1px solid #555;
        border-radius: 0;
    }

    .slip-items tfoot th {
        border-top: 1px solid #555;
    }

    .slip-note {
        margin: 6px 0 0;
        font-size: 10px;
    }
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e1e4e6;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
}

.pagination-btn {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ced4da;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #b5bbc1;
}

.pagination-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    cursor: default;
}

.pagination-btn.disabled {
    color: #6c757d;
    background: #f8f9fa;
    pointer-events: none;
    opacity: 0.6;
}

.bulk-bar {
    background: #f8f9fa;
    border: 1px solid #e1e4e6;
    border-radius: 6px;
    padding: 12px 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.bulk-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.limit-warning {
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: bold;
    display: none;
}
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
}

/* List pages where the heading, filters, and bulk bar stay put and only the table scrolls */
@media (min-width: 761px) {
    .content:has(.scroll-list) {
        height: calc(100vh - 88px);
        display: flex;
        flex-direction: column;
    }

    .content:has(.scroll-list) > * {
        flex-shrink: 0;
    }

    .content > .scroll-list {
        flex: 0 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .scroll-list > .panel {
        flex: 0 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        margin-bottom: 0;
        overflow: hidden;
    }

    .scroll-list .table-scroll {
        flex: 1 1 auto;
        min-height: 120px;
        overflow: auto;
    }

    .scroll-list .table-scroll thead th {
        position: sticky;
        top: 0;
        z-index: 1;
    }
}

/* Admin dashboard: cards fill the width, each with a short list underneath */
.cards-overview {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.overview {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 6px 20px 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.overview > .muted {
    margin: 12px 0;
}

.overview-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.overview-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.overview-list li[hidden] {
    display: none;
}

.overview-list li span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-list li .muted {
    flex-shrink: 0;
    font-size: 13px;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.fit-list [hidden] {
    display: none;
}

/* Dashboard fits the screen: the cards stay put and the lists below fill what is left */
@media (min-width: 761px) {
    .content:has(.dashboard) {
        height: calc(100vh - 88px);
        display: flex;
        flex-direction: column;
    }

    .content:has(.dashboard) > * {
        flex-shrink: 0;
    }

    .content > .dashboard {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .dashboard > * {
        flex-shrink: 0;
    }

    .dashboard > .cards-overview,
    .dashboard > .dashboard-panels {
        flex: 1 1 auto;
        min-height: 0;
        grid-auto-rows: minmax(0, 1fr);
        margin-bottom: 0;
    }

    .dashboard-panels > .panel {
        display: flex;
        flex-direction: column;
        min-height: 0;
        margin-bottom: 0;
        overflow: hidden;
    }

    .dashboard-panels .fit-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .cards-overview .card-stack {
        min-height: 0;
    }

    .cards-overview .overview {
        flex: 1 1 auto;
    }

    .cards-overview .overview-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }
}

@media (max-width: 760px) {
    .overview-list li:nth-child(n+6),
    .fit-list > li:nth-child(n+6),
    .fit-list tbody tr:nth-child(n+6) {
        display: none;
    }
}

/* Delivery photos: proof of damaged items */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.photo-grid a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--sky);
}

/* Sign-up: Terms and Conditions pop-up that must be scrolled to the end */
.terms-note {
    font-size: 14px;
    margin: 4px 0 14px;
}

.terms-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 24px 26px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(14, 42, 99, 0.35);
    color: var(--ink);
}

.terms-dialog::backdrop {
    background: rgba(14, 42, 99, 0.45);
}

.terms-dialog > h2 {
    margin-bottom: 12px;
}

.terms-scroll {
    max-height: min(55vh, 460px);
    overflow-y: auto;
    padding: 4px 16px 4px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    line-height: 1.6;
}

.terms-scroll:focus {
    outline: none;
}

.terms-scroll:focus-visible {
    outline: 3px solid rgba(29, 86, 179, 0.25);
    outline-offset: 2px;
}

.terms-scroll h2 {
    font-size: 17px;
    margin: 18px 0 6px;
}

.terms-scroll p,
.terms-scroll li {
    font-size: 14px;
}

.terms-date {
    font-style: italic;
    color: var(--ink-soft);
}

.terms-hint {
    margin: 12px 0 0;
    font-size: 14px;
}

.terms-dialog .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sign-up: a wider card so the three name fields fit on one row */
.auth-card-wide {
    max-width: 780px;
}

.table-scroll {
    overflow-x: auto;
}

.export-menu {
    position: relative;
}

.export-menu summary {
    list-style: none;
    cursor: pointer;
}

.export-menu summary::-webkit-details-marker {
    display: none;
}

.export-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    min-width: 240px;
    padding: 6px 0;
    background: var(--white);
    border: 1px solid var(--field-line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.export-list a {
    display: block;
    padding: 8px 16px;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.export-list a:hover,
.export-list a:focus {
    background: var(--sky);
    color: var(--blue);
}

.row-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 760px) {
    .row-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1500px) {
    .guest:has(.auth-card-wide) .tagline {
        display: none;
    }
}

.avatar {
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-box {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar-box form {
    margin: 0;
}

.avatar-btn {
    cursor: pointer;
}

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted, #6b7280);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--red, #b91c1c);
}

.avatar-sm {
    width: 72px;
    height: 72px;
    font-size: 24px;
    border-width: 3px;
}

.avatar-sm .icon {
    width: 30px;
    height: 30px;
}

.photo-pick {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

.photo-pick label {
    flex: 1;
    margin: 0;
}

.photo-pick .muted {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 400;
}

.avatar-btn input[type="file"] {
    display: none;
}

.code-timer {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--muted, #5b6b88);
}

.code-timer strong {
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}

.link-button:disabled {
    color: #8a96b0;
    text-decoration: none;
    cursor: default;
}

/* My Account: change password pop-up */
.password-dialog {
    width: min(460px, calc(100vw - 32px));
}

.password-dialog .toolbar {
    margin-bottom: 6px;
}

.password-dialog .toolbar h2 {
    margin: 0;
}

.password-dialog .code-timer {
    margin: -4px 0 14px;
}

.dialog-close {
    display: flex;
    padding: 6px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--muted, #5b6b88);
    cursor: pointer;
}

.dialog-close:hover {
    background: var(--line);
    color: var(--navy);
}

/* A page opened in a pop-up from a data-popup link (see includes/footer.php) */
.popup-dialog {
    width: min(820px, calc(100vw - 32px));
    padding: 0;
    overflow: hidden;
}

.popup-dialog[open] {
    display: flex;
    flex-direction: column;
}

.popup-dialog:focus {
    outline: none;
}

.popup-head {
    margin: 0;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--line);
}

.popup-head h2 {
    margin: 0;
}

.popup-head .dialog-close {
    font-size: 24px;
    line-height: 1;
    padding: 2px 9px 6px;
}

.popup-body {
    overflow-y: auto;
    padding: 18px 22px 4px;
}

.popup-body .panel {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
}

.popup-body .panel.narrow {
    max-width: none;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    border-radius: 0;
}

@media print {
    body.popup-open > :not(.popup-dialog) {
        display: none !important;
    }

    .popup-dialog {
        position: absolute;
        inset: 0 0 auto 0;
        margin: 0;
        width: auto;
        max-width: none;
        max-height: none;
        border: 0;
        box-shadow: none;
    }

    .popup-dialog::backdrop {
        background: none;
    }

    .popup-head {
        display: none !important;
    }

    .popup-body {
        overflow: visible;
        padding: 0;
    }
}

/* Products: tick boxes and the Edit / Archive / Restore bar */
.check-col {
    width: 44px;
    text-align: center;
}

.btn[aria-disabled="true"] {
    color: #8a96b0;
    background: #eef1f6;
    border-color: var(--field-line);
    cursor: not-allowed;
}

/* Manager: match a supplier's product to one the store already sells */
.match-box {
    margin-bottom: 20px;
    padding: 16px 18px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: #f7faff;
}

.match-box h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.match-box select {
    flex: 1;
    min-width: 0;
}

/* Live notifications: pop-ups in the top right corner, newest first (see includes/footer.php) */
.toasts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
}

.toast {
    position: relative;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 12px 32px rgba(14, 42, 99, 0.22);
    animation: toast-in 0.25s ease-out;
}

.toast form {
    margin: 0;
}

.toast-open {
    display: block;
    width: 100%;
    padding: 0 22px 0 0;
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
}

.toast-open:hover {
    color: var(--blue);
    text-decoration: underline;
}

.toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    padding: 2px 6px;
    font-size: 18px;
    line-height: 1;
    color: var(--ink-soft);
    background: none;
    border: 0;
    cursor: pointer;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: none; }
}

.new-notes[hidden] {
    display: none;
}

/* Message after saving or an error, at the bottom of the screen (see includes/footer.php) */
.flash-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 14px 14px 14px 18px;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(14, 42, 99, 0.22);
    font-size: 15px;
    line-height: 1.45;
    transform: translateX(-50%);
    animation: flash-in 0.25s ease-out;
    transition: opacity 0.3s, transform 0.3s;
}

.flash-success {
    border-color: var(--green);
    color: var(--green);
    background: #effaf3;
}

.flash-error {
    border-color: var(--red);
    color: #a52c2c;
    background: #fdf1f1;
}

.flash-hide {
    opacity: 0;
    transform: translate(-50%, 12px);
}

.flash-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.flash-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

@keyframes flash-in {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translateX(-50%); }
}

@media (max-width: 760px) {
    /* Below the phone menu bar */
    .toasts {
        top: 68px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

/* Customer: My Orders as order cards with status tabs */
.order-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    padding: 0 6px;
    overflow-x: auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    scrollbar-width: none;
}

.order-tabs a {
    flex: 1 0 auto;
    padding: 14px 16px 12px;
    border-bottom: 3px solid transparent;
    color: var(--ink);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.order-tabs a:hover {
    color: var(--blue);
}

.order-tabs a.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.order-tab-count {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--gold);
    color: var(--navy);
    font-size: 12px;
    line-height: 20px;
}

.order-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.order-card {
    padding: 18px 22px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.order-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.order-card-number {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-weight: 700;
    color: var(--navy);
}

.order-card-number .muted {
    font-size: 13px;
    font-weight: 400;
}

.order-card-status {
    font-weight: 700;
    white-space: nowrap;
}

.order-card-status.is-pay { color: #a77400; }
.order-card-status.is-prep { color: var(--blue); }
.order-card-status.is-ready { color: var(--green); }
.order-card-status.is-done { color: var(--ink-soft); }
.order-card-status.is-cancel { color: var(--red); }

.order-card-items {
    display: block;
    color: inherit;
    text-decoration: none;
}

.order-line {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.order-line-photo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--sky);
    color: var(--ink-soft);
}

.order-line-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-line-photo .icon {
    width: 30px;
    height: 30px;
}

.order-line-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-line-body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-line-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    white-space: nowrap;
}

.order-card-total {
    padding: 14px 0 4px;
    text-align: right;
}

.order-card-total strong {
    font-size: 18px;
    color: var(--navy);
}

.order-card-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--sky);
    color: var(--ink);
    font-size: 14px;
}

.order-card-note .icon {
    flex-shrink: 0;
    color: var(--gold);
}

.order-card-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.order-card-actions form {
    margin: 0;
}

.btn-accent {
    border-color: var(--blue);
    color: var(--blue);
}

.btn-accent:hover {
    background: var(--blue);
    color: var(--white);
}

.order-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
}

.order-empty > .icon {
    width: 44px;
    height: 44px;
    color: var(--ink-soft);
}

@media (max-width: 600px) {
    .order-card {
        padding: 14px 14px;
    }

    .order-line-photo {
        width: 64px;
        height: 64px;
    }

    .order-card-actions .btn {
        min-width: 120px;
    }
}

.selectable-row {
    cursor: pointer;
    user-select: none;
}

.selectable-row:hover td {
    background: var(--field);
}

.selectable-row:focus-visible {
    outline: 1px dashed var(--blue);
    outline-offset: -2px;
}

.selectable-row.is-selected td {
    background: #eaf1fd;
    border-top: 1px solid var(--blue);
    border-bottom: 1px solid var(--blue);
}

.selectable-row.is-selected td:first-child {
    border-left: 1px solid var(--blue);
}

.selectable-row.is-selected td:last-child {
    border-right: 1px solid var(--blue);
}

.bulk-bar > .bulk-actions-group {
    margin-left: auto;
}

/* Stock colors: rows and the legend on the products list (reusable on the inventory page) */
.stock-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--ink);
}

.stock-legend strong {
    color: var(--navy);
}

.stock-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.stock-legend .swatch {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 2px;
    background: transparent;
}

.swatch.stock-in {
    color: #15803D;
}

.swatch.stock-low {
    color: #B45309;
}

.swatch.stock-out {
    color: #B91C1C;
}

tr.stock-in td {
    background: #F0FDF4;
}

tr.stock-low td {
    background: #FFF7E0;
}

tr.stock-low td:first-child {
    box-shadow: inset 4px 0 0 #F59E0B;
}

tr.stock-out td {
    background: #FDECEC;
}

tr.stock-out td:first-child {
    box-shadow: inset 4px 0 0 #EF4444;
}

.stock-qty {
    font-weight: 700;
}

.swatch.row-archived {
    color: #64748B;
}

tr.row-archived td {
    background: #F1F5F9;
    color: var(--ink-soft);
}

tr.row-archived td:first-child {
    box-shadow: inset 4px 0 0 #94A3B8;
}

/* Order status colors: rows and the legend on the orders list */
.swatch.row-pay {
    color: #B45309;
}

.swatch.row-paid {
    color: #1D4ED8;
}

.swatch.row-done {
    color: #15803D;
}

.swatch.row-cancelled {
    color: #64748B;
}

tr.row-pay td {
    background: #FFF7E0;
}

tr.row-pay td:first-child {
    box-shadow: inset 4px 0 0 #F59E0B;
}

tr.row-paid td {
    background: #EFF6FF;
}

tr.row-paid td:first-child {
    box-shadow: inset 4px 0 0 #3B82F6;
}

tr.row-done td {
    background: #F0FDF4;
}

tr.row-cancelled td {
    background: #F1F5F9;
    color: var(--ink-soft);
}

tr.row-cancelled td:first-child {
    box-shadow: inset 4px 0 0 #94A3B8;
}

/* Bars, legends, and table headings that stay in view while scrolling (set by the script in footer.php) */
@media (min-width: 1101px) {
    .content > .panel {
        overflow: visible;
    }

    .is-sticky {
        position: sticky;
        z-index: 4;
    }

    thead th.is-sticky {
        z-index: 3;
    }

    .stock-legend.is-sticky {
        background: #ffffff;
        margin-bottom: 0;
        padding: 10px 0;
    }
}

@media print {
    .is-sticky {
        position: static;
    }
}

/* Notification checkboxes for marking or deleting many at once */
.note-check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0 4px 0 10px;
    cursor: pointer;
}

.note-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
}

/* Supplier details shown on the purchase order form after a supplier is chosen */
.supplier-details {
    margin: 4px 0 16px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
}

.supplier-details h2 {
    margin: 0 0 6px;
    font-size: 16px;
}

.supplier-details th,
.supplier-details td {
    padding: 6px 10px;
}

.supplier-details td {
    white-space: pre-line;
}

/* Bars that stay in view are solid white and sit right under each other, so the rows only move below the table headings */
@media (min-width: 1101px) {
    .bulk-bar.is-sticky {
        background: #ffffff;
        margin-bottom: 0;
        border-radius: 0;
    }

    thead th.is-sticky {
        box-shadow: 0 1px 0 var(--line);
    }
}

/* Owner dashboard charts (includes/owner_charts.php). Colors from the validated data-viz palette:
   series 1 blue, series 2 orange (both pass the colorblind checks), and the fixed status colors */
.viz-root {
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-critical: #d03b3b;
    --viz-grid: #e8ecf3;
    --viz-track: #f1f4f9;
}

.viz-panel h2 {
    margin-top: 0;
}

.viz-chart {
    display: block;
    width: 100%;
    height: auto;
}

.viz-chart .viz-grid {
    stroke: var(--viz-grid);
    stroke-width: 1;
}

.viz-chart .viz-baseline {
    stroke: var(--field-line);
    stroke-width: 1;
}

.viz-chart .viz-axis {
    fill: var(--ink-soft);
    font-size: 11px;
}

.viz-chart .viz-bar {
    fill: var(--series-1);
}

.viz-chart .viz-hit:hover .viz-bar {
    fill: #1c5cab;
}

.viz-table {
    margin-top: 10px;
}

.viz-table summary {
    cursor: pointer;
    color: var(--blue);
    font-weight: 600;
    font-size: 14px;
}

.viz-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0 24px;
}

.viz-hrow {
    display: grid;
    grid-template-columns: minmax(110px, 38%) 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
}

.viz-hlabel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.viz-hvalue {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.viz-track {
    display: block;
    height: 12px;
    border-radius: 4px;
    background: var(--viz-track);
}

.viz-fill {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
    background: var(--series-1);
}

.viz-fill.status-good,
.viz-status.status-good {
    background: var(--status-good);
}

.viz-fill.status-warning,
.viz-status.status-warning {
    background: var(--status-warning);
}

.viz-fill.status-critical,
.viz-status.status-critical {
    background: var(--status-critical);
}

.viz-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.viz-split {
    display: flex;
    gap: 2px;
    height: 28px;
    margin: 6px 0 12px;
}

.viz-seg {
    display: block;
    min-width: 4px;
    border-radius: 4px;
}

.viz-seg-walk_in {
    background: var(--series-1);
}

.viz-seg-online {
    background: var(--series-2);
}

.viz-legend {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.viz-legend li {
    display: grid;
    grid-template-columns: 14px 1fr auto 44px;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 14px;
}

.viz-legend .muted {
    text-align: right;
}

.viz-key {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.viz-subhead {
    margin-top: 8px;
}

.viz-tip {
    position: fixed;
    z-index: 60;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--navy);
    color: #ffffff;
    font-size: 13px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

@media print {
    .viz-tip,
    .viz-table summary {
        display: none;
    }
}

/* A bar that stays under the toolbar while scrolling on any screen size (set by the script in footer.php) */
.keep-in-view.is-sticky {
    position: sticky;
    z-index: 4;
    background: #ffffff;
    box-shadow: var(--shadow);
}

/* A page's own buttons shown at the top of a pop-up */
.popup-body .popup-actions {
    justify-content: flex-start;
    margin-bottom: 14px;
}

/* Two-color split bar used by chart_split() */
.viz-series-1 {
    background: var(--series-1);
}

.viz-series-2 {
    background: var(--series-2);
}

h3.viz-subhead {
    margin: 18px 0 6px;
    font-size: 16px;
    color: var(--navy);
}

.viz-root .overview-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.viz-root .overview-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

/* Tooltips stay inside the screen and wrap on small phones */
.viz-tip {
    max-width: calc(100vw - 16px);
    white-space: normal;
    text-align: center;
}

/* Purchase order row colors that the order colors do not cover */
.swatch.row-partial {
    color: #0F766E;
}

.swatch.row-declined {
    color: #B91C1C;
}

tr.row-partial td {
    background: #E6F7F5;
}

tr.row-partial td:first-child {
    box-shadow: inset 4px 0 0 #14B8A6;
}

tr.row-declined td {
    background: #FDECEC;
}

tr.row-declined td:first-child {
    box-shadow: inset 4px 0 0 #EF4444;
}

/* Small check out pop-up on the cart page (shop/cart.php opens shop/checkout.php?embed=1 inside it) */
.checkout-dialog {
    width: min(680px, 94vw);
    height: min(86vh, 820px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(14, 42, 99, 0.35);
}

.checkout-dialog[open] {
    display: flex;
    flex-direction: column;
}

.checkout-dialog::backdrop {
    background: rgba(14, 42, 99, 0.45);
}

.checkout-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 3px solid var(--gold);
    background: var(--navy);
    color: #ffffff;
}

.checkout-dialog-head h2 {
    margin: 0;
    font-size: 18px;
    color: #ffffff;
}

.checkout-dialog-head .dialog-close {
    color: #ffffff;
}

.checkout-dialog iframe {
    flex: 1;
    width: 100%;
    border: 0;
    background: #ffffff;
}

.embed-body {
    margin: 0;
    padding: 16px;
    background: #ffffff;
}

.embed-body .panel,
.embed-body .panel.narrow {
    max-width: none;
    margin-bottom: 14px;
    box-shadow: none;
}

.embed-body .checkout-table {
    font-size: 14px;
}

/* Customer dashboard (shop/dashboard.php) */
.dashboard-welcome {
    margin: -8px 0 18px;
    font-size: 17px;
    color: var(--ink-soft);
}

.gold-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #e8b23c;
    background: #fdf3d7;
    color: #6b4e00;
    font-weight: 600;
    text-decoration: none;
}

.gold-notice:hover {
    background: #fbeac0;
}

.gold-notice .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.product-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.spend-chart .spend-bar,
.spend-key.spend-bar {
    fill: var(--navy);
    background: var(--navy);
}

.spend-chart .spend-bar-now,
.spend-key.spend-bar-now {
    fill: var(--gold);
    background: var(--gold);
}

.spend-chart .spend-value {
    fill: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.spend-legend {
    margin-top: 10px;
}

.spend-key {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* Anything marked hidden stays hidden, even when a class (like .badge) sets its display */
[hidden] {
    display: none !important;
}
