/* ============================================================
   FEATURES STYLES - Flango Café
   Cart, Checkout, Buttons, Themes, Settings, Header Actions
   ============================================================ */

/* ============================================================
   TYPOGRAPHY (H2, H3)
   ============================================================ */

h2 {
    color: var(--primary-color);
    text-align: left;
    font-size: clamp(22px, 2.6vw, 32px);
    margin: 0;
}

h3 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 20px
}

/* ============================================================
   SIDEBAR
   ============================================================ */

#sidebar {
    background-color: var(--white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0, 0, 0, .1);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    min-height: 0;
}

.sidebar-main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: #f7f9fc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

#logged-in-user-avatar-container {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#logged-in-user {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
    margin: 0;
    line-height: 1.3;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 12px;
    width: 100%;
}

.header-action-btn {
    width: 68px;
    height: 68px;
    border-radius: 0;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
}

.header-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
}

.header-action-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.header-action-btn img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* ============================================================
   BETA RIBBON (only visible on /app-beta)
   ============================================================ */

#flango-logo-button {
    position: relative !important;
    overflow: visible !important;
}

#flango-logo-button .beta-ribbon {
    position: absolute !important;
    display: block !important;
    top: -2px !important;
    right: -8px !important;
    background: linear-gradient(135deg, #ff9f43 0%, #f7b731 50%, #ff9f43 100%) !important;
    color: #5d4037 !important;
    font-size: 7px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    padding: 2px 12px !important;
    border-radius: 2px !important;
    transform: rotate(35deg) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    z-index: 999 !important;
    pointer-events: none !important;
    text-transform: uppercase !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

/* Beta sticker on login screens (only on /app-beta) */
.login-container .beta-login-sticker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    /* Pull up under the logo (reduce actual layout spacing) */
    margin: -90px auto 10px !important;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #5d4037;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.6px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    width: fit-content;
    transform: rotate(-2deg);
    border: 1px solid rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

/* ============================================================
   CURRENT ORDER / CART
   ============================================================ */

#current-order {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-bottom: 2px solid #eee;
    margin-bottom: 10px;
    overflow: hidden;
}

#current-order ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-gutter: stable both-edges;
}

#current-order li {
    padding: 4px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.remove-item-btn {
    font-size: 20px;
    cursor: pointer;
    color: var(--danger-color);
    padding: 5px
}

#total-price {
    text-align: right;
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 700;
    margin: 0;
    color: var(--secondary-color);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

/* Product icon summary row */
.total-product-summary {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 16px;
}

.total-product-summary img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
}

.total-product-summary .plus-sign {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0 4px;
}

.total-product-summary .equals-sign {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-left: 8px;
}

.total-product-summary .discount-tag-icon {
    font-size: 48px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.total-text {
    white-space: nowrap;
}

/* ============================================================
   CHECKOUT & ACTIONS
   ============================================================ */

#checkout-stack {
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1vw, 8px);
    margin-top: auto;
    padding-top: clamp(4px, 1vw, 8px);
}

#bottom-buttons {
    margin-top: auto;
    padding-top: 0;
}

.action-button {
    width: 100%;
    color: #fff;
    padding: clamp(10px, 2vw, 16px);
    font-size: clamp(16px, 1.9vw, 20px);
    font-family: var(--font-body);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: clamp(6px, 1.4vw, 10px);
    transition: background-color .3s;
}

.action-button:disabled {
    background-color: #ccc;
    cursor: not-allowed
}

#settings-btn {
    background-color: var(--secondary-color)
}

#undo-last-sale-btn {
    background-color: var(--warning-color)
}

#complete-purchase {
    background-color: var(--success-color);
    padding: clamp(12px, 2.5vw, 20px);
    font-size: clamp(18px, 2.2vw, 22px);
    margin-bottom: 0;
}

#admin-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.admin-btn {
    background-color: var(--admin-color)
}

/* ============================================================
   HEADER ACTIONS
   ============================================================ */

.header-action-btn {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
}

.header-action-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.header-action-btn img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* ============================================================
   SETTINGS SECTIONS
   ============================================================ */

