/* ============================================
   JJ Lager System - Frontend Styles
   Version 2.3 - Exact match to JJ Brugersystem
   ============================================ */

/* ===== CSS VARIABLES ===== */
:root {
    --jj-primary: #4CAF50;
    --jj-primary-dark: #43A047;
    --jj-primary-light: #C8E6C9;
    --jj-primary-bg: #E8F5E9;
    --jj-text-dark: #1f2937;
    --jj-text-gray: #6b7280;
    --jj-border: #e5e7eb;
    --jj-bg-light: #f8fafc;
    --jj-white: #ffffff;
    --jj-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --jj-radius: 8px;
}

/* ===== GLOBAL RESET ===== */
.jj-bruger-admin-wrapper *,
.jj-wizard-wrapper *,
.jj-table-wrapper *,
.arbejdstoj-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== MAIN WRAPPER - Matches Brugersystem ===== */
.jj-bruger-admin-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--jj-text-dark);
    line-height: 1.5;
    text-align: left;
}

/* ===== PAGE HEADER ===== */
.jj-admin-header {
    margin-bottom: 24px;
    text-align: left;
}

.jj-admin-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--jj-text-dark);
    margin: 0 0 4px 0;
    text-align: left;
}

.jj-admin-header p {
    font-size: 0.9rem;
    color: var(--jj-text-gray);
    margin: 0;
    text-align: left;
}

/* ===== CARD CONTAINER ===== */
.jj-admin-card {
    background: var(--jj-white);
    border-radius: var(--jj-radius);
    box-shadow: var(--jj-shadow);
    overflow: hidden;
}

/* ===== TOOLBAR WITH SEARCH & FILTERS ===== */
.jj-admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: var(--jj-white);
    border-bottom: 1px solid var(--jj-border);
    align-items: center;
}

/* Search wrapper */
.jj-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 500px;
}

.jj-search-wrapper .jj-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--jj-text-gray);
    pointer-events: none;
}

.jj-search-wrapper input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--jj-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.jj-search-wrapper input:focus {
    border-color: var(--jj-primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.jj-search-wrapper input::placeholder {
    color: #9ca3af;
}

/* Filter dropdowns */
.jj-filter-wrapper {
    position: relative;
}

.jj-filter-select {
    padding: 10px 32px 10px 12px;
    border: 1px solid var(--jj-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--jj-white);
    cursor: pointer;
    outline: none;
    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='%236b7280' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 150px;
}

.jj-filter-select:focus {
    border-color: var(--jj-primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* ===== DATA TABLE - Exact match to Brugersystem ===== */
.jj-user-table {
    width: 100%;
    border-collapse: collapse;
}

.jj-user-table thead {
    background: var(--jj-primary);
}

.jj-user-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.jj-user-table tbody tr {
    border-bottom: 1px solid var(--jj-border);
    transition: background 0.15s;
}

.jj-user-table tbody tr:hover {
    background: var(--jj-bg-light);
}

.jj-user-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--jj-text-dark);
    vertical-align: middle;
}

/* Status badges */
.jj-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.jj-status-aktiv {
    background: var(--jj-primary-light);
    color: #1B5E20;
}

.jj-status-inaktiv {
    background: #fee2e2;
    color: #991b1b;
}

/* Action buttons */
.jj-actions {
    display: flex;
    gap: 8px;
}

.jj-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.jj-icon-btn:hover {
    background: var(--jj-bg-light);
}

/* ===== MESSAGES ===== */
.jj-message {
    padding: 12px 16px;
    margin: 16px 20px;
    border-radius: 6px;
    font-size: 14px;
}

.jj-message-success {
    background: var(--jj-primary-bg);
    color: #1B5E20;
    border-left: 4px solid var(--jj-primary);
}

.jj-message-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.jj-message-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* ===== WIZARD SPECIFIC STYLES ===== */

/* Section header with step number */
.jj-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.jj-step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--jj-primary);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.jj-section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--jj-text-dark);
    margin: 0;
}

/* Mode cards (Udlån/Aflevering) */
.jj-mode-cards {
    display: flex;
    gap: 12px;
}

.jj-mode-card {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--jj-border);
    border-radius: 8px;
    background: var(--jj-white);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-family: inherit;
}

.jj-mode-card:hover {
    border-color: var(--jj-primary-light);
    background: var(--jj-primary-bg);
}

.jj-mode-card.is-active {
    border-color: var(--jj-primary);
    background: var(--jj-primary-bg);
}

.jj-mode-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.jj-mode-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--jj-text-dark);
    display: block;
    margin-bottom: 4px;
}

.jj-mode-desc {
    font-size: 12px;
    color: var(--jj-text-gray);
    display: block;
}

/* ===== PRODUCT GRID ===== */
.jj-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.jj-product-card {
    background: var(--jj-white);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: none;
}

.jj-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.jj-product-card.in-cart {
    box-shadow: 0 0 0 3px var(--jj-primary), 0 8px 24px rgba(76, 175, 80, 0.15);
}

.jj-product-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f5f5f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
}

