* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.3s;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.3);
}

header h1 {
    font-size: 1.5rem;
}

.version-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.version-number {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

.update-link {
    font-size: 0.8rem;
    color: #FFF9C4;
    text-decoration: underline;
    cursor: pointer;
}

.update-link:hover {
    color: #FFEB3B;
}

/* Hamburger menu overlay */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.menu-overlay.active {
    display: block;
}

.menu-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.menu-overlay.active .menu-content {
    transform: translateX(0);
}

.menu-header {
    background: #2196F3;
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.menu-close:hover {
    opacity: 0.8;
}

.menu-nav {
    padding: 1rem 0;
}

.menu-item {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    background: white;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-item:hover {
    background: #f5f5f5;
}

.menu-item.danger {
    color: #f44336;
}

.menu-item.danger:hover {
    background: #ffebee;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

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

thead {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 10;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

tbody tr {
    cursor: pointer;
}

tbody td {
    border-bottom: 1px solid #ddd;
}

tbody tr:hover {
    background: #f9f9f9;
}

/* Skrytí desktop sloupců na mobilu */
.col-product {
    width: 60%;
}

.col-quantity {
    width: 40%;
    text-align: right;
}

th.col-quantity,
td.quantity-cell {
    text-align: right;
}

.product-cell {
    padding: 0.75rem;
}

.product-code {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
}


.product-name {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.quantity-cell {
    text-align: right;
    padding: 0.75rem;
}

.quantity-value {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
}

footer {
    background: #333;
    padding: 0.75rem;
    text-align: center;
    flex-shrink: 0;
}

.scanner-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.scanner-btn:hover {
    background: #45a049;
}

/* Scanner overlay */
.scanner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
}

.scanner-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-container {
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.scanner-header {
    background: #2196F3;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.scanner-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

#scanner-video-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    overflow: hidden;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #4CAF50;
    box-shadow: 0 0 10px #4CAF50;
    animation: scanLine 2s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% {
        transform: translateY(-50px);
        opacity: 0.5;
    }
    50% {
        transform: translateY(50px);
        opacity: 1;
    }
}

.scanner-status {
    padding: 1rem;
    text-align: center;
    background: #f5f5f5;
}

.scanner-status p {
    margin: 0;
    color: #333;
}

/* Zvýraznění řádku */
tr.highlighted {
    background: #FFF9C4 !important;
    animation: highlight-pulse 1s ease-in-out;
}

tr.selected {
    background: #E3F2FD !important;
    border-top: 2px solid #2196F3;
    border-bottom: 2px solid #2196F3;
}

tr.selected td {
    border-bottom: 2px solid #2196F3;
}

tr.confirmed-row {
    background: #E8F5E9 !important;
}

tr.confirmed-row.selected {
    background: #E3F2FD !important;
    border-top: 2px solid #2196F3;
    border-bottom: 2px solid #2196F3;
}

tr.confirmed-row.selected td {
    border-bottom: 2px solid #2196F3;
}

tr.confirmed-row:hover {
    background: #C8E6C9 !important;
}

tr.confirmed-row.selected:hover {
    background: #E3F2FD !important;
}

@keyframes highlight-pulse {
    0%, 100% { background: #FFF9C4; }
    50% { background: #FFEB3B; }
}

/* Editační panel */
.edit-panel {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    padding: 1rem;
    z-index: 100;
    border-top: 3px solid #2196F3;
}

.edit-panel.active {
    display: block;
}

.edit-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.btn-confirm {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    min-width: 100px;
    background: #4CAF50;
    color: white;
}

.btn-confirm:hover {
    background: #45a049;
}

.quantity-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-quantity {
    width: 50px;
    height: 50px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-quantity:hover {
    background: #1976D2;
}

.btn-quantity:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 100px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0.5rem;
    border: 2px solid #2196F3;
    border-radius: 4px;
}

/* Skrytí šipek u input type="number" */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
}

/* Responsivní tabulka - mobilní zobrazení */
@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
    }
}