.settings-section:has(#print-negative-balance-btn) {
    display: block;
}

/* ============================================================
   THEMES - Pastel Pop
   ============================================================ */

body[data-theme="default"] {
    /* Default theme - no changes needed */
}

body[data-theme="pastel-pop"] {
    background: radial-gradient(circle at top, #ffe9f7 0, #ffe9f7 30%, #f7f5ff 60%, #f0fbff 100%);
    color: #4a3c5b;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="pastel-pop"] button {
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    font-weight: 600;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.13);
    transform: translateY(0);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
    background: linear-gradient(135deg, #ffd3e4, #ffe9f7);
    color: #4a3c5b;
}

body[data-theme="pastel-pop"] button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

body[data-theme="pastel-pop"] button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

body[data-theme="pastel-pop"] .settings-button {
    background: linear-gradient(135deg, #ffcfe5, #ffe6b8);
}

body[data-theme="pastel-pop"] .theme-picker-modal {
    background: #ffffff;
    border-radius: 18px;
    border: 2px solid #ffd3e4;
    box-shadow: 0 14px 35px rgba(200, 160, 220, 0.4);
}

body[data-theme="pastel-pop"] .theme-picker-modal h2 {
    color: #4a3c5b;
}

body[data-theme="pastel-pop"] .card,
body[data-theme="pastel-pop"] .panel {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    border: 1px solid rgba(255, 200, 230, 0.7);
    box-shadow: 0 10px 25px rgba(180, 150, 210, 0.25);
}

body[data-theme="pastel-pop"] .flango-cafe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 20px;
}

body[data-theme="pastel-pop"] .cafe-btn {
    background: linear-gradient(135deg, #ffe0f3, #f1e6ff);
    border: none;
    border-radius: 20px;
    padding: 16px 12px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
    color: #4a3c5b;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

body[data-theme="pastel-pop"] .cafe-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
}

body[data-theme="pastel-pop"] .cafe-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

body[data-theme="pastel-pop"] .cafe-icon {
    width: 60px;
    height: 60px;
    display: block;
}

body:not([data-theme="pastel-pop"]) .cafe-icon {
    display: none;
}

/* ============================================================
   REORDER MODE ANIMATIONS
   ============================================================ */

.reorder-mode #products .product-btn {
    --shake-distance: 1px;
    animation: shake-animation 0.55s ease-in-out infinite;
    cursor: grab;
}

.reorder-mode #products .product-btn:nth-child(3n) {
    animation-duration: 0.6s;
    animation-delay: -0.05s;
}

.reorder-mode #products .product-btn:nth-child(3n+1) {
    animation-duration: 0.56s;
    animation-delay: -0.12s;
}

.reorder-mode #products .product-btn:nth-child(3n+2) {
    animation-duration: 0.62s;
    animation-delay: -0.18s;
}

.reorder-mode #products .product-btn:active {
    cursor: grabbing;
}

/* ============================================================
   SOUND SETTINGS
   ============================================================ */

.sound-global-controls {
    width: 100%;
}

.sound-control-section {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.sound-control-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.sound-control-row {
    margin-bottom: 12px;
}

.sound-control-row:last-child {
    margin-bottom: 0;
}

.sound-control-row label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.sound-control-row input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

.sound-control-row input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #d1d5db;
    outline: none;
    cursor: pointer;
}

.sound-control-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
}

.sound-control-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

#master-volume-display {
    font-weight: 600;
    color: #3b82f6;
}

.sound-item-extended {
    border: 1px solid #e5e7eb;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
}

.sound-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sound-item-header label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.sound-item-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sound-volume-control {
    margin-top: 8px;
}

.sound-volume-control label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.sound-volume-display {
    font-weight: 600;
    color: #3b82f6;
}

.sound-volume-slider {
    width: 100%;
    height: 5px;
    border-radius: 2.5px;
    background: #d1d5db;
    outline: none;
    cursor: pointer;
}

.sound-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
}

.sound-volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    border: none;
}

/* ============================================================
   SUMMARY / OPSUMMERING
   ============================================================ */

.summary-view-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    flex-wrap: wrap;
}