.jj-product-image.jj-no-image {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.jj-product-image.jj-no-image span {
    font-size: 48px;
    opacity: 0.4;
}

.jj-product-info {
    padding: 16px 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 0;
}

.jj-product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--jj-text-dark);
    margin: 0 0 4px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.jj-product-meta {
    font-size: 13px;
    color: var(--jj-text-gray);
    margin-bottom: 12px;
}

.jj-product-company {
    display: block;
}

.jj-product-size {
    display: inline;
    font-size: 12px;
    color: #9ca3af;
}

.jj-product-size::before {
    content: " · ";
}

.jj-product-stock {
    margin-top: auto;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    background: rgba(76, 175, 80, 0.12);
    color: var(--jj-primary);
}

.jj-product-stock.jj-stock-low {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.jj-product-stock.jj-stock-empty {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.jj-product-loaned {
    margin-top: auto;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.jj-product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 16px;
    background: transparent;
    border-top: none;
}

.jj-qty-controls {
    display: flex;
    align-items: center;
    gap: 0;
}

.jj-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
    color: #9ca3af;
}

.jj-qty-btn:hover {
    color: var(--jj-text-dark);
}

.jj-qty-minus {
    background: transparent;
    color: #9ca3af;
}

.jj-qty-minus:hover {
    color: #6b7280;
}

.jj-qty-plus {
    background: transparent;
    color: #9ca3af;
}

.jj-qty-plus:hover {
    color: #6b7280;
}

.jj-qty-input {
    width: 40px;
    text-align: center;
    border: none;
    border-radius: 0;
    padding: 4px 0;
    font-size: 16px;
    font-family: inherit;
    font-weight: 500;
    color: var(--jj-text-dark);
    background: transparent;
}

.jj-qty-input:focus {
    outline: none;
    border-color: transparent;
}

/* Hide number input spinners */
.jj-qty-input::-webkit-outer-spin-button,
.jj-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.jj-qty-input[type=number] {
    -moz-appearance: textfield;
}

.jj-add-to-cart-btn {
    padding: 10px 20px;
    background: var(--jj-primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.jj-add-to-cart-btn:hover {
    background: var(--jj-primary-dark);
    transform: scale(1.02);
}

.jj-add-to-cart-btn:active {
    transform: scale(0.98);
}

.jj-product-card.in-cart .jj-add-to-cart-btn {
    background: #1B5E20;
}

/* ===== CART SIDEBAR ===== */
.jj-products-layout {
    display: flex;
    gap: 20px;
}

.jj-products-main {
    flex: 1;
}

.jj-cart-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.jj-cart-panel {
    background: var(--jj-white);
    border: 1px solid var(--jj-border);
    border-radius: 8px;
    position: sticky;
    top: 20px;
}

.jj-cart-header {
    padding: 14px 16px;
    background: var(--jj-primary);
    color: white;
    border-radius: 8px 8px 0 0;
}

.jj-cart-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.jj-cart-summary {
    padding: 12px 16px;
    border-bottom: 1px solid var(--jj-border);
    font-size: 13px;
}

.jj-cart-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.jj-cart-row:last-child {
    margin-bottom: 0;
}

.jj-cart-label {
    color: var(--jj-text-gray);
}

.jj-cart-value {
    font-weight: 500;
    color: var(--jj-text-dark);
}

.jj-cart-items {
    padding: 12px 16px;
    max-height: 200px;
    overflow-y: auto;
    border-bottom: 1px solid var(--jj-border);
}

.jj-cart-empty {
    color: var(--jj-text-gray);
    font-size: 13px;
    text-align: center;
    padding: 16px 0;
}

.jj-cart-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--jj-border);
}

.jj-cart-item:last-child {
    border-bottom: none;
}

.jj-cart-item-qty {
    color: var(--jj-primary);
    font-weight: 600;
    min-width: 24px;
}

.jj-cart-item-name {
    flex: 1;
    color: var(--jj-text-dark);
}

.jj-cart-total {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--jj-border);
}

.jj-submit-btn {
    width: 100%;
    padding: 14px;
    margin: 16px;
    width: calc(100% - 32px);
    background: var(--jj-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    transition: background 0.2s;
}

.jj-submit-btn:hover:not(:disabled) {
    background: var(--jj-primary-dark);
}

.jj-submit-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* ===== MEDARBEJDER OVERSIGT - Card style like Brugersystem ===== */
.jj-medarbejder-card {
    background: var(--jj-white);
    border: 1px solid var(--jj-border);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.jj-medarbejder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--jj-border);
}

.jj-medarbejder-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--jj-text-dark);
    margin: 0;
}

.jj-medarbejder-company {
    font-size: 13px;
    color: var(--jj-text-gray);
    margin: 4px 0 0 0;
}

.jj-udlaan-badge {
    background: var(--jj-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.jj-medarbejder-items {
    padding: 16px 20px;
}

.jj-item-category {
    margin-bottom: 16px;
}

.jj-item-category:last-child {
    margin-bottom: 0;
}

.jj-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--jj-text-dark);
    margin-bottom: 10px;
}

