:root {
    --amber: #d98324;
    --amber-dark: #b56a15;
    --amber-light: #f6c667;
    --ink: #1c1a17;
    --ink-soft: #4a4640;
    --cream: #fdf8ef;
    --cream-deep: #f4ead8;
    --line: #e6dbc7;
    --blue: #2e3e6f;
    --blue-dark: #1a2547;
    --blue-light: #f2f4fa;
    --success: #1f7a4d;
    --danger: #b3261e;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* --font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; */
    --radius: 12px;
}

/* Universal Styles */
body {
    font-family: var(--font-family);
    margin: 0;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

h1, h2, h3 {
    color: #444;
    margin: 0;
}

a {
    text-decoration: none;
    color: #333;
}

/* Header and Navigation */
.site-header {
    background-color: #fff;
    padding: 1rem;
    padding-bottom: 0;
    /*display: flex;
    justify-content: left;
    align-items: center;
    gap: 1rem;*/
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 1rem;
}
.site-logo {
    max-width: 80px;
    padding: 0.25rem;
}

.site-title {
    margin: 0;
    font-size: 1.8rem;
}

/* BuyaBeer.ca wordmark, matching the landing page brand mark */
.site-title a {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ink);
}

.site-title .wordmark-accent {
    color: var(--amber);
}

.site-title .wordmark-dot {
    font-weight: 400;
    font-size: 0.75em;
    color: var(--amber);
}
.site-header-icon {
    max-width: 2rem;
}
.main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.main-nav .fi {
    font-size: 1.4rem;
    line-height: 1;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #555;
    margin-left: .5rem;
    margin-right: .5rem;
    font-weight: bold;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--amber); 
}

.user-menu {
    display: inline-block;
    position: relative;
    margin-left: .5rem;
}
.user-menu summary {
    list-style: none;
    cursor: pointer;
    color: #555;
}
.user-menu summary::-webkit-details-marker {
    display: none;
}
.user-menu summary .fi {
    font-size: 1.4rem;
    line-height: 1;
}
.user-menu[open] summary {
    color: var(--amber);
}
.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 10rem;
    z-index: 20;
    overflow: hidden;
}
.user-menu-dropdown a,
.user-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 1rem;
    background: none;
    border: 0;
    color: #333;
    font: inherit;
    font-weight: normal;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}
/* The logout button is wrapped in a form for its own action/method - contents keeps it out of the flex/box flow */
.user-menu-dropdown form {
    display: contents;
}
.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.main-nav-options {
    margin-top: 1.5rem;
    text-align: center;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
}

.nav-list li {
    display: flex;
    align-items: center;
}

.nav-list a {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    text-transform: lowercase;
    font-variant: small-caps;
    color: #333;
    padding: 0.25rem 0.75rem;
    font-weight: bold;
    transition: background 0.2s, color 0.2s, border 0.2s;
    line-height: 1;
}

.nav-list a:hover, .nav-list a:focus {
    background: var(--blue);
    color: #fff;
    text-decoration: none;
}

.nav-icon {
    width: 28px;
    height: 28px;
    margin-right: 0.75rem;
    filter: drop-shadow(0 2px 2px rgba(217, 131, 36, 0.15));
}

/* Main Content and Product Grid */
section {
    padding: .5rem;
}
.product-grid h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 1rem;
}
/* Centered, width-capped content area shared by the report and setup pages */
.page-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.setup-layout {
    display: grid;
    grid-template-columns: 14rem 1fr;
    align-items: start;
    gap: 2rem;
    max-width: 1500px;
    margin: 1rem auto;
    padding: 1.5rem;
    background-color: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.setup-nav {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.setup-nav a {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #444;
}
.setup-nav a:hover {
    background-color: #eee;
}
.setup-nav a.active {
    background-color: var(--cream-deep);
    color: var(--ink);
    font-weight: 600;
}
.setup-content {
    min-width: 0;
}
.setup-section {
    display: block;
}
.setup-section h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}
.setup-section h3 {
    margin-top: 1.25rem;
}
.setup-section-square {
    overflow-x: auto;
}
.setup-actions {
    margin: 0.75rem 0;
}
.setup-actions .action-link {
    margin-left: 0 !important;
}
.reports-content {
    margin-top: 0;
}
.report-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.report-link-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    color: #333;
}
.report-link-card:hover,
.report-link-card:focus {
    border-color: var(--amber);
    box-shadow: 0 2px 8px rgba(217, 131, 36, 0.18);
}
.report-link-title {
    font-weight: 700;
    color: #222;
}
.report-link-meta {
    color: #555;
    font-size: 0.92rem;
}
@media (max-width: 700px) {
    .setup-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .setup-nav {
        position: sticky;
        top: 0;
        z-index: 5;
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
        background-color: #f4f4f4;
        padding: 0.5rem 0;
        margin: -0.5rem 0 0;
    }
    .setup-nav a {
        white-space: nowrap;
        background-color: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
}
.dashboard-table {
    border-collapse: collapse;
    margin: 0 auto;
}
.dashboard-table th, .dashboard-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}
.dashboard-table th {
    background-color: #f8f8f8;
}

