body { 
    font-family: 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0; 
    padding: 0;
    background: #f5f5f5;
    overflow-x: hidden; /* Previene scroll orizzontale */
}

.container { 
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%; /* Assicura che non superi il viewport */
    box-sizing: border-box; /* Include padding nel calcolo della larghezza */
}

/* Mobile-first responsive padding */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    overflow-wrap: break-word;
    word-wrap: break-word;
    line-height: 1.3;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    h1 {
        font-size: 2.2rem;
    }
}

h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    overflow-wrap: break-word;
    word-wrap: break-word;
    line-height: 1.3;
}

@media (min-width: 768px) {
    h2 {
        font-size: 1.6rem;
        margin-bottom: 1.25rem;
    }
}

@media (min-width: 1024px) {
    h2 {
        font-size: 1.8rem;
    }
}

h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    overflow-wrap: break-word; /* Permette la rottura delle parole lunghi */
    word-wrap: break-word;
}

@media (min-width: 768px) {
    h3 {
        font-size: 1.8rem;
    }
}

/* Riduzione dimensione emoji nei titoli su mobile */
@media (max-width: 767px) {
    h1, h2, h3 {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

nav { 
    /* reset to defaults to prevent full-width gradient bars */
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
    display: inline;
}

/* Ensure layout navs render correctly */
.desktop-nav {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.mobile-nav {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

@media (min-width: 768px) {
    nav {
        padding: 1rem 2rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
    }
}

nav a { 
    display: inline-block;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    nav a {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

nav a:hover {
    background: rgba(255,255,255,0.2);
}

table:not(.listini-table):not(.righe-table) { 
    border-collapse: collapse; 
    width: 100%; 
    margin-top: 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    display: block;
    overflow-x: auto;
}

.prezzi-table table {
    display: table !important;
    border-collapse: collapse !important;
    box-shadow: none !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
    width: 100% !important;
}

@media (min-width: 768px) {
    table {
        display: table;
    }
}

th, td { 
    border: none;
    padding: 0.75rem;
    text-align: left;
}

/* Tabelle dentro scheda articolo: reset stili globali */
.listini-table {
    display: table !important;
    border-collapse: collapse !important;
    box-shadow: none !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
    width: 100% !important;
}

.listini-table th,
.listini-table td,
.prezzi-table table th,
.prezzi-table table td {
    padding: 0.3rem 0.25rem !important;
    min-width: 0 !important;
    background: transparent !important;
    color: #333 !important;
    position: static !important;
    z-index: auto !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: normal !important;
    border: none !important;
}

/* min-width solo per tabelle generiche, non per .righe-table, .listini-table, tabelle in .prezzi-table */
table:not(.righe-table):not(.listini-table) th,
table:not(.righe-table):not(.listini-table) td {
    min-width: 100px;
}

.prezzi-table table th,
.prezzi-table table td {
    min-width: 0;
}

@media (min-width: 768px) {
    th, td {
        padding: 1rem;
    }
}

th { 
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Reset header per tabelle in scheda articolo */
.listini-table thead th {
    background: transparent !important;
    color: #333 !important;
    font-size: 0.7rem !important;
    position: static !important;
    z-index: auto !important;
    font-weight: 600 !important;
}

.prezzi-table table td {
    background: transparent !important;
    color: #333 !important;
    font-size: 0.7rem !important;
    position: static !important;
    z-index: auto !important;
}

@media (min-width: 768px) {
    th {
        font-size: 0.85rem;
    }
}

tr:nth-child(even) {
    background: #f8f9fa;
}

tr:hover {
    background: #e9ecef;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-radius: 6px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(102,126,234,0.3);
    width: 100%;
}

@media (min-width: 768px) {
    button {
        width: auto;
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        margin-bottom: 0;
    }
}

button:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102,126,234,0.4);
}

button:active {
    transform: translateY(0);
}

input, select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    margin-right: 0;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    input, select {
        width: auto;
        margin-right: 0.5rem;
        margin-bottom: 0;
    }
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

.search-bar {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .search-bar {
        padding: 1.5rem;
        flex-wrap: nowrap;
    }
}

.content {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .content {
        padding: 2rem;
    }
}

.stats-card {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: block;
    width: 100%;
}

@media (min-width: 768px) {
    .stats-card {
        display: inline-block;
        width: auto;
        padding: 1.5rem;
        margin-right: 1rem;
        margin-bottom: 1.5rem;
    }
}

.stats-card h4 {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 0.85rem;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .stats-card h4 {
        font-size: 0.9rem;
    }
}

.stats-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

@media (min-width: 768px) {
    .stats-card .value {
        font-size: 1.8rem;
    }
}

#blazor-error-ui {
    background: #ffeb3b;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-weight: 500;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    #blazor-error-ui {
        padding: 1rem 2rem;
    }
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    font-weight: bold;
}

@media (min-width: 768px) {
    #blazor-error-ui .dismiss {
        right: 1.5rem;
        font-size: 1.5rem;
    }
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .loading {
        padding: 3rem;
        font-size: 1.2rem;
    }
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

@media (min-width: 768px) {
    .empty-state {
        padding: 4rem;
    }
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

@media (min-width: 768px) {
    .empty-state svg {
        width: 64px;
        height: 64px;
    }
}

.card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .card {
        padding: 1.5rem;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    margin-right: 0;
}

.btn-primary {
    background: #667eea;
}

.btn-secondary {
    background: #6c757d;
}

.btn-success {
    background: #28a745;
}

.btn-danger {
    background: #dc3545;
}

/* Mobile modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .modal-content {
        max-height: 80vh;
    }
}

/* Modal sections */
@media (max-width: 767px) {
    /* Make grid single column on very small screens */
    .card > div[style*="grid-template-columns"] {
        grid-template-columns: 100px 1fr !important;
        font-size: 0.9rem;
    }
    
    /* Stack buttons vertically on mobile */
    .card > div[style*="justify-content: flex-end"] {
        flex-direction: column !important;
    }
    
    .card > div[style*="justify-content: flex-end"] button {
        max-width: 100% !important;
    }
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Touch-friendly tap targets */
@media (max-width: 767px) {
    button, a, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Hide desktop-only columns on mobile */
    .desktop-only {
        display: none !important;
    }
    
    /* Make table cells more compact on mobile - EXCLUDE .righe-table */
    table:not(.righe-table) th, 
    table:not(.righe-table) td {
        padding: 0.75rem 0.5rem;
        font-size: 0.95rem;
    }
    
    table:not(.righe-table) th {
        font-size: 0.85rem;
    }
    
    /* Stack search bar elements vertically */
    .search-bar input {
        margin-bottom: 0.5rem;
    }
    
    /* Better spacing for card sections on mobile */
    .card h4 {
        font-size: 1rem !important;
    }
}

@media (min-width: 768px) {
    .desktop-only {
        display: table-cell !important;
    }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 767px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* ========================================================
   ARTICOLO DETAIL MODAL - MOBILE FRIENDLY
   ======================================================== */

.articolo-detail-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

@media (min-width: 768px) {
    .modal-header {
        padding: 1.5rem;
    }
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

@media (min-width: 768px) {
    .modal-header h3 {
        font-size: 1.5rem;
    }
}

.btn-close {
    background: transparent;
    color: #999;
    font-size: 1.5rem;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    box-shadow: none;
}

@media (min-width: 768px) {
    .btn-close {
        font-size: 1.8rem;
        width: 36px;
        height: 36px;
    }
}

.btn-close:hover {
    background: #f0f0f0;
    color: #666;
    transform: none;
}

.modal-body {
    padding: 0.75rem;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

@media (min-width: 768px) {
    .modal-body {
        padding: 1rem;
        max-height: calc(80vh - 160px);
    }
}

.detail-section {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .detail-section {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
}

.section-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}

.section-primary {
    background: #f8f9fa;
}

.section-primary .section-title {
    color: #667eea;
}

.section-magazzino {
    background: #e3f2fd;
}

.section-magazzino .section-title {
    color: #1976d2;
}

.section-fornitore {
    background: #fff3e0;
}

.section-fornitore .section-title {
    color: #e65100;
}

.section-acquisto {
    background: #ffebee;
}

.section-acquisto .section-title {
    color: #c62828;
}

.section-info {
    background: #e3f2fd;
}

.section-info .section-title {
    color: #1976d2;
}

.detail-grid {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .detail-grid {
        grid-template-columns: 140px 1fr;
        gap: 0.75rem;
        font-size: 1rem;
    }
}

.detail-grid strong {
    color: #555;
    font-weight: 600;
}

.value-monospace {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .value-monospace {
        font-size: 0.95rem;
    }
}

.value-text {
    font-weight: 500;
}

.value-price {
    color: #e65100;
    font-weight: 600;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .value-price {
        font-size: 1.05rem;
    }
}

.value-price-highlight {
    color: #dc3545;
    font-size: 1.1rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    .value-price-highlight {
        font-size: 1.25rem;
    }
}

.value-badge {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    font-weight: 600;
}

/* Giacenza editing */
.giacenza-edit {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.giacenza-input {
    width: 80px !important;
    text-align: center;
    padding: 0.5rem !important;
    border: 2px solid #667eea !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .giacenza-input {
        width: 100px !important;
    }
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    min-height: 36px;
    min-width: 36px;
    width: auto !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .btn-sm {
        padding: 0.5rem 1rem;
    }
}

.giacenza-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.giacenza-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
}

@media (min-width: 768px) {
    .giacenza-value {
        font-size: 1.5rem;
    }
}

.btn-edit {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    width: auto !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .btn-edit {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

.btn-edit:hover {
    background: #5568d3;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

@media (min-width: 768px) {
    .modal-footer {
        padding: 1.25rem 1.5rem;
    }
}

.btn-block {
    width: 100%;
    max-width: none !important;
}

@media (min-width: 768px) {
    .btn-block {
        width: auto;
        max-width: 200px !important;
    }
}

/* Smooth scrolling for modal body */
.modal-body {
    -webkit-overflow-scrolling: touch;
}

/* Better touch targets on mobile */
@media (max-width: 767px) {
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .articolo-detail-modal {
        border-radius: 8px;
    }
    
    .modal-header,
    .modal-footer {
        border-radius: 8px 8px 0 0;
    }
    
    .modal-footer {
        border-radius: 0 0 8px 8px;
    }
    
    /* Ensure buttons are touch-friendly */
    .btn-close {
        min-width: 44px;
        min-height: 44px;
    }
    
    .btn-edit,
    .btn-sm {
        min-height: 40px;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ===================================================
   MAIN LAYOUT - MOBILE NAVIGATION
   CSS GLOBALE (fallback se CSS Isolation fallisce)
   =================================================== */

/* Ensure mobile menu shows correctly on mobile */
@media (max-width: 767px) {
    .mobile-header { 
        display: flex !important; 
    }
    .desktop-header { 
        display: none !important; 
    }
    .hamburger-btn {
        display: flex !important;
        position: relative;
        z-index: 1000;
    }
}

/* Mobile Hamburger Button */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    box-shadow: none !important;
    margin: 0 !important;
    position: relative;
    min-width: 36px !important;
    min-height: 36px !important;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn:hover span {
    background: #f0f0f0;
}

/* Hamburger animation when menu is open */
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    animation: fadeInOverlay 0.3s ease;
    display: block;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: white;
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2);
}

.mobile-sidebar.open {
    left: 0;
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-brand-icon {
    font-size: 1.8rem;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.mobile-brand-text h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.mobile-brand-text small {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.mobile-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 2.2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: none !important;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.mobile-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
    background: transparent !important;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.mobile-nav-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
}

.mobile-nav-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.mobile-nav-icon {
    font-size: 1.6rem;
    width: 32px;
    text-align: center;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.mobile-nav-text {
    font-size: 1rem;
    flex: 1;
}

.mobile-sidebar-footer {
    border-top: 1px solid #e0e0e0;
    padding: 1rem;
    background: #f8f9fa;
}

.mobile-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 !important;
    box-shadow: none !important;
}

.logout-icon {
    font-size: 1.2rem;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
}

.mobile-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.title-icon {
    font-size: 1.3rem;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.title-text {
    font-weight: 600;
}

.mobile-logout-icon {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    margin: 0 !important;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.mobile-logout-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Desktop Header */
.desktop-header {
    display: none;
}

@media (min-width: 768px) {
    .mobile-header,
    .mobile-sidebar,
    .mobile-overlay,
    .hamburger-btn {
        display: none !important;
    }

    .desktop-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 1rem 1.5rem;
    }
}

.desktop-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    font-size: 1.5rem;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.desktop-brand h5 {
    margin: 0;
}

.desktop-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.desktop-nav {
    display: flex;
    gap: 0.5rem;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.desktop-nav a {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.desktop-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.desktop-nav a.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.desktop-logout-btn {
    background: #dc3545;
    border: none;
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.95rem;
    box-shadow: none !important;
    margin: 0 !important;
}

.desktop-logout-btn:hover {
    background: #c82333;
}

.top-row {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Body scroll lock when menu is open */
body.menu-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    body.menu-open {
        overflow: auto;
    }
}

/* Sort header buttons for table headers */
.sort-header-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sort-header-btn:hover {
    color: #667eea;
}

/* Row link buttons for clickable table rows */
.row-link-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}

.row-link-btn:hover {
    text-decoration: underline;
}