.jj-item-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jj-item-tag {
    background: var(--jj-bg-light);
    border: 1px solid var(--jj-border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.jj-item-tag-qty {
    color: var(--jj-primary);
    font-weight: 600;
}

.jj-item-tag-name {
    color: var(--jj-text-dark);
}

.jj-item-tag-size {
    color: var(--jj-text-gray);
    font-size: 12px;
}

/* ===== MINE UDLÅN ===== */
.jj-mine-udlaan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.jj-udlaan-card {
    background: var(--jj-white);
    border: 1px solid var(--jj-border);
    border-radius: 8px;
    overflow: hidden;
}

.jj-udlaan-card-image {
    height: 100px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff;
}

.jj-udlaan-card-body {
    padding: 16px;
}

.jj-udlaan-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--jj-text-dark);
    margin: 0 0 8px 0;
}

.jj-udlaan-card-meta {
    font-size: 12px;
    color: var(--jj-text-gray);
}

/* ===== RESPONSIVE ===== */

/* ============================================
   TABLET OPTIMIZATION - 1280x800 (Lenovo Tablets)
   ============================================ */
@media (min-width: 769px) and (max-width: 1366px) {
    /* Wrapper adjustments for tablet */
    .jj-bruger-admin-wrapper,
    .arbejdstoj-wrapper,
    .jj-table-wrapper,
    .jj-wizard-wrapper,
    .jj-mine-udlaan {
        padding: 24px 16px;
        max-width: 100%;
    }
    
    /* Header adjustments */
    .jj-admin-header {
        margin-bottom: 20px;
    }
    
    .jj-admin-header h1 {
        font-size: 1.35rem;
    }
    
    .jj-admin-header p {
        font-size: 0.85rem;
    }
    
    /* Toolbar optimization - stack on smaller tablets */
    .jj-admin-toolbar {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .jj-search-wrapper {
        min-width: 180px;
        max-width: 280px;
    }
    
    .jj-search-wrapper input {
        padding: 12px 12px 12px 38px;
        font-size: 15px;
    }
    
    .jj-filter-select {
        padding: 12px 36px 12px 14px;
        font-size: 15px;
        min-width: 140px;
    }
    
    /* Product grid for tablet - 3 columns */
    .jj-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .jj-product-card {
        border-radius: 14px;
    }
    
    .jj-product-image {
        height: 130px;
        border-radius: 14px 14px 0 0;
    }
    
    .jj-product-info {
        padding: 14px 14px 10px;
    }
    
    .jj-product-name {
        font-size: 14px;
    }
    
    .jj-product-meta {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .jj-product-stock {
        padding: 6px 18px;
        font-size: 13px;
    }
    
    .jj-product-actions {
        padding: 10px 14px 14px;
        gap: 10px;
    }
    
    /* Touch-friendly quantity controls */
    .jj-qty-btn {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    
    .jj-qty-input {
        width: 50px;
        font-size: 17px;
        padding: 8px 0;
    }
    
    .jj-add-to-cart-btn {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    /* Layout with sidebar */
    .jj-products-layout {
        gap: 16px;
    }
    
    .jj-cart-sidebar {
        width: 260px;
    }
    
    .jj-cart-panel {
        top: 16px;
    }
    
    .jj-cart-header {
        padding: 12px 14px;
    }
    
    .jj-cart-header h3 {
        font-size: 13px;
    }
    
    .jj-cart-items {
        padding: 10px 14px;
        max-height: 180px;
    }
    
    .jj-submit-btn {
        padding: 14px;
        margin: 14px;
        width: calc(100% - 28px);
        font-size: 14px;
    }
    
    /* Mode cards for tablet */
    .jj-mode-cards {
        gap: 10px;
    }
    
    .jj-mode-card {
        padding: 14px 12px;
    }
    
    .jj-mode-icon {
        font-size: 22px;
    }
    
    .jj-mode-title {
        font-size: 13px;
    }
    
    .jj-mode-desc {
        font-size: 11px;
    }
    
    /* Step numbers */
    .jj-step-number {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    
    .jj-section-header h2 {
        font-size: 1rem;
    }
    
    /* Table adjustments */
    .jj-user-table th {
        padding: 12px 14px;
        font-size: 11px;
    }
    
    .jj-user-table td {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    /* Status badges */
    .jj-status {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    /* Icon buttons - larger for touch */
    .jj-icon-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Cards adjustments */
    .jj-admin-card {
        border-radius: 10px;
    }
    
    /* Medarbejder cards */
    .jj-medarbejder-header {
        padding: 14px 16px;
    }
    
    .jj-medarbejder-name {
        font-size: 16px;
    }
    
    .jj-medarbejder-items {
        padding: 14px 16px;
    }
    
    /* Mine udlån grid */
    .jj-mine-udlaan-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 14px;
    }
    
    /* Low stock section */
    .jj-low-stock-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
        padding: 16px;
    }
    
    .jj-low-stock-card {
        padding: 14px;
    }
    
    .jj-low-stock-name {
        font-size: 14px;
    }
    
    .jj-low-stock-header {
        padding: 14px 16px;
    }
    
    .jj-low-stock-icon {
        font-size: 28px;
    }
    
    .jj-low-stock-title h2 {
        font-size: 1rem;
    }
    
    /* Messages */
    .jj-message {
        padding: 10px 14px;
        margin: 14px 16px;
        font-size: 13px;
    }
    
    /* Modal optimizations for tablet */
    .jj-modal {
        padding: 16px;
    }
    
    .jj-modal-content {
        max-width: 90%;
        max-height: 85vh;
    }
    
    .jj-modal-large {
        max-width: 95%;
    }
    
    .jj-modal-header {
        padding: 16px 20px;
    }
    
    .jj-modal-header h2 {
        font-size: 1.15rem;
    }
    
    .jj-modal-close {
        width: 40px;
        height: 40px;
        font-size: 26px;
    }
    
    .jj-modal-body {
        padding: 20px;
    }
    
    .jj-modal-footer {
        padding: 16px 20px;
        gap: 10px;
    }
    
    /* Form optimizations for tablet */
    .jj-form-grid {
        gap: 14px;
        padding: 20px;
    }
    
    .jj-form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .jj-form-control {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    /* Touch-friendly buttons */
    .jj-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .jj-btn-primary,
    .jj-btn-secondary,
    .jj-btn-danger {
        min-height: 44px;
    }
    
    /* Action buttons - larger touch targets */
    .jj-action-btn {
        padding: 10px 14px;
        min-height: 40px;
    }
    
    .jj-btn-edit,
    .jj-btn-stock,
    .jj-btn-delete {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Birthday widget */
    .jj-birthday-item {
        padding: 14px;
        gap: 14px;
    }
    
    .jj-birthday-icon {
        font-size: 26px;
    }
    
    /* ============================================
       LAGERSTYRING TABLE - Tablet Optimization
       ============================================ */
    
    /* Make table scrollable horizontally if needed */
    #jj-lagerstyring .jj-admin-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Compact table for tablet */
    #jj-lagerstyring .jj-user-table th {
        padding: 10px 8px;
        font-size: 10px;
        white-space: nowrap;
    }
    
    #jj-lagerstyring .jj-user-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    /* Smaller image thumbnails */
    #jj-lagerstyring .jj-table-image {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    /* Compact action buttons */
    #jj-lagerstyring .jj-actions {
        gap: 4px;
        flex-wrap: nowrap;
    }
    
    #jj-lagerstyring .jj-action-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 36px;
        white-space: nowrap;
    }
    
    /* Hide some columns on smaller tablets */
    #jj-lagerstyring .jj-user-table th:nth-child(4),
    #jj-lagerstyring .jj-user-table td:nth-child(4) {
        /* Virksomhed column - hide on smaller tablets */
    }
    
    /* Stock badge compact */
    #jj-lagerstyring .jj-status {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    /* Stats row for tablet */
    #jj-lagerstyring .jj-stats-row {
        gap: 10px;
        margin-bottom: 16px;
    }
    
    #jj-lagerstyring .jj-stat-card {
        padding: 14px 16px;
        min-width: 100px;
    }
    
    #jj-lagerstyring .jj-stat-number {
        font-size: 1.5rem;
    }
    
    #jj-lagerstyring .jj-stat-label {
        font-size: 11px;
    }
    
    /* Toolbar compact */
    #jj-lagerstyring .jj-admin-toolbar {
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    #jj-lagerstyring .jj-search-wrapper input {
        padding: 10px 10px 10px 34px;
        font-size: 14px;
    }
    
    #jj-lagerstyring .jj-filter-select {
        padding: 10px 30px 10px 10px;
        font-size: 13px;
        min-width: 120px;
    }
    
    /* Add product button */
    #jj-lagerstyring .jj-admin-header .jj-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Landscape tablet specific (1280x800 exact) */