.teams-grid, .players-grid, .volunteers-grid, .users-grid, .products-grid, .suppressions-grid {
    display:flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1rem;
    padding: .5rem;
    background-color: #fff;
    border-radius: 8px;
}
.team-card, .player-card, .volunteer-card, .user-card, .product-row, .suppression-row {
    padding: .5rem;
    border-bottom: 1px solid #ccc;
}
.team-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.team-link-name {
    text-align: left;
}
.team-link-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}
.copy-link-btn, .share-btn, .buy-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}
.copy-link-btn.copied {
    font-style: italic;
    background-color: #d4edda;
    color: var(--success);
}
@media (max-width: 600px) {
    .team-link-row {
        align-items: stretch;
        flex-direction: column;
        gap: 0.6rem;
    }
    .team-link-name {
        line-height: 1.35;
        overflow-wrap: anywhere;
    }
    .team-link-actions {
        align-self: stretch;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
        margin-left: 0;
    }
    .copy-link-btn, .share-btn, .buy-link {
        justify-content: center;
        min-height: 2.75rem;
        padding: 0.55rem 0.4rem;
    }
}
.product-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.product-active-toggle {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: var(--blue);
}
.product-name-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.35rem;
    border: 1px solid transparent;
    border-radius: 4px;
}
.product-name-input:not([readonly]) {
    border-color: #333;
}
.product-color-input {
    flex: none;
    width: 2.25rem;
    height: 2rem;
    padding: 2px;
    cursor: pointer;
}
.product-tickets-input {
    flex: none;
    width: 3.25rem;
    padding: 0.35rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}
.product-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.product-add-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.product-add-form input[type="text"] {
    flex: 1 1 10rem;
    min-width: 0;
    padding: 0.5rem;
}
.product-add-form input[type="number"] {
    flex: 1 1 10rem;
    min-width: 0;
    padding: 0.5rem;
}
.product-add-form input[type="email"] {
    flex: 1 1 10rem;
    min-width: 0;
    padding: 0.5rem;
}
.product-add-form select {
    flex: 1 1 10rem;
    min-width: 0;
    padding: 0.5rem;
}
.product-add-form .action-link {
    margin-left: 0 !important;
}
.suppression-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.suppression-email {
    flex: 1 1 14rem;
    min-width: 0;
    overflow-wrap: anywhere;
}
.suppression-reason {
    flex: none;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-transform: capitalize;
    background: #eee;
}
.suppression-reason-hard_bounce {
    background: #f8d7da;
}
.suppression-reason-complaint {
    background: #ffe0b2;
}
.suppression-detail, .suppression-added {
    font-size: 0.8rem;
    color: #5a5a5a;
}
.suppression-actions {
    margin-left: auto;
}
.suppressions-empty {
    margin: 0.5rem;
    color: #5a5a5a;
}
.form-errors {
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: var(--danger);
    border-radius: 6px;
    padding: 0.75rem 1rem 0.75rem 2rem;
    margin: 0.5rem auto;
    max-width: 450px;
    text-align: left;
}
.form-notice {
    color: #5a5a5a;
    max-width: 450px;
    margin: 0.5rem auto;
}
.form-success {
    background: #e6f4ea;
    border: 1px solid #b7dfc1;
    color: var(--success);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 0.5rem auto;
    max-width: 450px;
}
.form-link {
    margin-top: 0.75rem;
}
.staff-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1rem;
}
.staff-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem;
    border-bottom: 1px solid #ccc;
}
.staff-id-code {
    font-family: monospace;
    font-size: 0.8rem;
    color: #5a5a5a;
}
.staff-temp-pin {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #d4edda;
    color: var(--success);
}
.staff-temp-pin-pending {
    font-size: 0.85rem;
    font-style: italic;
    color: #8a6d3b;
}
.staff-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.staff-empty {
    margin: 0.5rem;
    color: #5a5a5a;
}
.staff-auth-mode {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.staff-auth-mode label {
    margin-right: 1rem;
}
.settings-note {
    font-size: 0.85rem;
    color: #5a5a5a;
    margin: 0.5rem 0 0;
}
.square-setup-content {
    overflow-x: auto;
}
.square-setup-content table {
    width: 100%;
}
.square-setup-current {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}
.square-setup-current li {
    margin-bottom: 0.25rem;
}
.store-settings-form {
    display: grid;
    gap: 1rem;
    max-width: 34rem;
}
.store-settings-field {
    display: grid;
    /* fixed label column so every field's input starts and ends at the same place */
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
}
.store-settings-field select,
.store-settings-field input {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
}
.store-settings-note {
    margin-bottom: 0;
}
.store-settings-checkbox {
    grid-template-columns: auto minmax(0, 1fr);
}
.store-settings-checkbox input {
    width: auto;
}
.settings-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    color: #555;
    cursor: help;
}
.settings-hint-bubble {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    z-index: 10;
    width: max-content;
    max-width: 16rem;
    padding: 0.5rem 0.625rem;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.35;
    background-color: #333;
    border-radius: 6px;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
}
.settings-hint:hover .settings-hint-bubble,
.settings-hint:focus .settings-hint-bubble {
    opacity: 1;
    visibility: visible;
}
.tooltip-icon {
    font-size: 0.75rem;
}
.order-history-section {
    margin-top: 1rem;
    padding: .5rem 1rem 1rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}