.summary-view-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 8px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-view-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.summary-view-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* ============================================================
   PERIOD SEGMENTED CONTROL (Dag/Uge/Måned/År) - Flango Style
   ============================================================ */
.period-segment-control {
    display: flex;
    justify-content: center;
    padding: 6px 0 18px;
}

.segment-group {
    display: inline-flex;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 6px;
    gap: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.segment-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    position: relative;
    white-space: nowrap;
    min-width: 80px;
}

.segment-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.segment-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.segment-btn:hover:not(.active) {
    color: #475569;
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
}

.segment-btn:hover:not(.active) .segment-icon {
    transform: scale(1.1);
}

.segment-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35), 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.segment-btn.active .segment-label {
    font-weight: 700;
}

.segment-btn.active .segment-icon {
    transform: scale(1.05);
}

.segment-btn:focus {
    outline: none;
}

.segment-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Subtle animation on active state change */
.segment-btn.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.summary-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.date-input {
    padding: 10px;
    font-size: 16px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.summary-table-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    max-height: calc(90vh - 400px);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.summary-table thead {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    z-index: 10;
}

.summary-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 3px solid var(--primary-color);
    white-space: nowrap;
}

.summary-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e9ecef;
}

.summary-table tbody tr:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

.summary-table td {
    padding: 12px;
    vertical-align: top;
}

.period-day:nth-child(odd) {
    background-color: #fff3e0;
}

.period-day:nth-child(even) {
    background-color: #ffe0b2;
}

.period-week:nth-child(odd) {
    background-color: #e3f2fd;
}

.period-week:nth-child(even) {
    background-color: #bbdefb;
}

.period-month:nth-child(odd) {
    background-color: #e8f5e9;
}

.period-month:nth-child(even) {
    background-color: #c8e6c9;
}

.period-year:nth-child(odd) {
    background-color: #f3e5f5;
}

.period-year:nth-child(even) {
    background-color: #e1bee7;
}

.week-separator {
    border-top: 3px solid var(--primary-color) !important;
}

.summary-table tfoot {
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    font-weight: 700;
    z-index: 10;
}

.summary-table tfoot td {
    padding: 15px 12px;
    border-top: 3px solid var(--success-color);
}

.summary-loading,
.summary-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.summary-loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.summary-loading p {
    font-size: 18px;
    color: #6c757d;
    font-weight: 600;
}

.summary-error {
    color: var(--danger-color);
}

.summary-error p:first-child {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.summary-error p:last-child {
    font-size: 16px;
    color: #6c757d;
}

.summary-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    flex-wrap: wrap;
}

.summary-actions .action-button {
    flex: 1;
    min-width: 150px;
}

.secondary-action {
    background: #6c757d !important;
}

.secondary-action:hover {
    background: #5a6268 !important;
}

.summary-empty {
    padding: 60px 20px;
    text-align: center;
    color: #6c757d;
}

.summary-empty p {
    font-size: 18px;
    margin-bottom: 10px;
}

.summary-empty p:first-child {
    font-size: 48px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .summary-view-selector {
        flex-direction: column;
    }

    .summary-view-btn {
        width: 100%;
        min-width: unset;
    }

    .summary-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .summary-table {
        font-size: 13px;
    }

    .summary-table th,
    .summary-table td {
        padding: 8px;
    }

    .summary-actions {
        flex-direction: column;
    }
}

/* ============================================================
   FEEDBACK FORM
   ============================================================ */

.feedback-section {
    padding: 10px;
    text-align: center;
}

.feedback-prompt {
    font-size: 16px;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 15px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.sticky-note {
    background: #fffde7;
    padding: 20px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    transform: rotate(-1deg);
    transition: transform 0.15s ease;
    margin: 10px auto;
    max-width: 360px;
}

.sticky-note:hover {
    transform: rotate(0deg) scale(1.02);
}

/* ============================================================
   MEDIA QUERIES
   ============================================================ */

@media (max-width:800px) {
    body {
        overflow: auto;
        height: auto
    }

    #main-app {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        padding: 10px;
        gap: 10px
    }

    #sidebar {
        min-height: 400px
    }
}