@media (min-width: 1200px) and (max-width: 1366px) and (max-height: 900px) {
    /* Optimize for landscape tablet viewing */
    .jj-bruger-admin-wrapper {
        padding: 20px;
    }
    
    /* 4 columns on larger tablets in landscape */
    .jj-product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
    
    .jj-product-image {
        height: 110px;
    }
    
    .jj-product-info {
        padding: 12px 12px 8px;
    }
    
    .jj-product-name {
        font-size: 13px;
    }
    
    /* Slightly smaller sidebar */
    .jj-cart-sidebar {
        width: 240px;
    }
    
    /* Compact mode cards */
    .jj-mode-cards {
        flex-direction: row;
    }
    
    .jj-mode-card {
        padding: 12px 10px;
    }
    
    /* ============================================
       LAGERSTYRING - 1280x800 Landscape Specific
       ============================================ */
    #jj-lagerstyring .jj-admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    #jj-lagerstyring .jj-stats-row {
        flex-wrap: nowrap;
    }
    
    #jj-lagerstyring .jj-stat-card {
        flex: 1;
        min-width: auto;
    }
    
    /* Optimized table for 1280px width */
    #jj-lagerstyring .jj-user-table {
        font-size: 13px;
    }
    
    #jj-lagerstyring .jj-user-table th {
        padding: 12px 10px;
        font-size: 11px;
    }
    
    #jj-lagerstyring .jj-user-table td {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    #jj-lagerstyring .jj-table-image {
        width: 44px;
        height: 44px;
    }
    
    #jj-lagerstyring .jj-action-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Portrait tablet (800x1280) */