.order-history-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1.5em;
    margin-bottom: 1rem;
}
.order-history-item {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ccc;
}
.order-history-table, .order-history-tickets-table {
    width: 100%;
    margin-bottom: 1rem;
}
.order-history-empty {
    color: #666;
    font-style: italic;
}
.order-history-warning {
    padding: 0.5rem 0.75rem;
    border-left: 4px solid var(--danger);
    border-radius: 4px;
    background: #fdecea;
}
.order-history-sidebar {
    gap: 1rem;
}
.order-history-sidebar > a {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #444;
}
.order-history-sidebar > a:hover {
    background-color: #eee;
}
.order-history-lookup-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0.75rem;
}
.order-history-lookup-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
}
.order-history-lookup-form input {
    padding: 0.4rem 0.5rem;
}
.order-history-lookup-form button {
    padding: 0.4rem 0.75rem;
}
.order-history-compact-result {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}
.sales-report-section {
    margin-top: 1rem;
    padding: .5rem 1rem 1rem;
    background-color: #fff;
    border-radius: 8px;
    overflow-x: auto;
}
.sales-report-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}
.sales-report-filters label {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.sales-report-filters input { padding: .4rem; }
.sales-report-filters button, .sales-report-filters a { padding: .45rem .75rem; }
.sales-report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}
.sales-report-stat {
    padding: 1rem;
    background: #f8f8f8;
    border: 1px solid #ddd;
    text-align: center;
}
.sales-report-stat strong, .sales-report-stat span { display: block; }
.sales-report-stat strong { font-size: 1.6rem; }
.sales-report-note { color: #765b00; }
.sales-report-table { width: 100%; }
.campaign-table {
    table-layout: fixed;
    width: 100%;
}
.campaign-table td {
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.campaign-table a {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.campaign-setup-table th:nth-child(1),
.campaign-setup-table td:nth-child(1) { width: 27%; }
.campaign-setup-table th:nth-child(2),
.campaign-setup-table td:nth-child(2) { width: 53%; }
.campaign-setup-table th:nth-child(3),
.campaign-setup-table td:nth-child(3) { width: 10%; }
.campaign-setup-table th:nth-child(4),
.campaign-setup-table td:nth-child(4) { width: 10%; }
.campaign-report-table th:nth-child(1),
.campaign-report-table td:nth-child(1) { width: 20%; }
.campaign-report-table th:nth-child(2),
.campaign-report-table td:nth-child(2) { width: 39%; }
.campaign-report-table th:nth-child(3),
.campaign-report-table td:nth-child(3),
.campaign-report-table th:nth-child(4),
.campaign-report-table td:nth-child(4),
.campaign-report-table th:nth-child(5),
.campaign-report-table td:nth-child(5) { width: 9%; }
.campaign-report-table th:nth-child(6),
.campaign-report-table td:nth-child(6) { width: 5%; }
.link-report-table th:nth-child(1),
.link-report-table td:nth-child(1) { width: 45%; }
.link-report-table th:nth-child(2),
.link-report-table td:nth-child(2) { width: 14%; }
.link-report-table th:nth-child(3),
.link-report-table td:nth-child(3) { width: 18%; }
.link-report-table th:nth-child(4),
.link-report-table td:nth-child(4) { width: 15%; }
.link-report-table th:nth-child(5),
.link-report-table td:nth-child(5) { width: 8%; }
.campaign-table th:last-child,
.campaign-table td:last-child {
    white-space: nowrap;
}
.campaign-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}
.campaign-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid #ddd;
    border-radius: 999px;
    color: #444;
    text-decoration: none;
    background: #fff;
}
.campaign-status-pill span {
    color: #777;
    font-size: 0.85em;
}
.campaign-status-pill.is-selected {
    border-color: var(--amber);
    background: var(--cream-deep);
    color: var(--ink);
    font-weight: 700;
}
.campaign-group .campaign-detail-row,
.campaign-report-group .campaign-detail-row {
    display: none;
}
.campaign-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.campaign-toggle-label {
    cursor: pointer;
    display: inline-flex;
}
.campaign-toggle-input:focus-visible + .campaign-toggle-label {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}
.campaign-group:has(.campaign-toggle-input:checked) .campaign-detail-row,
.campaign-report-group:has(.campaign-toggle-input:checked) .campaign-detail-row {
    display: table-row;
}
.campaign-group:has(.campaign-toggle-input:checked) .order-accordion-icon-closed,
.campaign-report-group:has(.campaign-toggle-input:checked) .order-accordion-icon-closed {
    opacity: 0;
    transform: rotate(90deg);
}
.campaign-group:has(.campaign-toggle-input:checked) .order-accordion-icon-open,
.campaign-report-group:has(.campaign-toggle-input:checked) .order-accordion-icon-open {
    opacity: 1;
    transform: rotate(0deg);
}
.campaign-detail-row > td {
    background: #fafafa;
    padding: 0.75rem 1rem;
    width: 0;
    max-width: 0;
    min-width: 0;
    overflow: hidden;
}
.campaign-detail-content {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
.campaign-detail-content p {
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
}
.campaign-detail-value {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
}
.campaign-detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.campaign-detail-actions form {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.campaign-detail-actions input[type="text"] {
    max-width: 16rem;
    padding: 0.35rem 0.5rem;
}
.campaign-detail-actions input[name="notes"] {
    max-width: 22rem;
}
.campaign-qr-preview {
    max-width: 12rem;
    height: auto;
}
@media (max-width: 600px) {
    .sales-report-summary { grid-template-columns: 1fr; }
}

/* Report section headings keep their own alignment - .product-grid h2's centering would otherwise win */
.sales-report-section h2 {
    text-align: left;
}
/* Redeemed report: per-bartender product breakdown accordion (same checkbox-toggle pattern as the orders table) */
.redeemer-toggle-col {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}
.redeemer-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.redeemer-toggle-label {
    cursor: pointer;
}
.redeemer-toggle-input:focus-visible + .redeemer-toggle-label {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}
.redeemer-product-row {
    display: none;
}
.redeemer-product-row > td {
    background: #fafafa;
}
.redeemer-product-name {
    padding-left: 1.5rem;
}
.redeemer-group:has(.redeemer-toggle-input:checked) .redeemer-product-row {
    display: table-row;
}
.redeemer-group:has(.redeemer-toggle-input:checked) .order-accordion-icon-closed {
    opacity: 0;
    transform: rotate(90deg);
}
.redeemer-group:has(.redeemer-toggle-input:checked) .order-accordion-icon-open {
    opacity: 1;
    transform: rotate(0deg);
}

/* Report actions (print button + full-log option) and the redemption log's controls */
.report-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 0 1rem;
}
.report-print-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.section-header-row h2 {
    margin: 0;
    text-align: left;
}
.redeemer-expand-all {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}
.per-page-form label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.per-page-form select {
    padding: 0.3rem;
}
.log-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
}
.log-pagination-info {
    color: #555;
}
.log-pagination-link.disabled {
    color: #aaa;
}

/* Print versions of the report pages: wordmark header in, site chrome + interactive controls out */
.print-header {
    display: none;
}
@media print {
    .site-header,
    .site-footer,
    #cookie-banner,
    .reports-nav,
    .sales-report-filters,
    .report-actions,
    .redeemer-expand-all,
    .per-page-form,
    .log-pagination,
    .redeemer-toggle-col {
        display: none !important;
    }
    .print-header {
        display: block;
        margin: 0 0 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid var(--ink);
    }
    .print-wordmark {
        display: block;
        font-family: var(--font-family);
        font-weight: 700;
        letter-spacing: -0.5px;
        font-size: 1.8rem;
        color: var(--ink);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .print-wordmark .wordmark-accent {
        color: var(--amber);
    }
    .print-wordmark .wordmark-dot {
        font-weight: 400;
        font-size: 0.75em;
        color: var(--amber);
    }
    .print-report-title {
        display: block;
        font-size: 1.2rem;
        font-weight: 600;
        margin-top: 0.25rem;
    }
    .print-report-meta {
        display: block;
        color: #555;
        font-size: 0.9rem;
    }
    .reports-layout {
        display: block;
        padding: 0;
        border: 0;
        box-shadow: none;
    }
    .sales-report-section {
        box-shadow: none;
        border: 1px solid #bbb;
    }
    .sales-report-section .sales-report-section {
        border: none;
        padding: 0;
    }
    /* The summary stat cards keep their shading (print-color-adjust is on below) so they still read as cards */
    .sales-report-stat {
        border: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .dashboard-table th,
    .dashboard-table td {
        border-left: none;
        border-right: none;
    }
    /* Bartender totals vs. product sub-rows: weight + indent instead of background (backgrounds don't print reliably) */
    .redeemer-row > td {
        font-weight: 700;
        border-top: 2px solid #555;
    }
    .redeemer-group:first-of-type .redeemer-row > td {
        border-top: none;
    }
    .redeemer-product-row > td {
        background: none;
        border-top: none;
        color: #444;
        font-size: 0.95em;
    }
    .redeemer-product-row .redeemer-product-name {
        padding-left: 2rem;
    }
    /* Redemption log starts on a fresh sheet (screen unaffected - the rule only exists inside @media print) */
    .log-section {
        break-before: page;
    }
    /* The log is the longest table - smaller type saves paper */
    .log-section .dashboard-table {
        font-size: 0.82em;
    }
    .log-section .dashboard-table th,
    .log-section .dashboard-table td {
        padding: 0.3rem 0.5rem;
    }
    /* Bartender breakdowns print fully expanded, toggles hidden */
    .redeemer-product-row {
        display: table-row;
    }
    .dashboard-table thead {
        display: table-header-group;
    }
    body:not(.print-include-log) .log-section {
        display: none !important;
    }
}
.player-card, .volunteer-card, .user-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.user-card-inactive .user-display {
    opacity: 0.72;
}
.player-actions, .volunteer-actions, .user-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.user-role {
    min-width: 80px;
    text-transform: capitalize;
}
.user-status-invited {
    min-width: 0;
    background: #fff3cd;
    color: #7a5b00;
    border-radius: 12px;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
}
.user-status-inactive {
    min-width: 0;
    background: #eee;
    color: #555;
    border-radius: 12px;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
}
.user-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.user-management-tools {
    display: flex;
    justify-content: flex-end;
    margin: 0.75rem 0;
}
.user-edit-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.user-edit-form[hidden] {
    display: none;
}
.user-edit-form input,
.user-edit-form select {
    min-width: 10rem;
}
.team-roles-grid{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.team-roles-grid {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    margin-top: 1em;
}
.team-role {
    background-color: #e3e3e3;
    padding: 0.25em 0.75em;
    border-radius: 12px;
    font-size: 0.9em;
    text-transform: capitalize;
}
.section-title {
    text-align: center;
    font-size: 2rem;
}

/* Individual Beer Card */
.site-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: .8rem;
    transition: transform 0.3s ease;
}

.site-card img {
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.site-card h3 {
    margin: 0.5rem 0;
}

.site-card label:not(.checkout-notify) {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.35rem;
}

.site-card input[type="text"],
.site-card input[type="password"],
.site-card select.name-input,
.name-input {
    box-sizing: border-box;
    width: 85%;
    max-width: 450px;
    padding: 0.65rem 0.9rem;
    margin: 0.25rem auto 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background-color: #fff;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    outline: none;
    line-height: 1.3;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.site-card input[type="text"]::placeholder,
.site-card input[type="password"]::placeholder {
    color: #888;
    font-weight: 400;
}

.site-card select.name-input,
select.name-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4640' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.85rem;
    padding-right: 2.3rem;
    cursor: pointer;
}

.site-card input[type="text"]:hover,
.site-card input[type="password"]:hover,
.site-card select.name-input:hover,
.name-input:hover {
    border-color: var(--blue);
    background-color: var(--blue-light);
}

.site-card input[type="text"]:focus,
.site-card input[type="password"]:focus,
.site-card select.name-input:focus,
.name-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(46, 62, 111, 0.2);
    background-color: #fff;
}

.site-card .price {
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--amber-dark);
    display: block;
    margin: 0.6rem 0 0.4rem;
}

.terms-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
    padding: .8rem;
    transition: transform 0.3s ease;
}
.terms-card h1 {
    text-align: left;
    margin-bottom: 1rem;
}
.terms-card h2 {
    text-align: left;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Product Card Actions & Quantity Controls */
.product-action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.qty-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.qty-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
}

.qty-select,
.site-card .qty-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4640' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 0.85rem;
    padding: 0.65rem 2rem 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    border: 1.5px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    line-height: 1.2;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    outline: none;
    min-width: 4.25rem;
    text-align: left;
    margin: 0;
}

