/* =====================================================
   STOQ SHELF - INVENTORY MANAGEMENT SYSTEM
   Comprehensive Stylesheet
   Mobile-First Responsive Design
   SEO-Optimized for: inventory management, stock tracking,
   warehouse management, asset tracking, inventory control
   ===================================================== */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f4f4f4;
    line-height: 1.6;
    color: #333;
    font-size: 16px;
}

/* === AUTH PAGES (Login/Register) === */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-container h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 24px;
}

/* === FORM ELEMENTS === */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-group select {
    background-color: white;
    cursor: pointer;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* === BUTTONS === */
.btn {
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #007bff;
    width: 100%;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-logout {
    background: #6c757d;
}

.btn-logout:hover {
    background: #5a6268;
}

.btn-info {
    background: #17a2b8;
}

.btn-info:hover {
    background: #138496;
}

/* === ALERTS === */
.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* === AUTH LINKS === */
.auth-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.auth-link a {
    color: #007bff;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* === INVENTORY HEADER === */
.inventory-header {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.inventory-header h1 {
    color: #333;
    font-size: 24px;
    margin: 0;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.header-right span {
    font-size: 14px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.user-info:hover {
    opacity: 0.9;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #007bff;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid #007bff;
}

.user-name-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-greeting {
    font-size: 12px;
    color: #666;
}

.user-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

/* === NOTIFICATION BADGE === */
.notification-bell {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 8px;
    margin-right: 10px;
}

.notification-bell svg {
    width: 24px;
    height: 24px;
    color: #333;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* === INVENTORY CONTAINER === */
.inventory-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin: 0 auto 20px;
}

/* === TOP ACTIONS === */
.top-actions {
    margin-bottom: 20px;
}

/* === TABLE === */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

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

@media (min-width: 769px) {
    table {
        min-width: 600px;
    }
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

tr:hover {
    background: #f8f9fa;
}

td {
    font-size: 14px;
}

/* === ACTIONS COLUMN === */
.actions {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    align-items: center;
}

.actions .btn {
    padding: 4px 10px;
    font-size: 13px;
    white-space: nowrap;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* === BUTTON GROUP === */
.button-group {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* === ITEM DETAIL VIEW === */
.detail-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto 20px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 15px;
}

.detail-header h2 {
    margin: 0;
    color: #333;
    font-size: 28px;
}

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

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.detail-image {
    width: 100%;
}

.detail-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.detail-image-placeholder {
    width: 100%;
    height: 300px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 18px;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-group {
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.info-group:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: bold;
}

.info-value {
    font-size: 18px;
    color: #333;
    word-wrap: break-word;
}

.info-value.quantity {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
}

.info-value.description {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

.back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.back-button:hover {
    text-decoration: underline;
}

/* === PROFILE PAGE === */
.profile-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto 20px;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.profile-avatar-section {
    margin-bottom: 20px;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #007bff;
    margin: 0 auto;
    display: block;
}

.profile-avatar-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 48px;
    border: 4px solid #007bff;
    margin: 0 auto;
}

.profile-upload-btn {
    margin-top: 15px;
}

.profile-sections {
    display: grid;
    gap: 30px;
}

.profile-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.profile-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-section h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: #007bff;
    display: block;
}

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

.form-group.disabled input {
    background: #e9ecef;
    cursor: not-allowed;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* === CATEGORIES & TAGS STYLES === */

/* Category Select Dropdown */
.category-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

/* Tags Container */
.tags-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

/* Individual Tag Item */
.tag-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tag-item:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

/* Tag Checkbox */
.tag-checkbox {
    margin-right: 10px;
    cursor: pointer;
}

/* Tag Color Indicator */
.tag-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

/* Tag Name */
.tag-name {
    font-weight: 500;
    color: var(--text-primary, #333);
}

/* Loading Message */
.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* No Items Message */
.no-items-message {
    text-align: center;
    padding: 15px;
    color: #999;
}

/* Create Link */
.create-link {
    color: #007bff;
    text-decoration: none;
}

.create-link:hover {
    text-decoration: underline;
}

/* Category/Tag Badge Display */
.category-badge,
.tag-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 5px;
    margin-bottom: 5px;
}

.category-badge {
    border: 2px solid;
}

.tag-badge {
    border: 1px solid;
}

/* === IMAGE UPLOAD & PREVIEW === */
.image-upload-wrapper {
    margin-top: 10px;
}

.image-preview {
    margin-top: 15px;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 2px solid #ddd;
    display: block;
}

.image-preview-small {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #ddd;
}

.remove-image-btn {
    margin-top: 10px;
    padding: 8px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.remove-image-btn:hover {
    background: #c82333;
}

.file-input-label {
    display: inline-block;
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.file-input-label:hover {
    background: #0056b3;
}

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

.file-info {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.current-image-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    display: block;
}

/* === LOADING SPINNER === */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* === MODAL STYLES === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

/* === STATISTICS CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card-content h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-card-content p {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.stat-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon svg {
    width: 30px;
    height: 30px;
}

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

/* === MOBILE PHONES (up to 480px) === */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .auth-container {
        padding: 20px;
    }

    .auth-container h2 {
        font-size: 20px;
    }

    .inventory-header {
        padding: 15px;
    }

    .inventory-header h1 {
        font-size: 20px;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    .inventory-container {
        padding: 15px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    .actions {
        flex-direction: column;
        gap: 5px;
    }

    .actions .btn {
        width: 100%;
        padding: 8px 12px;
        font-size: 12px;
    }

    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }
    
    .detail-container {
        padding: 15px;
    }
    
    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-header h2 {
        font-size: 22px;
    }
    
    .detail-actions {
        width: 100%;
    }
    
    .detail-actions .btn {
        flex: 1;
    }
    
    .detail-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .info-value.quantity {
        font-size: 28px;
    }
    
    .profile-container {
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
    }

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

    /* Better table responsiveness on mobile */
    table {
        min-width: 100%;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Stack form groups vertically on mobile */
    .form-group {
        margin-bottom: 12px;
    }

    /* Improve modal on mobile */
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }

    /* Fix body padding on mobile */
    body {
        padding: 0;
        margin: 0;
    }

    /* Ensure containers don't overflow */
    .inventory-container,
    .detail-container,
    .profile-container,
    .auth-container {
        margin: 10px;
        width: calc(100% - 20px);
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Fix dashboard charts on mobile */
    .inventory-container > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Fix analytics containers on mobile */
    .analytics-container {
        padding: 15px !important;
        margin-bottom: 15px;
    }

    .analytics-container h3 {
        font-size: 16px !important;
    }

    .analytics-container canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    .analytics-container > div {
        height: 250px !important;
    }

    /* Fix stat cards on mobile */
    .stat-card {
        min-width: 100% !important;
        flex: 1 1 100% !important;
        margin-bottom: 10px;
    }

    /* Fix any inline flex containers */
    div[style*="display: flex"] {
        flex-wrap: wrap !important;
    }

    /* Prevent horizontal overflow */
    * {
        max-width: 100%;
        word-wrap: break-word;
    }

    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Fix notification widget position on mobile */
    .notification-widget {
        position: relative !important;
        margin: 10px;
    }

    /* Fix search bar on mobile */
    .search-bar {
        padding: 15px !important;
    }

    .search-bar > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .search-bar .form-group {
        margin-bottom: 10px !important;
    }

    .search-bar .form-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .search-bar input,
    .search-bar select {
        font-size: 16px !important;
        padding: 10px !important;
    }

    /* Fix sort row on mobile */
    .search-bar > div[style*="border-top"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .search-bar > div[style*="border-top"] > div {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .search-bar > div[style*="border-top"] select {
        width: 100% !important;
        margin-bottom: 10px;
    }

    .search-bar > div[style*="border-top"] label {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }

    /* Fix export buttons on mobile */
    .search-bar .btn {
        width: 100%;
        margin-bottom: 5px;
        padding: 10px !important;
        font-size: 14px !important;
    }

    .search-bar > div[style*="gap: 5px"] {
        flex-direction: column !important;
        width: 100%;
    }
}

/* === TABLETS (481px to 768px) === */
@media (min-width: 481px) and (max-width: 768px) {
    .inventory-header h1 {
        font-size: 22px;
    }

    .inventory-container {
        padding: 20px;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px;
    }

    .actions .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .detail-content {
        grid-template-columns: 1fr;
    }
    
    .detail-container {
        padding: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === LARGE TABLETS & SMALL DESKTOPS (769px to 1024px) === */
@media (min-width: 769px) and (max-width: 1024px) {
    .inventory-container {
        max-width: 95%;
        padding: 25px;
    }
}

/* === DESKTOP (1025px and up) === */
@media (min-width: 1025px) {
    .inventory-container {
        padding: 30px;
    }
}

/* === LANDSCAPE ORIENTATION === */
@media (orientation: landscape) and (max-height: 500px) {
    .auth-wrapper {
        padding: 10px;
    }

    .auth-container {
        padding: 20px;
        max-width: 500px;
    }
}

/* === PRINT STYLES === */
@media print {
    .btn, .header-right, .top-actions {
        display: none;
    }

    .inventory-header {
        border-bottom: 2px solid #000;
    }

    table {
        border: 1px solid #000;
    }

    th {
        background: #e0e0e0 !important;
    }
}

/* === ACCESSIBILITY === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* === UTILITY CLASSES === */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.fw-bold { font-weight: bold; }
.fw-normal { font-weight: normal; }

.text-muted { color: #6c757d; }
.text-primary { color: #007bff; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.text-info { color: #17a2b8; }

/* ================================================================
   PDF EXPORT STYLES - Add these to the end of your style.css
   ================================================================ */

/* PDF Print Styles */
@media print {
    .no-print {
        display: none;
    }
}

/* PDF Report Styles */
.pdf-body {
    font-family: Arial, sans-serif;
    margin: 20px;
    color: #333;
}

.pdf-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #007bff;
    padding-bottom: 20px;
}

.pdf-header h1 {
    margin: 0;
    color: #007bff;
}

.pdf-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.pdf-stat-box {
    border: 2px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
}

.pdf-stat-box h3 {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.pdf-stat-box p {
    margin: 10px 0 0 0;
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.pdf-table th,
.pdf-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 12px;
}

.pdf-table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.pdf-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.pdf-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 11px;
    color: #999;
    border-top: 2px solid #ddd;
    padding-top: 20px;
}

.pdf-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 10px 5px;
}

.pdf-btn:hover {
    background: #0056b3;
}

.pdf-btn-secondary {
    background: #6c757d;
}

.pdf-btn-secondary:hover {
    background: #5a6268;
}

/* ================================================================
   HEADER WITH RIGHT-SIDE MENU AND LOGO - Add to style.css
   Replace existing .inventory-header styles
   ================================================================ */

.inventory-header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo img {
    height: 40px;
    width: auto;
}

.header-nav {
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    text-decoration: none;
    color: #555;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    position: relative;
}

.nav-link:hover {
    background-color: #f0f0f0;
    color: #007bff;
}

.nav-link.active {
    background-color: #007bff;
    color: white;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
    filter: none !important;
}

.nav-icon {
    font-size: 18px;
}

.nav-logout {
    color: #dc3545;
}

.nav-logout:hover {
    background-color: #fff5f5;
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* === MOBILE MENU TOGGLE === */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    color: #333;
    line-height: 1;
}

.mobile-menu-toggle:hover {
    opacity: 0.7;
}

[data-theme="dark"] .mobile-menu-toggle {
    color: var(--text-primary);
}

/* === MOBILE MENU OVERLAY === */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.mobile-menu-overlay-active {
    display: block;
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .inventory-header {
        padding: 12px 15px;
        position: sticky;
        top: 0;
        z-index: 1000;
        height: auto;
        min-height: 60px;
    }

    .header-logo img {
        height: 35px;
    }

    .mobile-menu-toggle {
        display: block;
        position: relative;
        z-index: 1001;
    }

    .header-nav {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        max-width: 80vw;
        height: calc(100vh - 60px);
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    [data-theme="dark"] .header-nav {
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
    }

    .header-nav.mobile-menu-open {
        right: 0;
    }

    .nav-link {
        width: 100%;
        padding: 15px 20px;
        justify-content: flex-start;
        border-radius: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    [data-theme="dark"] .nav-link {
        border-bottom-color: var(--border-color);
    }

    .nav-link .nav-text {
        display: inline;
    }

    .nav-link .nav-icon {
        width: 24px;
        display: inline-block;
        /* Icons always keep original color — no filter override */
        filter: none !important;
    }

    /* Mobile drawer active state — left border accent + no icon filtering */
    .nav-link.active {
        border-left: 3px solid #6366f1;
        background-color: rgba(99, 102, 241, 0.12);
        color: var(--text-primary, #333);
    }

    [data-theme="dark"] .nav-link.active {
        border-left: 3px solid #6366f1;
        background-color: rgba(99, 102, 241, 0.15);
        color: #F0F4F8;
    }

    /* Ensure icon color is never overridden on any state mobile */
    .nav-link.active .nav-icon,
    .nav-link:hover .nav-icon,
    .nav-link .nav-icon {
        filter: none !important;
    }

    /* Keep modal responsive */
    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-width: 500px;
    }

    /* Fix notification dropdown on mobile */
    #notificationDropdown {
        top: 60px !important;
        right: 10px !important;
        left: auto !important;
        width: calc(100vw - 20px) !important;
        max-width: 380px !important;
    }
}

/* =================================================================
   DARK MODE CSS FIXES FOR SIMPLEINV
   Copy these styles to /public/css/style.css 
   Replace the existing dark mode section (lines 1385-1736)
   ================================================================= */

/* Dark Mode Variables — calibrated to logo color #0A111A */
:root[data-theme="dark"] {
    --bg-primary:    #070E16;   /* page body — deepest layer */
    --bg-secondary:  #0A111A;   /* nav bar — exact logo background, seamless */
    --bg-tertiary:   #111C27;   /* cards, panels — subtle lift above nav */
    --bg-elevated:   #172333;   /* inputs, dropdowns, modals */
    --text-primary:  #F0F4F8;
    --text-secondary:#94A3B8;
    --border-color:  #1E2D3D;
    --shadow: rgba(0, 0, 0, 0.6);
    --input-bg: #172333;
    --card-bg:  #111C27;
}

/* Dark Mode Body */
[data-theme="dark"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* ===== LOGO VISIBILITY FIXES ===== */
/* Login Page Logo Visibility */
[data-theme="dark"] .auth-container .logo-light {
    display: none !important;
}

[data-theme="dark"] .auth-container .logo-dark {
    display: block !important;
}

[data-theme="light"] .auth-container .logo-dark,
.auth-container .logo-dark {
    display: none !important;
}

[data-theme="light"] .auth-container .logo-light,
.auth-container .logo-light {
    display: block !important;
}

/* Header Logo Visibility */
[data-theme="dark"] .header-logo .logo-light {
    display: none !important;
}

[data-theme="dark"] .header-logo .logo-dark {
    display: block !important;
}

[data-theme="light"] .header-logo .logo-dark,
.header-logo .logo-dark {
    display: none !important;
}

[data-theme="light"] .header-logo .logo-light,
.header-logo .logo-light {
    display: block !important;
}

/* ===== DARK MODE HEADER ===== */
[data-theme="dark"] .inventory-header {
    background-color: var(--bg-secondary);
    border-bottom-color: var(--border-color);
    box-shadow: 0 2px 10px var(--shadow);
}

[data-theme="dark"] .inventory-header h1 {
    color: var(--text-primary);
}

/* ===== DARK MODE NAVIGATION ===== */
[data-theme="dark"] .nav-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .nav-link.active {
    color: var(--text-primary);
    background-color: #007bff;
}

/* ===== DARK MODE CONTAINER ===== */
[data-theme="dark"] .inventory-container {
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 10px var(--shadow);
}

/* ===== DARK MODE AUTH PAGES ===== */
[data-theme="dark"] .auth-wrapper {
    background-color: var(--bg-primary);
}

[data-theme="dark"] .auth-container {
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 10px var(--shadow);
    border-color: var(--border-color);
}

[data-theme="dark"] .auth-container h2 {
    color: var(--text-primary);
}

[data-theme="dark"] .auth-container p {
    color: var(--text-secondary) !important;
}

/* ===== DARK MODE CARDS & STATS ===== */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .detail-container,
[data-theme="dark"] .analytics-container {
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 10px var(--shadow);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .stat-card h3,
[data-theme="dark"] .stat-card p,
[data-theme="dark"] .stat-card small {
    color: var(--text-primary);
}

/* ===== DARK MODE TABLES ===== */
[data-theme="dark"] table {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] th {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] td {
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] tr:hover {
    background-color: var(--bg-tertiary);
}

/* ===== DARK MODE FORMS - FIX WHITE TEXT ON WHITE ===== */
[data-theme="dark"] .form-group label {
    color: var(--text-primary);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: #007bff;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===== DARK MODE BUTTONS - FIX UNREADABLE TEXT ===== */
[data-theme="dark"] .btn {
    border-color: var(--border-color);
    color: white !important; /* Force white text on all buttons */
}

[data-theme="dark"] .btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: var(--bg-secondary);
}

/* Ensure primary buttons have white text */
[data-theme="dark"] .btn-primary {
    background: #007bff;
    color: white !important;
}

[data-theme="dark"] .btn-primary:hover {
    background: #0056b3;
    color: white !important;
}

/* ===== DARK MODE SEARCH BAR ===== */
[data-theme="dark"] .search-bar input {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .search-bar input::placeholder {
    color: var(--text-secondary);
}

/* ===== DARK MODE ALERTS ===== */
[data-theme="dark"] .alert {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .alert-success {
    background-color: #1e4620;
    border-color: #2d6a2e;
    color: #a3e6a5;
}

[data-theme="dark"] .alert-error {
    background-color: #4a1e1e;
    border-color: #6a2d2d;
    color: #f5a3a3;
}

[data-theme="dark"] .alert-warning {
    background-color: #4a3c1e;
    border-color: #6a5a2d;
    color: #f5d9a3;
}

[data-theme="dark"] .alert-info {
    background-color: #1e3a4a;
    border-color: #2d566a;
    color: #a3d9f5;
}

/* ===== DARK MODE MODALS ===== */
[data-theme="dark"] .modal-content {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-header h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

/* ===== DARK MODE EMPTY STATES ===== */
[data-theme="dark"] .empty-state {
    background-color: transparent;
    color: var(--text-secondary);
}

/* ===== DARK MODE BADGES ===== */
[data-theme="dark"] .notification-badge {
    background-color: #dc3545;
    color: white;
}

[data-theme="dark"] .category-badge,
[data-theme="dark"] .tag-badge {
    /* Keep original colors for visibility */
    border: 1px solid var(--border-color);
}

/* ===== DARK MODE LINKS ===== */
[data-theme="dark"] a {
    color: #4da3ff;
}

[data-theme="dark"] a:hover {
    color: #80bdff;
}

/* ===== DARK MODE DASHBOARD ANALYTICS - FIX WHITE BACKGROUND ===== */
[data-theme="dark"] .analytics-header,
[data-theme="dark"] .analytics-grid,
[data-theme="dark"] .quick-stats,
[data-theme="dark"] .stat-box {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* ===== DARK MODE SCROLLBAR ===== */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    background-color: var(--bg-primary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: var(--bg-tertiary);
    border-radius: 5px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-color);
}

/* ===== DARK MODE CHARTS ===== */
[data-theme="dark"] canvas {
    background-color: transparent;
}

/* ===== DARK MODE DROPDOWN ===== */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

/* ===== DARK MODE IMAGE PLACEHOLDERS ===== */
[data-theme="dark"] .image-preview-small {
    border-color: var(--border-color);
    background-color: var(--bg-tertiary);
}

/* ===== DARK MODE USER INFO ===== */
[data-theme="dark"] .user-name {
    color: var(--text-primary);
}

[data-theme="dark"] .user-greeting {
    color: var(--text-secondary);
}

/* ===== DARK MODE TOGGLE SWITCH ===== */
.dark-mode-toggle {
    position: relative;
    width: 60px;
    height: 30px;
}

.dark-mode-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #007bff;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* ===== ADDITIONAL DARK MODE FIXES ===== */
[data-theme="dark"] .top-actions {
    background-color: transparent;
}

[data-theme="dark"] .filter-group {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .pagination {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .page-link {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .page-link:hover {
    background-color: var(--bg-secondary);
}

/* ===== PDF EXPORT STYLES (keep as is) ===== */
@media print {
    .no-print {
        display: none;
    }
}

.pdf-body {
    font-family: Arial, sans-serif;
    margin: 20px;
    color: #333;
}

.pdf-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #007bff;
    padding-bottom: 20px;
}

.pdf-header h1 {
    margin: 0;
    color: #007bff;
}

.pdf-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.pdf-stat-box {
    border: 2px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
}

.pdf-stat-box h3 {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.pdf-stat-box p {
    margin: 10px 0 0 0;
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.pdf-table th,
.pdf-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 12px;
}

.pdf-table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.pdf-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.pdf-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 11px;
    color: #999;
    border-top: 2px solid #ddd;
    padding-top: 20px;
}

.pdf-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 10px 5px;
}

.pdf-btn:hover {
    background: #0056b3;
}

.pdf-btn-secondary {
    background: #6c757d;
}

.pdf-btn-secondary:hover {
    background: #5a6268;
}
/* =================================================================
   COMPREHENSIVE MOBILE FIX — All pages
   ================================================================= */

/* ── Inventory table → card layout on mobile ── */
@media (max-width: 768px) {

    /* Hide standard table columns that don't fit */
    .inventory-table thead {
        display: none;
    }

    .inventory-table,
    .inventory-table tbody,
    .inventory-table tr,
    .inventory-table td {
        display: block;
        width: 100%;
    }

    .inventory-table tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        position: relative;
    }

    [data-theme="dark"] .inventory-table tr {
        background: var(--card-bg);
        border-color: var(--border-color);
    }

    .inventory-table td {
        padding: 4px 0;
        border: none;
        font-size: 14px;
        text-align: left !important;
    }

    /* Label each cell using data-label attribute */
    .inventory-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: #94a3b8;
        display: block;
        margin-bottom: 2px;
    }

    /* Hide image cell label */
    .inventory-table td:first-child::before {
        display: none;
    }

    /* Action buttons — full width row at bottom of card */
    .inventory-table td .actions {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f1f5f9;
        width: 100%;
    }

    .inventory-table td .actions .btn {
        flex: 1;
        text-align: center;
        padding: 8px 4px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }

    /* Dashboard charts — stack vertically */
    .charts-grid,
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Stats cards — 2 per row on mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* Export buttons — stack */
    .export-buttons,
    .toolbar-right {
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .export-buttons .btn,
    .toolbar-right .btn {
        width: 100% !important;
    }

    /* View item page — fix title/buttons overlap */
    .detail-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .detail-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .detail-actions .btn {
        flex: 1 !important;
        text-align: center !important;
    }

    /* Low stock table — card layout */
    .low-stock-table thead {
        display: none;
    }

    .low-stock-table,
    .low-stock-table tbody,
    .low-stock-table tr,
    .low-stock-table td {
        display: block;
        width: 100%;
    }

    .low-stock-table tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 12px;
    }

    [data-theme="dark"] .low-stock-table tr {
        background: var(--card-bg);
        border-color: var(--border-color);
    }

    .low-stock-table td {
        padding: 4px 0;
        border: none;
        font-size: 14px;
    }

    .low-stock-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        color: #94a3b8;
        display: block;
        margin-bottom: 2px;
    }

    .low-stock-table td .btn {
        width: 100% !important;
        margin-top: 8px;
    }

    /* Subscription page — stack plan cards */
    .plans-grid,
    .subscription-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Profile page form */
    .profile-grid,
    .form-row {
        grid-template-columns: 1fr !important;
    }

    /* Categories/Tags tables — card layout */
    .categories-table thead,
    .tags-table thead {
        display: none;
    }

    .categories-table tr,
    .tags-table tr {
        display: block;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 12px;
    }

    [data-theme="dark"] .categories-table tr,
    [data-theme="dark"] .tags-table tr {
        background: var(--card-bg);
        border-color: var(--border-color);
    }

    .categories-table td,
    .tags-table td {
        display: block;
        padding: 4px 0;
        border: none;
        font-size: 14px;
    }

    .categories-table td::before,
    .tags-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        color: #94a3b8;
        display: block;
        margin-bottom: 2px;
    }

    /* Add item / edit item form */
    .add-item-container,
    .edit-item-container {
        padding: 15px !important;
        margin: 10px !important;
    }

    /* General container overflow prevention */
    .inventory-container,
    .detail-container,
    .profile-container,
    .auth-container,
    .subscription-container {
        padding: 15px !important;
        overflow-x: hidden;
    }

    /* Fix filter/search bar on mobile */
    .search-bar form {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .search-bar .form-row,
    .search-bar .filter-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    /* Prevent any table from causing horizontal scroll */
    table:not(.inventory-table):not(.low-stock-table):not(.categories-table):not(.tags-table) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* =================================================================
   DARK MODE SEAMLESS LOGO FIX — nav matches logo exactly
   ================================================================= */

/* Inputs and dropdowns use elevated tier */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--bg-elevated) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Cards use tertiary — visually lifts above nav */
[data-theme="dark"] .analytics-container,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .inventory-card,
[data-theme="dark"] .plan-card,
[data-theme="dark"] .detail-container > div,
[data-theme="dark"] .profile-card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Remove any visible border between logo area and nav — they should be same color */
[data-theme="dark"] .header-logo {
    background-color: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 6px;
}

/* Table rows in dark mode */
[data-theme="dark"] table tr:hover {
    background-color: var(--bg-elevated) !important;
}

[data-theme="dark"] table th {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] table td {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Modal/dropdown backgrounds */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] #notificationDropdown {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

/* Search/filter bar */
[data-theme="dark"] .search-bar {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

/* Inventory mobile cards in dark mode */
[data-theme="dark"] .inventory-table tr {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}


/* =================================================================
   COMPREHENSIVE DARK MODE CONTRAST FIX
   Covers: all text, borders, table headers, buttons, forms,
   subscription cards, badges, alerts, modals, placeholders
   ================================================================= */

/* ── Subscription page: centered constrained cards ── */
.plans-wrapper {
    display: flex;
    justify-content: center;
    padding: 0 16px 32px;
}

.plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
    max-width: 680px;
}

@media (max-width: 600px) {
    .plans-grid {
        grid-template-columns: 1fr;
        max-width: 360px;
    }
}

/* Light mode subscription card text */
.plan-status-card { padding: 24px; margin-bottom: 24px; }
.plan-status-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.plan-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; }
.plan-badge--pro { background: #fef3c7; color: #92400e; }
.plan-badge--free { background: #f3f4f6; color: #374151; }
.plan-renews { font-size: 13px; color: #6b7280; margin: 0; }
.plan-desc { color: #6b7280; margin: 8px 0 16px; }
.usage-bar { background: #e5e7eb; border-radius: 8px; height: 8px; overflow: hidden; margin-top: 8px; }
.usage-bar__fill { height: 100%; background: #6366f1; border-radius: 8px; transition: width .3s; }
.usage-bar__fill--warning { background: #f59e0b; }
.usage-bar__fill--danger { background: #ef4444; }
.plan-card { border: 2px solid #e5e7eb; border-radius: 12px; padding: 24px; position: relative; background: #fff; }
.plan-card--pro { border-color: #6366f1; box-shadow: 0 4px 20px rgba(99,102,241,.15); }
.plan-card--current { opacity: .92; }
.plan-card__badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #6366f1; color: #fff; padding: 2px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.plan-card__header { margin-bottom: 20px; }
.plan-card__header h3 { margin: 0 0 6px; font-size: 20px; color: #111; }
.plan-price { font-size: 28px; font-weight: 800; color: #111; }
.plan-price span { font-size: 14px; font-weight: 400; color: #6b7280; }
.plan-features { list-style: none; padding: 0; margin: 0 0 24px; }
.plan-features li { padding: 7px 0; font-size: 14px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.feature-ok { color: #111 !important; }
.feature-no { color: #9ca3af !important; }
.btn-full { width: 100%; text-align: center; }

/* ── Page header text ── */
.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #111;
}
.page-subtitle {
    color: #6b7280;
    margin: 0;
    font-size: 15px;
}

/* ================================================================
   DARK MODE OVERRIDES — every element, proper contrast
   ================================================================ */

/* Body + page background */
[data-theme="dark"] body,
[data-theme="dark"] .content-wrapper {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Page headers */
[data-theme="dark"] .page-header h1,
[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4,
[data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .page-subtitle,
[data-theme="dark"] .plan-desc,
[data-theme="dark"] .plan-renews,
[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] span:not(.btn):not(.badge):not(.category-badge):not(.tag-badge):not(.plan-badge):not(.plan-card__badge) {
    color: var(--text-primary);
}

/* Labels and helper text */
[data-theme="dark"] label,
[data-theme="dark"] .form-label,
[data-theme="dark"] small,
[data-theme="dark"] .help-text,
[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

/* Cards and containers */
[data-theme="dark"] .card,
[data-theme="dark"] .plan-status-card,
[data-theme="dark"] .analytics-container,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .section-card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .detail-container,
[data-theme="dark"] .search-bar,
[data-theme="dark"] .filter-bar {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Subscription plan cards */
[data-theme="dark"] .plan-card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .plan-card--pro {
    border-color: #6366f1 !important;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .plan-card__header h3,
[data-theme="dark"] .plan-price {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .plan-price span {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .plan-features li {
    border-bottom-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .feature-ok {
    color: #a3e635 !important;
}

[data-theme="dark"] .feature-no {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .plan-badge--free {
    background: var(--bg-elevated) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .usage-bar {
    background: var(--border-color) !important;
}

/* Tables */
[data-theme="dark"] table {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] table thead tr {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] table thead th {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
    font-weight: 600;
}

[data-theme="dark"] table tbody tr {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] table tbody tr:nth-child(even) {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] table tbody tr:hover {
    background-color: var(--bg-elevated) !important;
}

[data-theme="dark"] table td,
[data-theme="dark"] table th {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Low stock section backgrounds */
[data-theme="dark"] .low-stock-section {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] tr[style*="background-color: #fff5f5"],
[data-theme="dark"] tr[style*="background-color: #fffbf0"] {
    background-color: var(--bg-elevated) !important;
}

/* Forms */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--bg-elevated) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-secondary) !important;
    opacity: 1;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: #6366f1 !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

[data-theme="dark"] input[disabled],
[data-theme="dark"] input[readonly] {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* Buttons — outline and secondary */
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-secondary {
    background-color: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .btn-secondary:hover {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--text-secondary) !important;
}

[data-theme="dark"] .btn-outline[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Alerts */
[data-theme="dark"] .alert,
[data-theme="dark"] .alert-success {
    background-color: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
    color: #86efac !important;
}

[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #fcd34d !important;
}

/* Inventory row status badges (inline span styles) */
[data-theme="dark"] span[style*="background-color: #fff5f5"],
[data-theme="dark"] td[style*="background-color: #fff5f5"] {
    background-color: var(--bg-elevated) !important;
}

/* No-items / empty state */
[data-theme="dark"] .empty-state,
[data-theme="dark"] .no-items-message,
[data-theme="dark"] .no-data {
    color: var(--text-secondary) !important;
}

/* Category/tag color badges — keep their colors but ensure border visible */
[data-theme="dark"] .category-badge,
[data-theme="dark"] .tag-badge {
    border-width: 1px !important;
    border-style: solid !important;
}

/* Notification widget */
[data-theme="dark"] .notification-dropdown,
[data-theme="dark"] #notificationDropdown {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .notification-item {
    border-bottom-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-item:hover {
    background-color: var(--bg-elevated) !important;
}

/* Modal */
[data-theme="dark"] .modal-content {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color) !important;
}

/* Low stock section card borders */
[data-theme="dark"] div[style*="border-left: 4px solid #dc3545"],
[data-theme="dark"] div[style*="border-left: 4px solid #ffc107"],
[data-theme="dark"] div[style*="border: 1px solid #f5c6cb"] {
    background-color: var(--card-bg) !important;
    border-color: inherit !important;
    color: var(--text-primary) !important;
}

/* Progress bar track */
[data-theme="dark"] div[style*="background-color: #e9ecef"] {
    background-color: var(--border-color) !important;
}

/* Stat cards numbers */
[data-theme="dark"] .stat-number,
[data-theme="dark"] .stat-value {
    color: var(--text-primary) !important;
}

/* Dashboard chart cards */
[data-theme="dark"] .chart-card,
[data-theme="dark"] .analytics-card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Hide the broken toolbar text */
#toolbarContainer {
    font-size: 0;
    color: transparent;
}
#toolbarContainer * {
    font-size: revert;
    color: revert;
}

/* =================================================================
   SUBSCRIPTION PAGE — matches app design system
   ================================================================= */

/* Stat cards row */
.sub-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .sub-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .sub-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.sub-stat-card {
    min-width: 0;
}

/* Usage bar */
.sub-usage-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.sub-usage-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.sub-usage-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sub-usage-fill {
    height: 100%;
    background: #6366f1;
    border-radius: 99px;
    transition: width .4s ease;
}

.sub-usage-fill--warn  { background: #f59e0b; }
.sub-usage-fill--danger { background: #ef4444; }

.sub-usage-hint {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* Billing info banner */
.sub-billing-info {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    flex-wrap: wrap;
}

.sub-billing-icon { font-size: 22px; flex-shrink: 0; }
.sub-billing-text { flex: 1; font-size: 14px; color: #374151; min-width: 200px; }

/* Plan cards row — two side-by-side matching card style */
.sub-plans-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 8px;
}

@media (max-width: 640px) {
    .sub-plans-row { grid-template-columns: 1fr; }
}

.sub-plan-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}

.sub-plan-card--pro {
    border-color: #6366f1;
    box-shadow: 0 4px 20px rgba(99,102,241,.12);
}

.sub-plan-card--active {
    border-color: #22c55e;
}

.sub-plan-badge-top {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: #6366f1;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 16px;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: .3px;
}

.sub-plan-header {
    margin-bottom: 20px;
    padding-top: 8px;
}

.sub-plan-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.sub-plan-badge--free { background: #f1f5f9; color: #475569; }
.sub-plan-badge--pro  { background: #ede9fe; color: #6d28d9; }

.sub-plan-price {
    font-size: 32px;
    font-weight: 800;
    color: #111;
    line-height: 1;
}

.sub-plan-price span {
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
}

.sub-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    flex: 1;
}

.sub-plan-features li {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
}

.sub-plan-features li:last-child { border-bottom: none; }

.sub-feat-ok { color: #111 !important; font-weight: 500; }
.sub-feat-no { color: #9ca3af !important; }

.sub-plan-cta { margin-top: auto; }

.sub-btn-current {
    width: 100%;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: not-allowed;
    font-size: 14px;
}

/* ── DARK MODE overrides for subscription page ── */
[data-theme="dark"] .sub-usage-section,
[data-theme="dark"] .sub-billing-info {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .sub-usage-label,
[data-theme="dark"] .sub-usage-hint,
[data-theme="dark"] .sub-billing-text {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .sub-usage-bar {
    background: var(--border-color) !important;
}

[data-theme="dark"] .sub-plan-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .sub-plan-card--pro {
    border-color: #6366f1 !important;
    box-shadow: 0 4px 24px rgba(99,102,241,.25) !important;
}

[data-theme="dark"] .sub-plan-card--active {
    border-color: #22c55e !important;
}

[data-theme="dark"] .sub-plan-price {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sub-plan-price span {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .sub-plan-features li {
    border-bottom-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sub-feat-ok { color: #86efac !important; }
[data-theme="dark"] .sub-feat-no { color: var(--text-secondary) !important; }

[data-theme="dark"] .sub-plan-badge--free {
    background: var(--bg-elevated) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .sub-plan-badge--pro {
    background: rgba(99,102,241,.2) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .sub-btn-current {
    background: var(--bg-elevated) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

/* =============================================================
   PAGE-LEVEL FLASH MESSAGES
   Matches inventory-container width/margin exactly so alerts
   align with the card below them on all screen sizes.
   ============================================================= */

.page-flash {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 4px;
    box-sizing: border-box;
}

.page-flash .alert {
    margin-bottom: 0;
}

/* Mobile — mirrors inventory-container responsive override */
@media (max-width: 768px) {
    .page-flash {
        margin: 0 10px;
        width: calc(100% - 20px);
        max-width: 100%;
    }
}

/* Dark mode — alerts already handled globally, no extra needed */

/* =============================================================
   ANALYTICS CARDS — dark/light mode via CSS vars
   Replaces hardcoded inline "background: white; color: #333"
   on dashboard and inventory analytics containers
   ============================================================= */

.analytics-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

[data-theme="dark"] .analytics-card {
    background: var(--bg-tertiary);
    box-shadow: 0 2px 10px var(--shadow);
}

.analytics-card-title {
    margin-bottom: 20px;
    color: #333;
}

[data-theme="dark"] .analytics-card-title {
    color: var(--text-primary);
}

/* =============================================================
   NOTIFICATION DROPDOWN PANEL
   Replaces hardcoded inline style on #notificationDropdown
   ============================================================= */

.notification-dropdown-panel {
    display: none;
    position: fixed;
    top: 155px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 380px;
    max-width: calc(100vw - 40px);
    z-index: 1000;
}

[data-theme="dark"] .notification-dropdown-panel {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px var(--shadow);
}

@media (max-width: 768px) {
    .notification-dropdown-panel {
        top: 60px;
        right: 10px;
        left: auto;
        width: calc(100vw - 20px);
        max-width: 380px;
    }
    
    .analytics-card {
        padding: 15px;
    }
}

/* =============================================================
   NOTIFICATION BELL WIDGET
   Full dark mode + mobile support
   ============================================================= */

.notification-widget {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.notification-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.2s;
    line-height: 1;
}

.notification-bell:hover {
    background: rgba(99, 102, 241, 0.1);
}

.bell-icon {
    font-size: 22px;
    display: block;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

/* Dropdown panel */
.notification-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: 360px;
    max-width: calc(100vw - 20px);
    background: var(--bg-card, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 2000;
    overflow: hidden;
}

[data-theme="dark"] .notification-dropdown-panel {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* Header */
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .notif-header {
    border-bottom-color: var(--border-color);
}

.notif-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

[data-theme="dark"] .notif-header h3 {
    color: var(--text-primary);
}

.notif-unread-count {
    font-size: 12px;
    color: #6366f1;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 999px;
}

/* List */
.notif-list {
    max-height: 380px;
    overflow-y: auto;
}

/* Empty state */
.notif-empty {
    padding: 30px 20px;
    text-align: center;
    color: #94a3b8;
}

.notif-empty span {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
    filter: grayscale(1);
    opacity: 0.5;
}

.notif-empty p {
    margin: 0;
    font-size: 14px;
}

/* Individual notification item */
.notif-item {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

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

.notif-item:hover {
    background: #f8fafc;
}

.notif-item.unread {
    background: #f0f4ff;
    border-left: 3px solid #6366f1;
}

.notif-item.unread:hover {
    background: #e8eeff;
}

[data-theme="dark"] .notif-item {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .notif-item:hover {
    background: var(--bg-elevated);
}

[data-theme="dark"] .notif-item.unread {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid #6366f1;
}

[data-theme="dark"] .notif-item.unread:hover {
    background: rgba(99, 102, 241, 0.14);
}

.notif-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
}

[data-theme="dark"] .notif-title {
    color: var(--text-primary);
}

.notif-item.read .notif-title {
    font-weight: 400;
    color: #475569;
}

[data-theme="dark"] .notif-item.read .notif-title {
    color: var(--text-secondary);
}

.notif-message {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
    line-height: 1.4;
}

[data-theme="dark"] .notif-message {
    color: var(--text-secondary);
}

.notif-time {
    font-size: 11px;
    color: #94a3b8;
}

/* Footer */
.notif-footer {
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

[data-theme="dark"] .notif-footer {
    border-top-color: var(--border-color);
}

.notif-footer a {
    font-size: 13px;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.notif-footer a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
    .notification-dropdown-panel {
        position: fixed;
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 100%;
        border-radius: 12px;
    }

    .notif-list {
        max-height: 300px;
    }
}

/* =============================================================
   NOTIFICATIONS PAGE
   ============================================================= */

.page-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-top-row h2 {
    margin: 0;
    color: var(--text-primary, #1e293b);
}

.notif-page-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notif-page-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 10px;
    border-left: 4px solid transparent;
    background: var(--bg-card, white);
    border: 1px solid var(--border-color, #e2e8f0);
    transition: box-shadow 0.2s;
}

.notif-page-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.notif-page-item.unread {
    border-left: 4px solid #6366f1;
    background: rgba(99, 102, 241, 0.04);
}

[data-theme="dark"] .notif-page-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .notif-page-item.unread {
    background: rgba(99, 102, 241, 0.08);
}

.notif-page-body {
    flex: 1;
}

.notif-page-message {
    margin: 0 0 6px 0;
    font-size: 15px;
    color: var(--text-primary, #1e293b);
    font-weight: 400;
}

.notif-page-item.unread .notif-page-message {
    font-weight: 600;
}

.notif-page-time {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

.notif-page-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.notif-mark-btn {
    flex-shrink: 0;
    align-self: center;
}

@media (max-width: 768px) {
    .notif-page-item {
        flex-direction: column;
    }
    .notif-mark-btn {
        align-self: flex-start;
    }
    .page-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* =============================================================
   TAG SELECTOR — inventory add/edit form
   Full dark mode + checked state + mobile
   ============================================================= */

/* Base tag item */
.tag-item {
    color: var(--text-primary, #333);
}

/* Hover — subtle indigo tint, works in both modes */
.tag-item:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--text-primary, #333);
}

/* Checked/selected state */
.tag-item:has(.tag-checkbox:checked) {
    background-color: rgba(99, 102, 241, 0.15);
    border-left: 3px solid #6366f1;
    padding-left: 5px;
}

/* Dark mode overrides */
[data-theme="dark"] .tag-item {
    color: var(--text-primary, #F0F4F8);
}

[data-theme="dark"] .tag-item:hover {
    background-color: rgba(99, 102, 241, 0.18);
    color: var(--text-primary, #F0F4F8);
}

[data-theme="dark"] .tag-item:has(.tag-checkbox:checked) {
    background-color: rgba(99, 102, 241, 0.22);
}

[data-theme="dark"] .tag-name {
    color: var(--text-primary, #F0F4F8);
}

/* Tags container itself */
.tags-container,
.tag-checkboxes {
    background: var(--bg-input, transparent);
    border-radius: 6px;
    padding: 4px;
}

/* Mobile — larger tap targets */
@media (max-width: 768px) {
    .tag-item {
        padding: 12px 8px;
        margin-bottom: 2px;
    }

    .tag-name {
        font-size: 15px;
    }

    .tag-color-indicator {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .tag-checkbox {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
}

/* =============================================================
   ACTIVITY LOG — Timeline
   ============================================================= */

.log-count {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    background: var(--bg-secondary, #f1f5f9);
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 500;
}

[data-theme="dark"] .log-count {
    background: var(--bg-elevated, #1e2d3d);
    color: var(--text-secondary, #94a3b8);
}

/* Filter bar */
.log-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.log-filter-btn {
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-card, white);
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.log-filter-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.log-filter-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

[data-theme="dark"] .log-filter-btn {
    background: var(--bg-secondary, #0f1e2e);
    border-color: var(--border-color, #1e3a4a);
    color: var(--text-secondary, #94a3b8);
}

[data-theme="dark"] .log-filter-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Timeline */
.log-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.log-entry {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Icon column with vertical connector line */
.log-icon-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 40px;
}

.log-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-secondary, #f1f5f9);
    border: 2px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    z-index: 1;
}

[data-theme="dark"] .log-icon {
    background: var(--bg-elevated, #1e2d3d);
    border-color: var(--border-color, #1e3a4a);
}

.log-line {
    width: 2px;
    flex: 1;
    min-height: 24px;
    background: var(--border-color, #e2e8f0);
    margin: 4px 0;
}

[data-theme="dark"] .log-line {
    background: var(--border-color, #1e3a4a);
}

.log-entry:last-child .log-line {
    display: none;
}

/* Log body */
.log-body {
    flex: 1;
    padding-bottom: 20px;
    min-width: 0;
}

.log-row-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

/* Actor labels */
.actor-you {
    font-weight: 700;
    color: #6366f1;
    font-size: 14px;
}

.actor-delegate {
    font-weight: 600;
    color: #f59e0b;
    font-size: 14px;
}

.actor-other {
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    font-size: 14px;
}

/* Action badges */
.log-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-info {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.badge-neutral {
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-secondary, #64748b);
}

[data-theme="dark"] .badge-success { background: rgba(16,185,129,0.18); color: #34d399; }
[data-theme="dark"] .badge-info    { background: rgba(99,102,241,0.18); color: #818cf8; }
[data-theme="dark"] .badge-danger  { background: rgba(239,68,68,0.18);  color: #f87171; }
[data-theme="dark"] .badge-neutral { background: var(--bg-elevated, #1e2d3d); color: var(--text-secondary, #94a3b8); }

/* Description */
.log-description {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--text-primary, #1e293b);
    line-height: 1.5;
}

[data-theme="dark"] .log-description {
    color: var(--text-primary, #F0F4F8);
}

.log-reason {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    font-style: italic;
}

/* Meta row */
.log-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.log-time {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

.log-ip {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    font-family: monospace;
}

/* Mobile */
@media (max-width: 768px) {
    .log-filter-bar {
        gap: 6px;
    }

    .log-filter-btn {
        padding: 5px 12px;
        font-size: 12px;
    }

    .log-icon-col {
        width: 32px;
    }

    .log-icon {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .log-description {
        font-size: 13px;
    }

    .log-ip {
        display: none;
    }
}

/* =============================================================
   CSV IMPORT PAGE
   ============================================================= */

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin: 2px 0 0;
}

/* Capacity bar */
.import-capacity-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-primary, #1e293b);
    flex-wrap: wrap;
}

[data-theme="dark"] .import-capacity-bar {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--text-primary, #F0F4F8);
}

.import-capacity-bar a {
    color: #6366f1;
    font-weight: 600;
}

/* Two-column layout */
.import-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .import-layout {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.import-card {
    background: var(--bg-card, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

[data-theme="dark"] .import-card {
    background: var(--bg-secondary, #0f1e2e);
    border-color: var(--border-color, #1e3a4a);
}

.import-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .import-card h3 {
    color: var(--text-primary, #F0F4F8);
}

.import-card p {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    margin: 0 0 14px;
    line-height: 1.5;
}

.import-card-muted {
    background: var(--bg-secondary, #f8fafc);
}

[data-theme="dark"] .import-card-muted {
    background: var(--bg-elevated, #1e2d3d);
}

.step-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-secondary, #64748b);
    padding: 2px 8px;
    border-radius: 999px;
}

[data-theme="dark"] .step-badge {
    background: var(--bg-elevated, #1e3a4a);
    color: var(--text-secondary, #94a3b8);
}

.btn-full {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* Dropzone */
.import-dropzone {
    border: 2px dashed var(--border-color, #cbd5e1);
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    margin-bottom: 14px;
    transition: border-color 0.2s, background 0.2s;
    cursor: default;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-dropzone.dragover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
}

.import-dropzone.dropzone-error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

[data-theme="dark"] .import-dropzone {
    border-color: var(--border-color, #1e3a4a);
}

[data-theme="dark"] .import-dropzone.dragover {
    background: rgba(99, 102, 241, 0.12);
}

.dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dropzone-icon {
    font-size: 32px;
    line-height: 1;
}

.dropzone-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0;
}

[data-theme="dark"] .dropzone-text {
    color: var(--text-primary, #F0F4F8);
}

.dropzone-sub {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    margin: 0;
}

/* File selected state */
.dropzone-file-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.file-icon {
    font-size: 20px;
}

.file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    word-break: break-all;
}

[data-theme="dark"] .file-name {
    color: var(--text-primary, #F0F4F8);
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

.file-remove:hover {
    color: #ef4444;
}

/* Supported columns grid */
.column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.column-grid > div {
    font-size: 12px;
    line-height: 1.5;
}

.column-grid strong {
    display: block;
    color: var(--text-primary, #1e293b);
    font-size: 12px;
}

[data-theme="dark"] .column-grid strong {
    color: var(--text-primary, #F0F4F8);
}

.column-grid span {
    color: var(--text-muted, #94a3b8);
}

/* Preview panel */
.import-preview-panel {
    background: var(--bg-card, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

[data-theme="dark"] .import-preview-panel {
    background: var(--bg-secondary, #0f1e2e);
    border-color: var(--border-color, #1e3a4a);
}

.preview-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 4px;
}

[data-theme="dark"] .preview-header h3 {
    color: var(--text-primary, #F0F4F8);
}

.preview-header p {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    margin: 0 0 16px;
}

/* Column mapping pills */
.column-mapping-box {
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

[data-theme="dark"] .column-mapping-box {
    background: var(--bg-elevated, #1e2d3d);
}

.mapping-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mapping-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mapping-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.mapping-pill.pill-missing {
    background: var(--bg-secondary, #f1f5f9);
    border-color: var(--border-color, #e2e8f0);
    opacity: 0.5;
}

[data-theme="dark"] .mapping-pill.pill-missing {
    background: var(--bg-elevated, #1e3a4a);
    border-color: var(--border-color, #1e3a4a);
}

.pill-field {
    font-weight: 600;
    color: #6366f1;
}

.pill-missing .pill-field {
    color: var(--text-secondary, #94a3b8);
}

.pill-arrow {
    color: var(--text-muted, #94a3b8);
}

.pill-col {
    color: var(--text-secondary, #64748b);
}

/* Preview table */
.preview-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 16px;
}

[data-theme="dark"] .preview-table-wrap {
    border-color: var(--border-color, #1e3a4a);
}

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

.preview-table th {
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-secondary, #64748b);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .preview-table th {
    background: var(--bg-elevated, #1e2d3d);
    border-color: var(--border-color, #1e3a4a);
}

.preview-table td {
    padding: 8px 12px;
    color: var(--text-primary, #1e293b);
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="dark"] .preview-table td {
    color: var(--text-primary, #F0F4F8);
    border-color: var(--border-color, #1e3a4a);
}

.preview-table tbody tr:last-child td {
    border-bottom: none;
}

.preview-table tbody tr:hover td {
    background: var(--bg-secondary, #f8fafc);
}

[data-theme="dark"] .preview-table tbody tr:hover td {
    background: var(--bg-elevated, #1e2d3d);
}

/* Actions */
.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .import-layout {
        gap: 16px;
    }

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

    .preview-actions {
        flex-direction: column-reverse;
    }

    .preview-actions .btn {
        width: 100%;
        text-align: center;
    }

    .import-preview-panel {
        position: static;
    }
}

/* ================================================================
   STOQ SHELF — CSS ADDITIONS
   Append these rules to the END of public/css/style.css
   ================================================================ */

/* ── NOTIFICATION DROPDOWN — DARK MODE ──────────────────────────── */

/* The dropdown uses inline style="background:white" in header.php.
   These rules override that with higher specificity in dark mode.   */
[data-theme="dark"] #notificationDropdown {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

[data-theme="dark"] #notificationDropdown strong,
[data-theme="dark"] #notificationDropdown .notification-item div {
    color: var(--text-primary);
}

[data-theme="dark"] #notificationDropdown .notification-item {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] #notificationDropdown .notification-item.unread {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] #notificationDropdown .notification-item:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Muted timestamp text in dropdown */
[data-theme="dark"] #notificationDropdown .notification-item div[style*="color: #aaa"],
[data-theme="dark"] #notificationDropdown .notification-item div[style*="color: #666"] {
    color: var(--text-secondary) !important;
}

/* Dropdown header and footer borders */
[data-theme="dark"] #notificationDropdown div[style*="border-bottom"],
[data-theme="dark"] #notificationDropdown div[style*="border-top"] {
    border-color: var(--border-color) !important;
}

/* "View All Notifications" link */
[data-theme="dark"] #notificationDropdown a {
    color: #4da3ff !important;
}

/* Bell button in nav — ensure correct contrast */
[data-theme="dark"] .notification-bell {
    color: var(--text-secondary);
}

[data-theme="dark"] .notification-bell:hover {
    color: var(--text-primary);
}

/* ── FORM SECTION HEADERS ────────────────────────────────────────── */

.form-section-header {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 6px;
    margin: 28px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-header:first-of-type {
    margin-top: 8px;
}

[data-theme="dark"] .form-section-header {
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

/* ── TWO-COLUMN FORM ROW ────────────────────────────────────────── */

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

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

/* ── INPUT WITH PREFIX ($) ──────────────────────────────────────── */

.input-prefix-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 10px;
    color: #6c757d;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.input-prefix-wrap input[type="number"] {
    padding-left: 22px;
    width: 100%;
}

[data-theme="dark"] .input-prefix {
    color: var(--text-secondary);
}

/* ── PLAN-GATED LOCKED FIELD ────────────────────────────────────── */

.form-group-locked input[disabled] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

[data-theme="dark"] .form-group-locked input[disabled] {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.lock-icon {
    font-size: 13px;
    margin-left: 4px;
}

/* ── PLAN BADGE (inline in form section headers) ────────────────── */

.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: none;
    letter-spacing: 0;
    cursor: default;
}

.plan-badge-pro {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

[data-theme="dark"] .plan-badge-pro {
    background-color: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.3);
}

/* ── REQUIRED FIELD STAR ────────────────────────────────────────── */

.required-star {
    color: #dc3545;
    margin-left: 2px;
}

/* ================================================================
   STOQ SHELF — CSS ADDITIONS
   Append these rules to the END of public/css/style.css
   ================================================================ */

/* ── NOTIFICATION DROPDOWN — DARK MODE ──────────────────────────── */

/* The dropdown uses inline style="background:white" in header.php.
   These rules override that with higher specificity in dark mode.   */
[data-theme="dark"] #notificationDropdown {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

[data-theme="dark"] #notificationDropdown strong,
[data-theme="dark"] #notificationDropdown .notification-item div {
    color: var(--text-primary);
}

[data-theme="dark"] #notificationDropdown .notification-item {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] #notificationDropdown .notification-item.unread {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] #notificationDropdown .notification-item:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Muted timestamp text in dropdown */
[data-theme="dark"] #notificationDropdown .notification-item div[style*="color: #aaa"],
[data-theme="dark"] #notificationDropdown .notification-item div[style*="color: #666"] {
    color: var(--text-secondary) !important;
}

/* Dropdown header and footer borders */
[data-theme="dark"] #notificationDropdown div[style*="border-bottom"],
[data-theme="dark"] #notificationDropdown div[style*="border-top"] {
    border-color: var(--border-color) !important;
}

/* "View All Notifications" link */
[data-theme="dark"] #notificationDropdown a {
    color: #4da3ff !important;
}

/* Bell button in nav — ensure correct contrast */
[data-theme="dark"] .notification-bell {
    color: var(--text-secondary);
}

[data-theme="dark"] .notification-bell:hover {
    color: var(--text-primary);
}

/* ── FORM SECTION HEADERS ────────────────────────────────────────── */

.form-section-header {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 6px;
    margin: 28px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-header:first-of-type {
    margin-top: 8px;
}

[data-theme="dark"] .form-section-header {
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

/* ── TWO-COLUMN FORM ROW ────────────────────────────────────────── */

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

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

/* ── INPUT WITH PREFIX ($) ──────────────────────────────────────── */

.input-prefix-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 10px;
    color: #6c757d;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.input-prefix-wrap input[type="number"] {
    padding-left: 22px;
    width: 100%;
}

[data-theme="dark"] .input-prefix {
    color: var(--text-secondary);
}

/* ── PLAN-GATED LOCKED FIELD ────────────────────────────────────── */

.form-group-locked input[disabled] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

[data-theme="dark"] .form-group-locked input[disabled] {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.lock-icon {
    font-size: 13px;
    margin-left: 4px;
}

/* ── PLAN BADGE (inline in form section headers) ────────────────── */

.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: none;
    letter-spacing: 0;
    cursor: default;
}

.plan-badge-pro {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

[data-theme="dark"] .plan-badge-pro {
    background-color: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.3);
}

/* ── REQUIRED FIELD STAR ────────────────────────────────────────── */

.required-star {
    color: #dc3545;
    margin-left: 2px;
}

/* ================================================================
   ITEM DETAIL VIEW (inventory/view.php)
   ================================================================ */

.item-detail-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 640px) {
    .item-detail-grid {
        grid-template-columns: 1fr;
    }
}

.item-detail-image {
    position: sticky;
    top: 16px;
}

.item-no-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    border: 1px dashed var(--border-color, #dee2e6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.item-detail-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.item-detail-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
}

.item-detail-section:last-child {
    border-bottom: none;
}

.item-detail-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6c757d;
    margin-bottom: 12px;
}

[data-theme="dark"] .item-detail-section-title {
    color: var(--text-secondary);
}

.item-detail-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.item-detail-row:last-child {
    margin-bottom: 0;
}

.item-detail-label {
    font-size: 13px;
    color: #6c757d;
    min-width: 130px;
    flex-shrink: 0;
}

[data-theme="dark"] .item-detail-label {
    color: var(--text-secondary);
}

.item-detail-value {
    font-size: 14px;
    color: var(--text-primary, #333);
    word-break: break-word;
}

.item-detail-value.muted {
    color: #999;
}

.item-detail-timestamps {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #999;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #f0f0f0);
    border-bottom: none;
}

[data-theme="dark"] .item-detail-timestamps {
    color: var(--text-secondary);
    border-top-color: var(--border-color);
}

.stock-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}

/* ================================================================
   PROFILE PAGE
   ================================================================ */

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Plan status card ── */

.plan-status-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 4px;
}

@media (max-width: 640px) {
    .plan-status-card {
        flex-direction: column;
    }
    .plan-status-right {
        width: 100%;
    }
}

[data-theme="dark"] .plan-status-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.plan-status-left {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.plan-status-right {
    min-width: 180px;
    max-width: 200px;
    flex-shrink: 0;
}

/* Plan name pill */
.plan-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.plan-badge-free {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
}

.plan-badge-starter {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.plan-badge-pro {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}

[data-theme="dark"] .plan-badge-free {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .plan-badge-starter {
    background: rgba(3,105,161,0.18);
    color: #7dd3fc;
    border-color: rgba(3,105,161,0.35);
}

[data-theme="dark"] .plan-badge-pro {
    background: rgba(91,33,182,0.2);
    color: #c4b5fd;
    border-color: rgba(91,33,182,0.4);
}

/* Detail rows inside plan card */
.plan-status-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.plan-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.plan-status-label {
    font-size: 13px;
    color: #6c757d;
    min-width: 120px;
}

[data-theme="dark"] .plan-status-label {
    color: var(--text-secondary);
}

.plan-status-value {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary, #333);
}

.feature-yes { color: #28a745; font-weight: 600; }
.feature-no  { color: #999; }

[data-theme="dark"] .feature-yes { color: #6ee7b7; }
[data-theme="dark"] .feature-no  { color: var(--text-secondary); }

/* Mini progress bar for delegate usage */
.plan-status-bar {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: var(--border-color, #dee2e6);
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
}

.plan-status-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

/* ── Delegation cards ── */

.delegation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    gap: 12px;
}

[data-theme="dark"] .delegation-card {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.delegation-card-info {
    flex: 1;
    min-width: 0;
}

/* ================================================================
   STOQ SHELF — CSS ADDITIONS
   Append these rules to the END of public/css/style.css
   ================================================================ */

/* ── NOTIFICATION DROPDOWN — DARK MODE ──────────────────────────── */

/* The dropdown uses inline style="background:white" in header.php.
   These rules override that with higher specificity in dark mode.   */
[data-theme="dark"] #notificationDropdown {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

[data-theme="dark"] #notificationDropdown strong,
[data-theme="dark"] #notificationDropdown .notification-item div {
    color: var(--text-primary);
}

[data-theme="dark"] #notificationDropdown .notification-item {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] #notificationDropdown .notification-item.unread {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] #notificationDropdown .notification-item:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Muted timestamp text in dropdown */
[data-theme="dark"] #notificationDropdown .notification-item div[style*="color: #aaa"],
[data-theme="dark"] #notificationDropdown .notification-item div[style*="color: #666"] {
    color: var(--text-secondary) !important;
}

/* Dropdown header and footer borders */
[data-theme="dark"] #notificationDropdown div[style*="border-bottom"],
[data-theme="dark"] #notificationDropdown div[style*="border-top"] {
    border-color: var(--border-color) !important;
}

/* "View All Notifications" link */
[data-theme="dark"] #notificationDropdown a {
    color: #4da3ff !important;
}

/* Bell button in nav — ensure correct contrast */
[data-theme="dark"] .notification-bell {
    color: var(--text-secondary);
}

[data-theme="dark"] .notification-bell:hover {
    color: var(--text-primary);
}

/* ── FORM SECTION HEADERS ────────────────────────────────────────── */

.form-section-header {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 6px;
    margin: 28px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-header:first-of-type {
    margin-top: 8px;
}

[data-theme="dark"] .form-section-header {
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

/* ── TWO-COLUMN FORM ROW ────────────────────────────────────────── */

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

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

/* ── INPUT WITH PREFIX ($) ──────────────────────────────────────── */

.input-prefix-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 10px;
    color: #6c757d;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.input-prefix-wrap input[type="number"] {
    padding-left: 22px;
    width: 100%;
}

[data-theme="dark"] .input-prefix {
    color: var(--text-secondary);
}

/* ── PLAN-GATED LOCKED FIELD ────────────────────────────────────── */

.form-group-locked input[disabled] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

[data-theme="dark"] .form-group-locked input[disabled] {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.lock-icon {
    font-size: 13px;
    margin-left: 4px;
}

/* ── PLAN BADGE (inline in form section headers) ────────────────── */

.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: none;
    letter-spacing: 0;
    cursor: default;
}

.plan-badge-pro {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

[data-theme="dark"] .plan-badge-pro {
    background-color: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.3);
}

/* ── REQUIRED FIELD STAR ────────────────────────────────────────── */

.required-star {
    color: #dc3545;
    margin-left: 2px;
}

/* ================================================================
   ITEM DETAIL VIEW (inventory/view.php)
   ================================================================ */

.item-detail-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 640px) {
    .item-detail-grid {
        grid-template-columns: 1fr;
    }
}

.item-detail-image {
    position: sticky;
    top: 16px;
}

.item-no-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    border: 1px dashed var(--border-color, #dee2e6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.item-detail-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.item-detail-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
}

.item-detail-section:last-child {
    border-bottom: none;
}

.item-detail-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6c757d;
    margin-bottom: 12px;
}

[data-theme="dark"] .item-detail-section-title {
    color: var(--text-secondary);
}

.item-detail-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.item-detail-row:last-child {
    margin-bottom: 0;
}

.item-detail-label {
    font-size: 13px;
    color: #6c757d;
    min-width: 130px;
    flex-shrink: 0;
}

[data-theme="dark"] .item-detail-label {
    color: var(--text-secondary);
}

.item-detail-value {
    font-size: 14px;
    color: var(--text-primary, #333);
    word-break: break-word;
}

.item-detail-value.muted {
    color: #999;
}

.item-detail-timestamps {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #999;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #f0f0f0);
    border-bottom: none;
}

[data-theme="dark"] .item-detail-timestamps {
    color: var(--text-secondary);
    border-top-color: var(--border-color);
}

.stock-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}

/* ================================================================
   PROFILE PAGE
   ================================================================ */

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Plan status card ── */

.plan-status-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 4px;
}

@media (max-width: 640px) {
    .plan-status-card {
        flex-direction: column;
    }
    .plan-status-right {
        width: 100%;
    }
}

[data-theme="dark"] .plan-status-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.plan-status-left {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.plan-status-right {
    min-width: 180px;
    max-width: 200px;
    flex-shrink: 0;
}

/* Plan name pill */
.plan-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.plan-badge-free {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
}

.plan-badge-starter {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.plan-badge-pro {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}

[data-theme="dark"] .plan-badge-free {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .plan-badge-starter {
    background: rgba(3,105,161,0.18);
    color: #7dd3fc;
    border-color: rgba(3,105,161,0.35);
}

[data-theme="dark"] .plan-badge-pro {
    background: rgba(91,33,182,0.2);
    color: #c4b5fd;
    border-color: rgba(91,33,182,0.4);
}

/* Detail rows inside plan card */
.plan-status-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.plan-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.plan-status-label {
    font-size: 13px;
    color: #6c757d;
    min-width: 120px;
}

[data-theme="dark"] .plan-status-label {
    color: var(--text-secondary);
}

.plan-status-value {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary, #333);
}

.feature-yes { color: #28a745; font-weight: 600; }
.feature-no  { color: #999; }

[data-theme="dark"] .feature-yes { color: #6ee7b7; }
[data-theme="dark"] .feature-no  { color: var(--text-secondary); }

/* Mini progress bar for delegate usage */
.plan-status-bar {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: var(--border-color, #dee2e6);
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
}

.plan-status-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

/* ── Delegation cards ── */

.delegation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    gap: 12px;
}

[data-theme="dark"] .delegation-card {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.delegation-card-info {
    flex: 1;
    min-width: 0;
}

/* ================================================================
   CASHIER SYSTEM
   ================================================================ */

/* ── Cashier item grid ── */

.cashier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

@media (max-width: 480px) {
    .cashier-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

.cashier-item-card {
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
}

.cashier-item-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

[data-theme="dark"] .cashier-item-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.cashier-item-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-secondary, #f8f9fa);
}

.cashier-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cashier-item-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.cashier-item-body {
    padding: 12px 12px 8px;
    flex: 1;
}

.cashier-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
    color: var(--text-primary, #333);
    /* Clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cashier-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 4px;
}

.cashier-item-price {
    font-weight: 700;
    color: #4F46E5;
    font-size: 15px;
}

[data-theme="dark"] .cashier-item-price {
    color: #a5b4fc;
}

.cashier-item-actions {
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-color, #f0f0f0);
}

.cashier-sell-btn {
    flex: 1;
    text-align: center;
}

[data-theme="dark"] .cashier-item-actions {
    border-top-color: var(--border-color);
}

/* ── Cashier nav link badge ── */

.nav-cashier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4F46E5;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.5;
}

/* ── QR code modal overlay (cashier/index.php) ── */

#qrModal {
    display: none;
}

#qrModal.is-open {
    display: flex !important;
}

[data-theme="dark"] #qrModal > div {
    background: var(--bg-secondary);
    color: var(--text-primary);
}