@media (min-width: 769px) and (max-width: 900px) {
    /* 2 columns in portrait */
    .jj-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .jj-product-image {
        height: 140px;
    }
    
    /* Stack layout in portrait */
    .jj-products-layout {
        flex-direction: column;
    }
    
    .jj-cart-sidebar {
        width: 100%;
        order: -1;
        margin-bottom: 16px;
    }
    
    .jj-cart-panel {
        position: static;
    }
    
    .jj-cart-items {
        max-height: 120px;
    }
    
    /* Mode cards stack */
    .jj-mode-cards {
        flex-direction: column;
    }
    
    .jj-mode-card {
        flex-direction: row;
        text-align: left;
        padding: 14px 16px;
        gap: 12px;
    }
    
    .jj-mode-icon {
        font-size: 24px;
        margin-bottom: 0;
    }
    
    .jj-mode-card > div {
        display: flex;
        flex-direction: column;
    }
    
    /* Toolbar full width */
    .jj-admin-toolbar {
        flex-direction: column;
    }
    
    .jj-search-wrapper {
        max-width: 100%;
    }
    
    .jj-filter-select {
        width: 100%;
    }
}

/* Mobile card view - hidden by default, shown on mobile */
.jj-mobile-cards {
    display: none;
}

.jj-mobile-card {
    background: var(--jj-white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 16px;
    margin-bottom: 12px;
}

.jj-mobile-card:last-child {
    margin-bottom: 0;
}

.jj-mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.jj-mobile-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--jj-text-dark);
    margin: 0;
}

.jj-mobile-card-badge {
    background: rgba(76, 175, 80, 0.15);
    color: var(--jj-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
}

/* Total badge in table - prevent wrapping */
.jj-user-table td .jj-status {
    white-space: nowrap;
    min-width: fit-content;
}

/* Total badge - always single line */
.jj-total-badge {
    display: inline-block;
    background: var(--jj-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 60px;
    text-align: center;
}

/* Total column minimum width */
.jj-user-table th:last-child,
.jj-user-table td:last-child {
    min-width: 80px;
    width: 80px;
}

.jj-mobile-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.jj-mobile-card-field {
    min-width: 0;
}

.jj-mobile-card-label {
    font-size: 12px;
    color: var(--jj-text-gray);
    margin-bottom: 2px;
}

.jj-mobile-card-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--jj-text-dark);
    word-break: break-word;
}

/* Mobile toolbar adjustments */
.jj-mobile-toolbar {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--jj-white);
    border-radius: 8px;
    margin-bottom: 16px;
}

.jj-mobile-toolbar .jj-search-wrapper {
    max-width: none;
}

.jj-mobile-toolbar .jj-filter-select {
    width: 100%;
}