.qty-select:hover {
    border-color: var(--blue);
    background-color: var(--blue-light);
}

.qty-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(46, 62, 111, 0.2);
    background-color: #fff;
}

.primary-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--blue);
    color: #fff;
    border: none;
    margin: 0;
    padding: 0.68rem 1.4rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(46, 62, 111, 0.25);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.info-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
    display: block;
}

.primary-action-btn:hover {
    background-color: var(--blue-dark);
    box-shadow: 0 5px 12px rgba(46, 62, 111, 0.35);
    transform: translateY(-1px);
}

.primary-action-btn:active {
    transform: translateY(0);
}

.primary-action-btn i.fi {
    font-size: 1.1rem;
    line-height: 1;
}

.secondary-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: transparent;
    color: var(--blue);
    border: 2px solid var(--blue);
    margin: 0;
    padding: 0.68rem 1.4rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.secondary-action-btn:hover {
    background-color: var(--blue);
    color: #fff;
    transform: translateY(-1px);
}

.secondary-action-btn:active {
    transform: translateY(0);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 1rem;
    background-color: #333;
    color: #fff;
    font-size: 0.9rem;
}
.site-footer a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

/* Cookie consent banner */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
}
.cookie-banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}
.cookie-banner-text {
    margin: 0;
    flex: 1 1 260px;
    font-size: 0.95rem;
    line-height: 1.3;
}
.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}
.cookie-btn {
    min-width: 9rem;
    padding: 0.65em 1.5em;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.cookie-banner .primary-action-btn {
    border: 2px solid var(--amber);
    background: var(--amber);
    color: #fff;
    box-shadow: none;
}
.cookie-banner .primary-action-btn:hover {
    background: var(--amber-dark);
    border-color: var(--amber-dark);
    box-shadow: none;
}
.cookie-banner .secondary-action-btn {
    border: 2px solid var(--amber);
    background: transparent;
    color: #fff;
}
.cookie-banner .secondary-action-btn:hover {
    background: var(--amber);
}
@media (max-width: 600px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
    }
    .cookie-banner-text {
        flex: 0 1 auto;
    }
    .cookie-banner-actions {
        width: 100%;
        gap: 0.75rem;
    }
    .cookie-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 0.6em 0.5em;
    }
}