/* ============================================================
   UPDATE CHIP - Version notification
   ============================================================ */

.flango-update-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    animation: update-pulse 2s ease-in-out infinite;
}

.flango-update-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.flango-update-chip:active {
    transform: translateY(0);
}

.update-chip-icon {
    font-size: 16px;
    animation: update-spin 3s linear infinite;
}

@keyframes update-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 2px 16px rgba(16, 185, 129, 0.5);
    }
}

@keyframes update-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Version Info Panel (Settings) */
.version-info-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.version-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.version-info-row:last-of-type {
    border-bottom: none;
}

.version-label {
    font-size: 14px;
    color: #64748b;
}

.version-value {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.version-value.status-ok {
    color: #10b981;
}

.version-value.status-update {
    color: #f59e0b;
}

.version-value.status-warning {
    color: #ef4444;
}

.version-refresh-btn,
.version-check-btn {
    width: 100%;
    padding: 12px 16px;
    margin-top: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.version-refresh-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.version-refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.version-refresh-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.version-check-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.version-check-btn:hover {
    background: #e2e8f0;
}

.version-check-btn:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* User session banner med chip */
#user-session-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================================
   SHIFT TIMER - Bytte-timer for ekspedient-skift
   FLIP-CLOCK STYLE - Visuelt tiltalende og klikbart
   ============================================================ */

/* Timer-pille i header - INAKTIV STATE */
.shift-timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shift-timer-pill:hover {
    background: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #94a3b8;
}

.shift-timer-pill:active {
    transform: translateY(0);
}

/* Inaktiv pille styling */
.pill-add-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
}

.pill-add-text {
    color: #475569;
}

/* Timer-pille - AKTIV STATE med flip-clock */
.shift-timer-pill.shift-timer-active {
    padding: 6px 12px;
    background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
    border-color: #475569;
    color: white;
    box-shadow: 0 4px 16px rgba(30, 41, 59, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.shift-timer-pill.shift-timer-active:hover {
    background: linear-gradient(145deg, #334155 0%, #475569 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 41, 59, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Flip-clock display container */
.flip-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.flip-icon {
    font-size: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.flip-digits {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Flip digit unit (wrapper) */
.flip-unit {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

/* Flip card - the actual digit display */
.flip-card {
    position: relative;
    width: 10px;
    height: 10px;
    perspective: 200px;
}

.flip-card-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Middle split line effect */
.flip-card-inner::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0, 0, 0, 0.3);
}

.flip-digit {
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.5px;
}

/* Colon separator */
.flip-colon {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #60a5fa;
    margin: 0 1px;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
    animation: colon-blink 1s ease-in-out infinite;
}

@keyframes colon-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Slash separator for sales */
.flip-slash {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #94a3b8;
    margin: 0 2px;
}

/* Separator between time and sales */
.flip-separator {
    color: #64748b;
    font-size: 10px;
    margin: 0 8px;
}

/* ============================================================
   CONFIGURATION MODAL
   ============================================================ */

.shift-timer-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: modal-fade-in 0.2s ease;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shift-timer-modal {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 28px;
    border-radius: 20px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: modal-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.shift-timer-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 24px 0;
    text-align: center;
}

.shift-timer-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.shift-timer-section-last {
    border-bottom: none;
    margin-bottom: 24px;
    padding-bottom: 0;
}

/* Toggle switch styling */
.shift-timer-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    margin-bottom: 12px;
    position: relative;
}

.shift-timer-toggle-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shift-timer-toggle-row input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.shift-timer-toggle-row input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-text {
    font-weight: 600;
}

.shift-timer-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 56px;
    transition: all 0.2s ease;
}

.shift-timer-input-row input[type="number"] {
    width: 80px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.shift-timer-input-row input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.shift-timer-input-row span {
    font-size: 15px;
    color: #64748b;
    font-weight: 500;
}

.shift-timer-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
}

.shift-timer-text-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.shift-timer-text-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.shift-timer-text-input::placeholder {
    color: #94a3b8;
}

/* Modal action buttons */
.shift-timer-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.shift-timer-btn {
    flex: 1;
    min-width: 90px;
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shift-timer-btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.shift-timer-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.shift-timer-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.shift-timer-btn.secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.shift-timer-btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.shift-timer-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* ============================================================
   BLOCKING SWAP POPUP - Centreret modal
   ============================================================ */

.shift-swap-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: swap-fade-in 0.3s ease;
}

@keyframes swap-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shift-swap-popup {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    padding: 40px 36px;
    border-radius: 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: swap-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes swap-bounce {
    0% { transform: scale(0.7) translateY(30px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Animated icon container */
.shift-swap-icon-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.shift-swap-icon-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 50%;
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0.3; }
}

.shift-swap-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    animation: icon-spin 3s ease-in-out infinite;
}

@keyframes icon-spin {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.shift-swap-title {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

.shift-swap-reason {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 8px 16px;
    border-radius: 20px;
    margin: 0 0 16px 0;
    border: 1px solid #fcd34d;
}

.shift-swap-text {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.shift-swap-next {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 16px 20px;
    border-radius: 14px;
    margin: 0 0 24px 0;
    border: 2px solid #93c5fd;
}

.shift-swap-next .next-label {
    font-size: 13px;
    color: #3b82f6;
    font-weight: 600;
}

.shift-swap-next .next-name {
    font-size: 22px;
    font-weight: 800;
    color: #1e40af;
}

.shift-swap-actions {
    display: flex;
    gap: 14px;
}

.shift-swap-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shift-swap-btn .btn-icon {
    font-size: 20px;
}

.shift-swap-btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.shift-swap-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

.shift-swap-btn.primary:active {
    transform: translateY(-1px);
}

.shift-swap-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.shift-swap-btn.secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* ============================================================
   DB-HISTORIK MODAL
   ============================================================ */

#db-history-modal .modal-content {
    max-width: 600px;
    height: auto;
    max-height: 85vh;
}

.db-history-metrics {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

.db-history-metric {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.db-history-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    color: #334155;
}

.db-history-metric-values {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    color: #64748b;
}

.db-history-metric-used {
    font-weight: 700;
    font-size: 18px;
    color: #1e293b;
}

.db-history-metric-limit {
    color: #64748b;
}

.db-history-progress-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.db-history-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.db-history-progress-bar.low {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.db-history-progress-bar.medium {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.db-history-progress-bar.high {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.db-history-metric-note {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 4px;
}

.db-history-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

.db-history-refresh-btn {
    padding: 8px 16px;
    background: var(--primary-color, #4682b4);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.db-history-refresh-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ============================================================
   PURCHASE PROFILES (KØBSPROFILER) - 3D Cylinder Chart
   ============================================================ */

.purchase-profiles-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    padding: 10px;
    gap: 12px;
}

/* Compact Top Bar */
.purchase-profiles-top-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.purchase-profiles-user-select-wrapper {
    flex: 0 1 auto;
    min-width: 200px;
}

.purchase-profiles-user-select {
    width: 100%;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.purchase-profiles-user-select:hover {
    border-color: var(--primary-color);
}

.purchase-profiles-user-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.purchase-profiles-period-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.purchase-profiles-period-wrapper label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.purchase-profiles-period-select {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.purchase-profiles-period-select:hover {
    border-color: var(--primary-color);
}

.purchase-profiles-total-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.purchase-profiles-total-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.purchase-profiles-total-amount {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
}

/* Chart Section */
.purchase-profiles-chart-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

/* Chart Header with Sort Toggle */
.purchase-profiles-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.purchase-profiles-chart-header h4 {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.purchase-profiles-sort-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.purchase-profiles-sort-btn {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.purchase-profiles-sort-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.purchase-profiles-sort-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ====== THE 3D CYLINDER CHART ====== */
.purchase-profiles-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    padding: 40px 30px 100px; /* Extra bottom padding for labels */
    min-height: 380px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: visible;
}

.purchase-profiles-loading,
.purchase-profiles-error {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 16px;
}

.purchase-profiles-error {
    color: #ef4444;
}

/* Bar Wrapper - contains value, cylinder, icon, and name */
.purchase-profiles-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 55px;
    max-width: 80px;
    flex: 1;
}

/* Value label above cylinder */
.purchase-profiles-bar-value {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    white-space: nowrap;
}

/* ====== 3D CYLINDER STYLING ====== */
.purchase-profiles-bar {
    position: relative;
    width: 44px;
    height: 0;
    border-radius: 22px 22px 6px 6px;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

/* Animated state */
.purchase-profiles-bar.animate-in {
    height: var(--final-height, 100px);
}

/* Cylinder top ellipse (3D cap) */
.purchase-profiles-bar::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    width: 44px;
    height: 16px;
    border-radius: 50%;
    z-index: 3;
}

/* Cylinder shadow at bottom */
.purchase-profiles-bar::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 6px;
    width: 32px;
    height: 8px;
    background: rgba(0,0,0,0.15);
    border-radius: 50%;
    filter: blur(4px);
    z-index: -1;
}

/* === CYLINDER COLORS (Hardcoded gradients for browser compatibility) === */

/* Bar 1: Cyan/Teal */
.purchase-profiles-bar-wrapper:nth-child(1) .purchase-profiles-bar {
    background: linear-gradient(90deg, #00838f 0%, #00bcd4 35%, #4dd0e1 50%, #00bcd4 65%, #00838f 100%);
    box-shadow: 4px 0 0 #006064, 0 8px 20px rgba(0,188,212,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(1) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #80deea 0%, #26c6da 100%);
}

/* Bar 2: Blue */
.purchase-profiles-bar-wrapper:nth-child(2) .purchase-profiles-bar {
    background: linear-gradient(90deg, #1565c0 0%, #2196f3 35%, #64b5f6 50%, #2196f3 65%, #1565c0 100%);
    box-shadow: 4px 0 0 #0d47a1, 0 8px 20px rgba(33,150,243,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(2) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #90caf9 0%, #42a5f5 100%);
}

/* Bar 3: Gold/Yellow */
.purchase-profiles-bar-wrapper:nth-child(3) .purchase-profiles-bar {
    background: linear-gradient(90deg, #f9a825 0%, #ffc107 35%, #ffeb3b 50%, #ffc107 65%, #f9a825 100%);
    box-shadow: 4px 0 0 #f57f17, 0 8px 20px rgba(255,193,7,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(3) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #fff59d 0%, #ffca28 100%);
}

/* Bar 4: Pink/Rose */
.purchase-profiles-bar-wrapper:nth-child(4) .purchase-profiles-bar {
    background: linear-gradient(90deg, #c2185b 0%, #e91e63 35%, #f06292 50%, #e91e63 65%, #c2185b 100%);
    box-shadow: 4px 0 0 #880e4f, 0 8px 20px rgba(233,30,99,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(4) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #f8bbd9 0%, #ec407a 100%);
}

/* Bar 5: Purple */
.purchase-profiles-bar-wrapper:nth-child(5) .purchase-profiles-bar {
    background: linear-gradient(90deg, #6a1b9a 0%, #9c27b0 35%, #ba68c8 50%, #9c27b0 65%, #6a1b9a 100%);
    box-shadow: 4px 0 0 #4a148c, 0 8px 20px rgba(156,39,176,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(5) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #ce93d8 0%, #ab47bc 100%);
}

/* Bar 6: Deep Purple/Indigo */
.purchase-profiles-bar-wrapper:nth-child(6) .purchase-profiles-bar {
    background: linear-gradient(90deg, #512da8 0%, #673ab7 35%, #9575cd 50%, #673ab7 65%, #512da8 100%);
    box-shadow: 4px 0 0 #311b92, 0 8px 20px rgba(103,58,183,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(6) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #b39ddb 0%, #7e57c2 100%);
}

/* Bar 7: Teal/Green */
.purchase-profiles-bar-wrapper:nth-child(7) .purchase-profiles-bar {
    background: linear-gradient(90deg, #00796b 0%, #009688 35%, #4db6ac 50%, #009688 65%, #00796b 100%);
    box-shadow: 4px 0 0 #004d40, 0 8px 20px rgba(0,150,136,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(7) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #80cbc4 0%, #26a69a 100%);
}

/* Bar 8: Light Blue */
.purchase-profiles-bar-wrapper:nth-child(8) .purchase-profiles-bar {
    background: linear-gradient(90deg, #0277bd 0%, #03a9f4 35%, #4fc3f7 50%, #03a9f4 65%, #0277bd 100%);
    box-shadow: 4px 0 0 #01579b, 0 8px 20px rgba(3,169,244,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(8) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #81d4fa 0%, #29b6f6 100%);
}

/* Bar 9: Amber/Orange */
.purchase-profiles-bar-wrapper:nth-child(9) .purchase-profiles-bar {
    background: linear-gradient(90deg, #ef6c00 0%, #ff9800 35%, #ffb74d 50%, #ff9800 65%, #ef6c00 100%);
    box-shadow: 4px 0 0 #e65100, 0 8px 20px rgba(255,152,0,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(9) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #ffcc80 0%, #ffa726 100%);
}

/* Bar 10: Red/Coral */
.purchase-profiles-bar-wrapper:nth-child(10) .purchase-profiles-bar {
    background: linear-gradient(90deg, #c62828 0%, #f44336 35%, #e57373 50%, #f44336 65%, #c62828 100%);
    box-shadow: 4px 0 0 #b71c1c, 0 8px 20px rgba(244,67,54,0.3);
}
.purchase-profiles-bar-wrapper:nth-child(10) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #ef9a9a 0%, #ef5350 100%);
}

/* Bar 11: Grey (Andre varer) */
.purchase-profiles-bar-wrapper:nth-child(11) .purchase-profiles-bar {
    background: linear-gradient(90deg, #546e7a 0%, #78909c 35%, #b0bec5 50%, #78909c 65%, #546e7a 100%);
    box-shadow: 4px 0 0 #37474f, 0 8px 20px rgba(120,144,156,0.3);
    cursor: pointer;
}
.purchase-profiles-bar-wrapper:nth-child(11) .purchase-profiles-bar::before {
    background: linear-gradient(180deg, #cfd8dc 0%, #90a4ae 100%);
}
.purchase-profiles-bar-wrapper:nth-child(11) .purchase-profiles-bar:hover {
    transform: scale(1.05);
}

/* Icon container below cylinder */
.purchase-profiles-bar-icon {
    margin-top: 12px;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.purchase-profiles-bar-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.purchase-profiles-bar-icon span {
    font-size: 22px;
    line-height: 1;
}

/* Product name below icon */
.purchase-profiles-bar-name {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tooltip */
.purchase-profiles-bar-tooltip {
    position: absolute;
    bottom: calc(100% + 20px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.purchase-profiles-bar:hover .purchase-profiles-bar-tooltip {
    opacity: 1;
    visibility: visible;
}

.purchase-profiles-bar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #1e293b;
}

/* Empty state */
.purchase-profiles-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 250px;
}

.purchase-profiles-empty p {
    font-size: 15px;
    color: #94a3b8;
    text-align: center;
    padding: 30px 40px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

/* Andre Varer Modal */
#andre-varer-modal .modal-content {
    max-width: 480px;
}

.andre-varer-list {
    padding: 16px;
    max-height: 50vh;
    overflow-y: auto;
}

.andre-varer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.andre-varer-item:last-child {
    border-bottom: none;
}

.andre-varer-item-name {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.andre-varer-item-antal {
    font-size: 14px;
    color: #64748b;
    white-space: nowrap;
}

.andre-varer-item-kr {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

/* Responsive */
@media (max-width: 900px) {
    .purchase-profiles-chart {
        gap: 12px;
        padding: 30px 15px 90px;
    }
    .purchase-profiles-bar-wrapper {
        min-width: 45px;
    }
    .purchase-profiles-bar {
        width: 36px;
        border-radius: 18px 18px 5px 5px;
    }
    .purchase-profiles-bar::before {
        width: 36px;
        height: 14px;
        top: -6px;
    }
    .purchase-profiles-bar-value {
        font-size: 12px;
    }
    .purchase-profiles-bar-name {
        font-size: 10px;
        max-width: 50px;
    }
    .purchase-profiles-bar-icon {
        width: 30px;
        height: 30px;
    }
    .purchase-profiles-bar-icon span {
        font-size: 18px;
    }
}

/* ============================================================
   STATISTICS VIEW (Admin Only) - Clean Table Design
   ============================================================ */

/* Admin-only view button styling */
.summary-view-btn.admin-only-view {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
}

.summary-view-btn.admin-only-view:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.summary-view-btn.admin-only-view.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ============================================================
   STATISTICS VIEW - 3-Mode Statistics (Kunder, Ekspedienter, Personale)
   Styled to match Produktoversigt table exactly
   ============================================================ */

/* Parent Container - must have defined height for scroll to work */
#statistics-view-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Statistics View Container */
.statistics-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

/* Controls Row - compact horizontal layout */
.stat-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

/* Mode Buttons - simple pill buttons */
.stat-mode-buttons {
    display: flex;
    gap: 6px;
}

.stat-mode-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    color: #333;
    transition: all 0.15s ease;
}

.stat-mode-btn:hover {
    border-color: #999;
    background: #f5f5f5;
}

.stat-mode-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Period Group */
.stat-period-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.stat-period-group select {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

/* Toggle Pills - compact */
.stat-toggles {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.stat-toggle-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    color: #666;
    user-select: none;
    transition: all 0.15s ease;
}

.stat-toggle-pill:hover {
    border-color: #999;
}

.stat-toggle-pill.active {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.stat-toggle-pill.active.children {
    background: #ec4899;
    border-color: #ec4899;
}

.stat-toggle-pill.active.staff {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.stat-toggle-pill .toggle-icon {
    font-size: 12px;
}

/* Info Row - like Produktoversigt subtitle */
.stat-info-row {
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #6366f1;
}

/* Table Container - scrollable (matching other views like Produktoversigt) */
.statistics-table-container {
    flex: 1;
    min-height: 0; /* Critical for flexbox scroll to work */
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.statistics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.statistics-header-row {
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.statistics-header-cell {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 2;
}

.statistics-header-cell.sortable {
    cursor: pointer;
}

.statistics-sort-indicator {
    margin-left: 4px;
    opacity: 0.4;
    color: #666;
}

.statistics-sort-indicator.active {
    opacity: 1;
    color: #6366f1;
}

.statistics-body .statistics-row {
    border-bottom: 1px solid #eee;
}

.statistics-body .statistics-row:nth-child(even) {
    background: #fafafa;
}

.statistics-body .statistics-row:hover {
    background: #f0f7ff;
}

.statistics-body .statistics-row.clickable {
    cursor: pointer;
}

.statistics-cell {
    padding: 8px;
    vertical-align: middle;
}

.statistics-total-row .statistics-cell {
    background: #f5f5f5;
    border-top: 2px solid #ddd;
    font-weight: 700;
    position: sticky;
    bottom: 0;
    z-index: 1;
}

.statistics-total-label {
    color: #333;
}

/* Cell Formatting */
.stat-name {
    font-weight: 600;
    color: #1a1a1a;
}

.stat-amount {
    font-weight: 600;
    color: #2e7d32;
    font-variant-numeric: tabular-nums;
}

.stat-amount.negative {
    color: #c62828;
}

.stat-number {
    font-weight: 500;
    color: #333;
    font-variant-numeric: tabular-nums;
}

.stat-time {
    font-weight: 500;
    color: #5c6bc0;
    font-variant-numeric: tabular-nums;
}

.stat-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-badge-child {
    background: #fce4ec;
    color: #c2185b;
}

.stat-badge-admin {
    background: #ede7f6;
    color: #7b1fa2;
}

.stat-level {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-stars {
    font-size: 14px;
}

.stat-level-name {
    font-size: 12px;
    color: #666;
}

.stat-empty {
    color: #999;
    font-style: italic;
}

/* Loading State - simple text */
.statistics-loading {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-controls-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .stat-toggles {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .stat-mode-buttons {
        flex-wrap: wrap;
    }
}