/* Tablet breakpoint - hide desktop elements and show mobile elements */
/* EXCEPT for pages without mobile cards (lagerstyring, etc.) */
/* Extended to 1366px to cover 1280x800 tablets with browser chrome */
@media (max-width: 1366px) {
    /* Hide desktop table and toolbar on tablet/mobile - BUT NOT for lagerstyring or wizard */
    .jj-admin-card .jj-admin-toolbar:not(.jj-lagerstyring-toolbar):not(.jj-wizard-toolbar),
    .jj-admin-card .jj-user-table:not(.jj-lagerstyring-produkter):not(#jj-lagerstyring-table) {
        display: none !important;
    }
    
    /* EXCEPTION: Always show wizard toolbar (employee selection in Step 2) */
    .jj-wizard-toolbar,
    .jj-admin-toolbar.jj-wizard-toolbar {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }
    
    .jj-wizard-toolbar .jj-search-wrapper,
    .jj-wizard-toolbar .jj-filter-wrapper {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .jj-wizard-toolbar .jj-filter-select {
        width: 100% !important;
    }
    
    /* EXCEPTION: Always show lagerstyring elements */
    .jj-lagerstyring-toolbar-card,
    .jj-lagerstyring-table-card,
    .jj-lagerstyring-toolbar,
    .jj-lagerstyring-produkter,
    #jj-lagerstyring-table {
        display: block !important;
    }
    
    .jj-lagerstyring-toolbar,
    .jj-admin-toolbar.jj-lagerstyring-toolbar {
        display: flex !important;
    }
    
    .jj-lagerstyring-produkter,
    table.jj-lagerstyring-produkter,
    #jj-lagerstyring-table {
        display: table !important;
    }
    
    /* Show mobile elements for other pages */
    .jj-mobile-toolbar {
        display: flex;
    }
    
    /* But hide mobile toolbar for lagerstyring (it uses inline toolbar) */
    #jj-lagerstyring .jj-mobile-toolbar {
        display: none;
    }
    
    .jj-mobile-cards {
        display: block;
    }
    
    /* Hide desktop-only summary */
    .jj-desktop-only {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .jj-bruger-admin-wrapper {
        padding: 16px;
    }
    
    .jj-admin-header h1 {
        font-size: 1.75rem;
    }
    
    /* Wizard toolbar - Stack vertically on mobile */
    .jj-wizard-toolbar {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        padding: 1rem !important;
    }
    
    .jj-wizard-toolbar .jj-search-wrapper {
        min-width: 100% !important;
        max-width: 100% !important;
        order: 1;
    }
    
    .jj-wizard-toolbar .jj-filter-wrapper {
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    .jj-wizard-toolbar .jj-filter-wrapper:has(#jj-emp-select) {
        order: 2;
    }
    
    .jj-wizard-toolbar .jj-filter-select {
        width: 100% !important;
    }
    
    .jj-wizard-toolbar #jj-emp-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    /* Prevent iOS zoom on all wizard inputs */
    .jj-wizard-toolbar .jj-search-wrapper input,
    .jj-wizard-toolbar .jj-filter-select {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    .jj-wizard-toolbar .jj-search-wrapper input {
        padding-left: 36px !important;
    }
    
    /* Product grid adjustments */
    .jj-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .jj-product-image {
        height: 120px;
    }
    
    .jj-product-name {
        font-size: 14px;
    }
    
    .jj-product-actions {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .jj-add-to-cart-btn {
        width: 100%;
        padding: 10px 16px;
    }
    
    .jj-products-layout {
        flex-direction: column;
    }
    
    .jj-cart-sidebar {
        width: 100%;
    }
    
    .jj-cart-panel {
        position: static;
    }
    
    .jj-mode-cards {
        flex-direction: column;
    }
    
    .jj-section-header h2 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .jj-bruger-admin-wrapper {
        padding: 12px;
    }
    
    .jj-admin-header h1 {
        font-size: 1.5rem;
    }
    
    .jj-product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .jj-product-card {
        border-radius: 12px;
    }
    
    .jj-product-image {
        height: 100px;
        border-radius: 12px 12px 0 0;
    }
    
    .jj-product-info {
        padding: 12px 10px 8px;
    }
    
    .jj-product-name {
        font-size: 13px;
    }
    
    .jj-product-meta {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .jj-product-stock {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .jj-product-actions {
        padding: 10px;
    }
    
    .jj-add-to-cart-btn {
        font-size: 12px;
        padding: 8px 14px;
    }
    
    .jj-mobile-card-grid {
        gap: 10px 12px;
    }
    
    .jj-mobile-card-title {
        font-size: 15px;
    }
    
    .jj-mobile-card-value {
        font-size: 13px;
    }
}

/* ===== LEGACY COMPATIBILITY ===== */
.arbejdstoj-wrapper,
.jj-table-wrapper,
.jj-wizard-wrapper,
.jj-mine-udlaan {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

.jj-table-card {
    background: var(--jj-white);
    border-radius: var(--jj-radius);
    box-shadow: var(--jj-shadow);
    overflow: hidden;
}

.jj-table-header {
    padding: 20px;
}

.jj-table-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.jj-table-header p {
    font-size: 0.9rem;
    color: var(--jj-text-gray);
    margin: 0;
}

.jj-data-table {
    width: 100%;
    border-collapse: collapse;
}

.jj-data-table thead {
    background: var(--jj-primary);
}

.jj-data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.jj-data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--jj-border);
}

.jj-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.jj-badge-success {
    background: var(--jj-primary-light);
    color: #1B5E20;
}

.jj-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.jj-edit-link {
    color: var(--jj-primary);
    text-decoration: none;
    font-size: 13px;
}

.jj-edit-link:hover {
    text-decoration: underline;
}

/* Empty state */
.jj-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--jj-text-gray);
}

/* ===== BIRTHDAY WIDGET ===== */
.jj-birthday-widget {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.jj-birthday-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--jj-white);
    border: 1px solid var(--jj-border);
    border-radius: 8px;
    margin-bottom: 8px;
}

.jj-birthday-item:last-child {
    margin-bottom: 0;
}

.jj-birthday-icon {
    font-size: 24px;
}

.jj-birthday-info {
    flex: 1;
}

.jj-birthday-name {
    font-weight: 600;
    color: var(--jj-text-dark);
    font-size: 14px;
}

.jj-birthday-company {
    color: var(--jj-text-gray);
    font-size: 12px;
}

.jj-birthday-date {
    text-align: center;
    background: var(--jj-primary);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 50px;
}

.jj-birthday-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.jj-birthday-month {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jj-birthday-empty {
    text-align: center;
    padding: 20px;
    color: var(--jj-text-gray);
}

/* ===== LAGERSTYRING STYLES ===== */

/* Admin header with button */
.jj-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* Stats Row */
.jj-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.jj-stat-card {
    flex: 1;
    min-width: 150px;
    background: var(--jj-white);
    border-radius: var(--jj-radius);
    box-shadow: var(--jj-shadow);
    padding: 20px;
    text-align: center;
}

.jj-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--jj-primary);
}

.jj-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--jj-text-gray);
    margin-top: 4px;
}

.jj-stat-warning .jj-stat-number {
    color: #d97706;
}

/* Buttons */
.jj-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.jj-btn-primary:hover {
    background: var(--jj-primary-dark);
}

.jj-btn-secondary {
    background: var(--jj-bg-light);
    color: var(--jj-text-dark);
    border: 1px solid var(--jj-border);
}

.jj-btn-secondary:hover {
    background: #e5e7eb;
}

.jj-btn-danger {
    background: #ef4444;
    color: white;
}

.jj-btn-danger:hover {
    background: #dc2626;
}