/* Print Button Styling */
.action-link {
    display: inline-block;
    min-width: 9rem;
    background-color: #f4f4f4!important;
    margin: 0 0.5rem!important;
    border: none;
    cursor: pointer;
    padding: 0.5em;
    line-height: 1.2; /* fixed so icon-only buttons (e.g. reprint) render the same height as icon+text ones */
    transition: background 0.2s;
}

.action-link img {
    max-width: 1.6rem;
    height: auto;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

.action-link:hover {
    background: transparent;
}

.action-link:hover img {
    filter: brightness(0) saturate(100%) invert(29%) sepia(98%) saturate(749%) hue-rotate(179deg) brightness(98%) contrast(101%);
}
/* View Cart Button */
.view-cart-btn,
.cart-modal-btn {
    border: 2px solid var(--amber);
    border-radius: 5px;
    background: #fff;
    color: var(--amber-dark);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}
.view-cart-btn {
    display: inline-block;
    margin-top: 1em;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
}
.view-cart-btn:hover,
.cart-modal-btn:hover {
    background: var(--amber);
    color: #fff;
}

/* Pickup-notice opt-in, highlighted so it is not missed above the Checkout button */
.checkout-notify {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    max-width: 450px;
    margin: 1rem auto 0;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.35;
    border: 1px solid var(--blue);
    border-left: 5px solid var(--blue);
    border-radius: 6px;
    background: var(--blue-light);
    cursor: pointer;
}

.checkout-notify:hover,
.checkout-notify:focus-within {
    background: #e7ebf6;
}

/* .site-card input stretches every field to 85%, which pushed the label far from the box */
.checkout-notify input[type="checkbox"] {
    width: 1.15rem;
    min-width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    padding: 0;
    accent-color: var(--blue);
    cursor: pointer;
}

.checkout-notify small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8em;
    color: #5a5a5a;
}

/* Checkout Button */
.checkout-btn {
    background: var(--amber);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.75em 2em;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(217, 131, 36, 0.3);
    transition: background 0.2s, color 0.2s;
    margin-top: 1em;
}

.checkout-btn:hover,
.checkout-btn:focus {
    background: var(--amber-dark);
    color: #fff;
}

.cart-clear-link {
    padding: 0;
    border: none;
    background: none;
    color: #333;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.cart-clear-link:hover,
.cart-clear-link:focus {
    color: var(--danger);
    text-decoration: underline;
}

/* Cart Modal Styles */
.cart-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(28, 26, 23, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.cart-modal-content {
    background: #fff;
    padding: 2em 2em 1em 2em;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(28, 26, 23, 0.15);
    text-align: center;
}
.cart-modal-actions {
    margin-top: 1.5em;
    display: flex;
    gap: 1em;
    justify-content: center;
}
.cart-modal-btn {
    padding: 0.75em 2em;
    text-decoration: none;
    font-size: 1em;
}
.cart-modal-link:hover {
    background: var(--amber);
    color: #fff;
}
/* cart grid */
.cart-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    justify-content: center;
    margin-top: 1em;
}

.cart-card {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.25em 1.5em;
    min-width: 220px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.cart-card-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5em;
}

.cart-card-title {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--ink);
}

.cart-card-type {
    font-size: 0.95em;
    color: #888;
    background: #f2f2f2;
    padding: 0.2em 0.7em;
    border-radius: 12px;
    max-height: 1.5em;
}

.cart-card-body {
    margin-bottom: 1em;
    width: 100%;
}

.cart-card-action {
    width: 100%;
    text-align: right;
}

.cart-remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    padding: 0;
    font-size: 0.95em;
    font-weight: normal;
    border-radius: 0;
    cursor: pointer;
    text-decoration: underline;
    transition: none;
}

/* Order Items Grid */

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.order-items-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.order-items-column {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(46,62,111,0.07);
    padding: 1rem;
}

.order-items-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.35rem;
    margin-bottom: 0.75rem;
}

.order-items-column-note {
    font-size: 0.85rem;
    color: #6b6b6b;
}

.order-items-empty {
    color: #6b6b6b;
    font-style: italic;
    margin: 0.25rem 0 0;
}

.order-items-column .order-item-card-container {
    max-width: 100%;
}

@media (max-width: 1100px) {
    .order-items-columns {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }
}

@media (max-width: 720px) {
    .order-items-columns {
        grid-template-columns: 1fr;
    }
}

.order-items-list-status-title{
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #333;
}
.order-items-list-status-title img {
    max-width: 2rem;
    height: auto;
    margin: 0;
    padding: .2rem;
    display: inline-block;
    vertical-align: middle;
}
.view-toggle-bar .staging-print-note {
    color: #856404;
    font-size: 0.85rem;
}
.printer-select-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.printer-select-group label {
    font-weight: bold;
    color: var(--ink);
}
.printer-select-group select,
.order-filter-input {
    font-family: inherit;
    font-size: 0.95rem;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.4rem 0.6rem;
    min-width: 12rem;
}
.printer-select-group select:focus,
.order-filter-input:focus {
    outline: none;
    border-color: var(--amber);
}
.printer-select-group select:disabled {
    color: #999;
    font-style: italic;
    background-color: #f4f4f4;
    cursor: not-allowed;
}
.printer-refresh-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--amber-dark);
    transition: background 0.2s;
}
.printer-refresh-btn:hover {
    background: #f4f4f4;
}
.order-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.order-filter-group label {
    font-weight: bold;
    color: var(--ink);
}
.order-filter-empty {
    color: #6b6b6b;
    font-style: italic;
    text-align: center;
}
/* Set by js/orderFilter.js; !important because the targets have their own display rules */
.is-filtered-out {
    display: none !important;
}
.scan-result {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 8px;
    background: #f4f4f4;
    color: #333;
}
.scan-result.scan-success {
    background: #e6f4ea;
    color: var(--success);
}
.scan-result.scan-error {
    background: #fdeaea;
    color: var(--danger);
}
.scan-input {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
    pointer-events: none;
}

.order-item-card-container {
    display: flex;
    flex-wrap: wrap;
    flex: 0 1 34rem; /* fixed target width so long to/from text wraps instead of stretching the card; wide enough to keep the actions column beside it instead of wrapping below; still shrinks in narrow columns */
    border: 1px solid #ccc;
    padding: 0.5rem;
    border-radius: 8px;
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(46,62,111,0.07);
    max-width: 700px;
    /* width: 100%; */
    box-sizing: border-box;
}
.order-item-card {
    display: flex;
    /* flex-direction: column; */
    flex-grow: 1;
    min-width: 320px; 
    max-width: 30rem; 
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(46,62,111,0.07);
    padding: 1em 1.5em;
    box-sizing: border-box;
}