/* Action Buttons in Table */
.jj-action-btn {
    padding: 6px 12px;
    border: 1px solid var(--jj-border);
    border-radius: 6px;
    background: var(--jj-white);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.jj-action-btn:hover {
    background: var(--jj-bg-light);
}

.jj-btn-adjust {
    color: var(--jj-primary);
    border-color: var(--jj-primary-light);
}

.jj-btn-adjust:hover {
    background: var(--jj-primary-bg);
}

/* Table Image */
.jj-table-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f0;
}

.jj-table-image.jj-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* ===== MODAL STYLES ===== */
.jj-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.jj-modal-content {
    background: var(--jj-white);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.jj-modal-large {
    max-width: 700px;
}

.jj-modal-small {
    max-width: 400px;
}

.jj-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--jj-border);
}

.jj-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--jj-text-dark);
}

.jj-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--jj-text-gray);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jj-modal-close:hover {
    background: var(--jj-bg-light);
    color: var(--jj-text-dark);
}

.jj-modal-body {
    padding: 24px;
}

.jj-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--jj-border);
    background: var(--jj-bg-light);
}

/* ===== FORM STYLES ===== */
.jj-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px;
}

.jj-form-group {
    display: flex;
    flex-direction: column;
}

.jj-form-group-full {
    grid-column: 1 / -1;
}

.jj-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--jj-text-dark);
    margin-bottom: 6px;
}

.jj-input {
    padding: 10px 14px;
    border: 1px solid var(--jj-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.jj-input:focus {
    outline: none;
    border-color: var(--jj-primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.jj-radio-group {
    display: flex;
    gap: 16px;
}

.jj-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.jj-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--jj-primary);
}

/* Image Upload Area */
.jj-image-upload-area {
    border: 2px dashed var(--jj-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--jj-bg-light);
    position: relative;
}

.jj-image-upload-area:hover,
.jj-image-upload-area.jj-drag-over {
    border-color: var(--jj-primary);
    background: var(--jj-primary-bg);
}

.jj-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.jj-upload-icon {
    font-size: 32px;
}

.jj-upload-hint {
    font-size: 12px;
    color: var(--jj-text-gray);
}

.jj-image-preview {
    position: relative;
    display: inline-block;
}

.jj-image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.jj-remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jj-remove-image:hover {
    background: #dc2626;
}

/* Text Muted */
.jj-text-muted {
    color: var(--jj-text-gray);
    font-size: 13px;
}

/* Mobile Edit Link */
.jj-mobile-edit-link {
    display: inline-block;
    padding: 6px 12px;
    background: var(--jj-primary-bg);
    color: var(--jj-primary);
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.jj-mobile-edit-link:hover {
    background: var(--jj-primary-light);
}

/* Responsive adjustments for lagerstyring */
@media (max-width: 768px) {
    .jj-admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .jj-stats-row {
        flex-direction: column;
    }
    
    .jj-stat-card {
        min-width: auto;
    }
    
    .jj-form-grid {
        grid-template-columns: 1fr;
    }
    
    .jj-modal-content {
        max-height: 85vh;
    }
    
    .jj-modal-footer {
        flex-direction: column-reverse;
    }
    
    .jj-modal-footer .jj-btn {
        width: 100%;
        justify-content: center;
    }
    
    .jj-actions {
        flex-wrap: wrap;
    }
    
    .jj-action-btn {
        flex: 1;
        text-align: center;
        min-width: 70px;
    }
}

/* Print styles */
@media print {
    .jj-admin-toolbar,
    .jj-submit-btn,
    .jj-actions {
        display: none !important;
    }
    
    .jj-bruger-admin-wrapper {
        padding: 0;
    }
    
    .jj-admin-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== LOW STOCK ALERT SECTION (v2.9) ===== */
.jj-low-stock-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.15);
    border: 1px solid #f59e0b;
}

.jj-low-stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

.jj-low-stock-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jj-low-stock-icon {
    font-size: 32px;
    animation: jj-pulse 2s infinite;
}

@keyframes jj-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.jj-low-stock-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #92400e;
    margin: 0;
}

.jj-low-stock-title p {
    font-size: 0.85rem;
    color: #b45309;
    margin: 2px 0 0 0;
}

.jj-low-stock-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.jj-low-stock-toggle:hover {
    background: #fffbeb;
}

.jj-toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

/* Low Stock Grid */
.jj-low-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 20px;
}

/* Low Stock Card */
.jj-low-stock-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #f59e0b;
    transition: transform 0.2s, box-shadow 0.2s;
}

.jj-low-stock-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.jj-low-stock-critical {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.jj-low-stock-warning {
    border-left-color: #f59e0b;
}

.jj-low-stock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.jj-low-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.jj-low-stock-badge.critical {
    background: #fee2e2;
    color: #991b1b;
}

.jj-low-stock-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.jj-low-stock-type {
    font-size: 18px;
}

.jj-low-stock-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--jj-text-dark);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.jj-low-stock-meta {
    font-size: 12px;
    color: var(--jj-text-gray);
    margin-bottom: 14px;
}

.jj-low-stock-size {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
}

.jj-low-stock-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.jj-low-stock-stat {
    text-align: center;
    padding: 8px 4px;
    background: #f9fafb;
    border-radius: 6px;
}