.order-item-actions-card {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    justify-content: flex-start;
    align-items: flex-start;
    padding-left: 1rem;
}

.order-item-number {
    white-space: nowrap;
    font-weight: bold;
    align-self: flex-end;
}

.order-label-from{
    margin-bottom: 1rem;
}

.order-item-details-grid {
    display: grid;
    grid-template-columns: 3rem 1fr; /* Label and value columns */
    gap: 0.5em 1em;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

/* Order Print Grid */
.order-stage-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 2rem;
}

.order-print-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
    margin-top: 1em;
    width: 100%;
}

.order-print-card {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(46,62,111,0.07);
    padding: 1em 1.5em;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    gap: 0.5em;
}
.view-order-items-link {
    align-self: center;
    font-weight: bold;
    cursor: pointer;
    text-align: right;
}
.view-order-items-link img {
    max-width: 1.5rem;
    height: auto;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}
.order-print-card.prepare {
    border-top: 5px solid lightblue;
}
.order-print-card.active {
    box-shadow: 0 0 0 2px #a1a4ab;
    border-top: 5px solid var(--amber);
}

.order-print-details-grid {
    display: grid;
    grid-template-columns:  1fr 1fr 1fr; /* for three columns */
    gap: 0.5em 1em;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.order-print-actions {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    grid-column: span 3; /* Span all columns */
    width: 100%;
    margin-top: 0.5em;
    justify-content: center;
}

.ticket-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Card/list view toggle switch */
.view-toggle-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding:0.5rem;
    justify-content:center;
}
.view-toggle-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.view-toggle-text {
    font-weight: bold;
    color: var(--ink);
}
.view-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex: 0 0 auto;
}
.view-toggle .view-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}
.view-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: 0.3s;
}
.view-toggle .slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.view-toggle input:checked + .slider {
    background-color: var(--blue);
}
.view-toggle input:checked + .slider::before {
    transform: translateX(24px);
}

/* Toggled by the view-toggle switch above: rows view hidden by default, shown (and cards hidden) once the switch is checked */
.order-items-cards-view {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.order-items-rows-view {
    display: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(46,62,111,0.07);
    padding: 0.25rem 1rem;
    box-sizing: border-box;
}
.view-toggle-wrap:has(.view-toggle-input:checked) .order-items-cards-view {
    display: none;
}
.view-toggle-wrap:has(.view-toggle-input:checked) .order-items-rows-view {
    display: block;
}

/* Toggled by the allow-reprint switch: reprint links hidden by default (admin-only, avoids accidental reprints) */
.reprint-item {
    display: none;
    min-width: 0;
    width: auto;
    padding: 0.5em;
    font-size: 1rem; /* adjust here if the icon-only button needs to shrink further */
}
.view-toggle-wrap:has(.reprint-toggle-input:checked) .reprint-item {
    display: inline-block;
}

/* Order-item list row (list-view companion to .order-item-card) */
.order-item-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75em;
    padding: 0.5em 0;
    border-bottom: 1px solid #eee;
}
.order-item-row:last-child {
    border-bottom: none;
}
.order-item-row-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75em;
}
.order-item-row-number {
    font-weight: bold;
    white-space: nowrap;
}
.order-item-row-order {
    color: #6b6b6b;
}
.order-item-row-actions {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-left: auto;
}

/* Order row + slide-out items accordion (mirrors .team-accordion) */
.order-accordion {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1em 1.5em;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.75em;
}
.order-accordion.prepare {
    border-top: 5px solid lightblue;
}
.order-accordion.active {
    box-shadow: 0 0 0 2px #a1a4ab;
    border-top: 5px solid var(--amber);
}
.order-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.2s ease;
}
.order-accordion-summary:hover {
    color: var(--amber);
}
.order-accordion-summary::-webkit-details-marker {
    display: none;
}
.order-accordion-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5em 1em;
    flex: 1;
}
.order-accordion-icons {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
}
.order-accordion-history-link {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    color: var(--amber-dark);
    font-size: 1.1em;
}
.order-accordion-history-link:hover {
    color: var(--amber);
}
.order-accordion-icon {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    color: var(--amber-dark);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.order-accordion-icon-closed {
    opacity: 1;
    transform: rotate(0deg);
}
.order-accordion-icon-open {
    opacity: 0;
    transform: rotate(-90deg);
}
.order-accordion[open] .order-accordion-icon-closed {
    opacity: 0;
    transform: rotate(90deg);
}
.order-accordion[open] .order-accordion-icon-open {
    opacity: 1;
    transform: rotate(0deg);
}
.order-accordion::details-content {
    block-size: 0;
    overflow: hidden;
    opacity: 0;
    transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete, opacity 0.3s ease;
}
.order-accordion[open]::details-content {
    block-size: auto;
    opacity: 1;
}
@supports (interpolate-size: allow-keywords) {
    .order-accordion {
        interpolate-size: allow-keywords;
    }
}
.order-accordion-body {
    margin-top: 0.75em;
}

/* All-orders table: one <tbody> per order holding a summary row + a hidden line-items row */
.orders-table {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.orders-table-order.prepare .orders-table-row > td {
    border-top: 3px solid lightblue;
}
.orders-table-order.active .orders-table-row > td {
    background: var(--cream);
    border-top: 3px solid var(--amber);
}
.orders-table-row:hover > td {
    background: #f8f8f8;
}
.orders-table-actions-col {
    width: 1%;
    white-space: nowrap;
}
.orders-table-total, .order-items-table-total {
    text-align: right;
    white-space: nowrap;
}
.orders-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1em;
}
.orders-table-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.orders-table-toggle-label {
    cursor: pointer;
}
.orders-table-toggle-input:focus-visible + .orders-table-toggle-label {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}
.orders-table-items-row {
    display: none;
}
.orders-table-order:has(.orders-table-toggle-input:checked) .orders-table-items-row {
    display: table-row;
}
.orders-table-order:has(.orders-table-toggle-input:checked) .order-accordion-icon-closed {
    opacity: 0;
    transform: rotate(90deg);
}
.orders-table-order:has(.orders-table-toggle-input:checked) .order-accordion-icon-open {
    opacity: 1;
    transform: rotate(0deg);
}
.orders-table-items-row > td {
    background: #fafafa;
    padding: 0.75rem;
}

/* Line-item sub-table inside an expanded order row */
.order-items-table {
    width: 100%;
    background: #fff;
}
.order-items-table-group th {
    background: var(--cream-deep);
    color: var(--ink);
    text-transform: capitalize;
}
.order-items-table-actions-col {
    width: 1%;
    white-space: nowrap;
}
.order-items-table-actions {
    white-space: nowrap;
}
.order-items-table-actions form {
    display: inline;
}

.team-roles-grid {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    margin-top: 1em;
}
.team-role {
    min-width: 120px;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 0.5em 1em;
    text-align: center;
}
.team-role-label {
    font-weight: bold;
    margin-bottom: 0.3em;
}
.team-player {
    margin-top: 0.2em;
    color: var(--amber-dark);
}
.team-player.unassigned {
    color: var(--danger);
    font-style: italic;
}
.team-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.2s ease;
}
.team-accordion-summary:hover {
    color: var(--amber);
}
.team-accordion-summary::-webkit-details-marker {
    display: none;
}
/* Both icons share one grid cell so they can cross-fade/rotate into each other */
.team-accordion-icons {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
}
.team-accordion-icon {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    color: var(--amber-dark);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.team-accordion-icon-closed {
    opacity: 1;
    transform: rotate(0deg);
}
.team-accordion-icon-open {
    opacity: 0;
    transform: rotate(-90deg);
}
.team-accordion[open] .team-accordion-icon-closed {
    opacity: 0;
    transform: rotate(90deg);
}
.team-accordion[open] .team-accordion-icon-open {
    opacity: 1;
    transform: rotate(0deg);
}
/* Animates the open/close height where supported; harmless elsewhere */
.team-accordion::details-content {
    block-size: 0;
    overflow: hidden;
    opacity: 0;
    transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete, opacity 0.3s ease;
}
.team-accordion[open]::details-content {
    block-size: auto;
    opacity: 1;
}
@supports (interpolate-size: allow-keywords) {
    .team-accordion {
        interpolate-size: allow-keywords;
    }
}
.team-roster {
    margin-top: 0.5em;
}
.team-roster-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75em;
    padding: 0.4em 0;
    border-bottom: 1px solid #eee;
}
.team-roster-actions {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-left: auto;
}
.team-roster-row:last-child {
    border-bottom: none;
}
.team-roster-role {
    text-transform: capitalize;
    color: var(--ink);
    font-weight: bold;
}
.team-roster-row.unassigned {
    color: var(--danger);
    font-style: italic;
}
.team-roster-add-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}
.team-roster-add-form select {
    flex: 1 1 12rem;
    min-width: 0;
    padding: 0.45rem;
}

/* Hamburger styles */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    margin: 0 auto 1em auto;
    z-index: 1001;
}
.nav-hamburger span {
    display: block;
    width: 28px;
    height: 4px;
    margin: 4px 0;
    background: var(--blue);
    border-radius: 2px;
    transition: 0.3s;
}

/* Responsive nav menu */
@media (max-width: 700px) {
    .header-container {
        flex-wrap: wrap;
    }
    .main-nav {
        order: -1;
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        margin-bottom: 0.25rem;
    }
    .site-logo {
        max-width: 64px;
    }
    .site-title {
        font-size: 1.55rem;
    }
    .main-nav-options {
        position: relative;
    }
    .nav-hamburger {
        display: flex;
    }
    .nav-list {
        position: absolute;
        top: 48px;
        left: 50%;
        transform: translateX(-50%);
        background: #fff;
        box-shadow: 0 4px 16px rgba(46, 62, 111, 0.16);
        border-radius: 0 0 12px 12px;
        flex-direction: column;
        gap: 0;
        width: 90vw;
        max-width: 340px;
        padding: 0.5em 0;
        display: none;
        z-index: 1000;
    }
    .nav-list.show {
        display: flex;
    }
    .nav-list li {
        width: 100%;
        justify-content: center;
        border-bottom: 1px solid #eee;
    }
    .nav-list li:last-child {
        border-bottom: none;
    }
    .nav-list a {
        width: 100%;
        padding: 1em 0;
        font-size: 1.1rem;
        border-radius: 0;
        justify-content: center;
        color: var(--blue);
        background: none;
        text-align: center;
    }
    .nav-list a:hover, .nav-list a:focus {
        background: var(--blue);
        color: #fff;
    }
}