.jj-low-stock-stat-label {
    display: block;
    font-size: 10px;
    color: var(--jj-text-gray);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.jj-low-stock-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.jj-low-stock-stat-value.critical {
    color: #dc2626;
}

.jj-low-stock-stat-value.warning {
    color: #d97706;
}

.jj-low-stock-stat-value.neutral {
    color: #6b7280;
}

/* Progress Bar */
.jj-low-stock-progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.jj-low-stock-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.jj-low-stock-progress-bar.critical {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.jj-low-stock-progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Grænse display in table */
.jj-lager-graense {
    display: inline-block;
    padding: 4px 10px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Responsive for low stock section */
@media (max-width: 768px) {
    .jj-low-stock-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .jj-low-stock-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .jj-low-stock-grid {
        grid-template-columns: 1fr;
    }
    
    .jj-low-stock-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   LENOVO TABLET SPECIFIC (1280x800)
   Force show tables and optimize layout
   ============================================ */

/* LAGERSTYRING - ALWAYS show table and toolbar on ALL screen sizes */
.jj-lagerstyring-table-card .jj-user-table,
.jj-lagerstyring-table-card .jj-lagerstyring-produkter,
table.jj-lagerstyring-produkter,
#jj-lagerstyring-table {
    display: table !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.jj-lagerstyring-toolbar-card .jj-admin-toolbar,
.jj-lagerstyring-toolbar-card .jj-lagerstyring-toolbar,
.jj-lagerstyring-toolbar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.jj-lagerstyring-table-card,
.jj-lagerstyring-toolbar-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media screen and (min-width: 1024px) and (max-width: 1400px) {
    /* ALWAYS show lagerstyring table on tablets */
    #jj-lagerstyring .jj-admin-card,
    #jj-lagerstyring .jj-admin-toolbar,
    #jj-lagerstyring .jj-user-table,
    #jj-lagerstyring table {
        display: block !important;
    }
    
    #jj-lagerstyring .jj-user-table,
    #jj-lagerstyring table.jj-user-table {
        display: table !important;
        width: 100%;
    }
    
    #jj-lagerstyring .jj-admin-toolbar {
        display: flex !important;
    }
    
    /* Ensure card doesn't hide overflow */
    #jj-lagerstyring .jj-admin-card {
        overflow: visible;
        overflow-x: auto;
    }
    
    /* Compact header for tablet */
    #jj-lagerstyring .jj-admin-header {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    #jj-lagerstyring .jj-admin-header h1 {
        font-size: 1.25rem;
    }
    
    /* Touch-friendly add button */
    #jj-lagerstyring .jj-btn-primary {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Responsive stats */
    #jj-lagerstyring .jj-stats-row {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    #jj-lagerstyring .jj-stat-card {
        flex: 1 1 auto;
        min-width: 120px;
        padding: 16px;
    }
    
    /* Compact toolbar */
    #jj-lagerstyring .jj-admin-toolbar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }
    
    /* Optimized table */
    #jj-lagerstyring .jj-user-table th,
    #jj-lagerstyring .jj-user-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    #jj-lagerstyring .jj-user-table th {
        font-size: 10px;
    }
    
    /* Image column */
    #jj-lagerstyring .jj-table-image {
        width: 45px;
        height: 45px;
        border-radius: 6px;
    }
    
    /* Touch-friendly action buttons */
    #jj-lagerstyring .jj-actions {
        display: flex;
        gap: 6px;
        flex-wrap: nowrap;
    }
    
    #jj-lagerstyring .jj-action-btn,
    #jj-lagerstyring .jj-btn-edit,
    #jj-lagerstyring .jj-btn-stock,
    #jj-lagerstyring .jj-btn-delete {
        padding: 8px 10px;
        font-size: 11px;
        min-height: 38px;
        white-space: nowrap;
    }
    
    /* Status badges */
    #jj-lagerstyring .jj-status {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Trailer billede knap */
.jj-btn-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.jj-btn-small:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* ── DRAG & DROP SORTERING (v2.14) ──────────────────────────────── */
.jj-sort-handle-lev,
.jj-sort-handle-kat {
    cursor: grab;
    color: #9ca3af;
    padding: 4px 6px;
    border-radius: 6px;
    background: none;
    border: none;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}
.jj-sort-handle-lev:hover,
.jj-sort-handle-kat:hover {
    color: var(--jj-primary, #707A4B);
    background: rgba(112, 122, 75, 0.1);
}
.jj-sort-handle-lev:active,
.jj-sort-handle-kat:active {
    cursor: grabbing;
}

/* Ghost (placeholder) row/card during drag */
tr.jj-sort-ghost,
.jj-lev-card.jj-sort-ghost,
.jj-lev-kategori-card.jj-sort-ghost,
.jj-lev-mobile-kategori.jj-sort-ghost {
    opacity: 0.35;
    background: rgba(112, 122, 75, 0.06) !important;
    outline: 2px dashed var(--jj-primary, #707A4B);
    outline-offset: -2px;
}

/* The element being dragged */
tr.jj-sort-drag,
.jj-lev-card.jj-sort-drag,
.jj-lev-kategori-card.jj-sort-drag,
.jj-lev-mobile-kategori.jj-sort-drag {
    opacity: 0.95;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}

/* Category header handle placement */
.jj-lev-kat-header-mobile .jj-sort-handle-kat {
    font-size: 1.1rem;
}
