/**
 * ManaVault - Inventory & Sales Management System
 * (c) 2024-2026 BTCin Corporate s.r.o.
 * All rights reserved. Unauthorized copying, modification, or distribution prohibited.
 */

:root {
    --primary: #0F172A;
    --secondary: #1E293B;
    --accent: #0891B2;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --bg: #0A0E1A;
    --card: #1A1F2E;
    --sidebar: #2D3748;
    --sidebar-active: #1E293B;
}

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

body {
    font-family: 'Work Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    line-height: var(--leading-normal);
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transition: width var(--transition-slow);
}

.sidebar-header {
    padding: 1.5rem;
    background: var(--primary);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent), #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-section {
    padding: 0.5rem 0;
}

.section-title {
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1rem;
}

.sidebar-menu {
    list-style: none;
}

.menu-item {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text);
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    margin: 1px 0.5rem;
}

.menu-item:hover {
    background: var(--color-accent-subtle);
    border-left-color: var(--accent);
}

.menu-item.active {
    background: var(--sidebar-active);
    border-left-color: var(--accent);
    font-weight: 600;
    color: var(--accent);
}

.menu-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    padding: 1rem 2rem;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
}

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

.time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Views */
.view {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.view.active {
    display: block;
}

/* New Sale View */
.new-sale-view {
    display: grid;
    grid-template-columns: 1fr 400px;
    height: 100%;
}

.sale-main {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.scan-section {
    padding: 2rem;
    background: var(--primary);
    border-bottom: 1px solid var(--border);
}

.scan-input-wrapper {
    position: relative;
}

.scan-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    padding-left: 3.5rem;
    background: var(--secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    color: var(--text);
    font-size: 1.125rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all var(--transition-fast);
}

.scan-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.scan-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

.cart-section {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.cart-header {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-item {
    background: var(--card);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.item-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.item-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--success);
}

.item-remove {
    background: var(--danger);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-left: 1rem;
    transition: all var(--transition-fast);
    font-size: 1.125rem;
}

.item-remove:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-danger);
}

.empty-cart {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-cart-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.sale-sidebar {
    background: var(--card);
    display: flex;
    flex-direction: column;
}

.total-section {
    padding: 2rem;
    background: var(--primary);
    border-bottom: 1px solid var(--border);
}

.total-label {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.total-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--success), #34D399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-section {
    padding: 2rem;
    flex: 1;
}

.section-subtitle {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.payment-option {
    background: var(--secondary);
    border: 2px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.payment-option:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.payment-option.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}

.payment-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.payment-text {
    font-size: 0.875rem;
    font-weight: 600;
}

.receipt-option {
    background: var(--secondary);
    border: 2px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.receipt-option:hover {
    border-color: var(--accent);
}

.receipt-option.active {
    background: #0F172A !important;
    border-color: #10B981 !important;
}

.receipt-label {
    font-size: 0.95rem;
    font-weight: 500;
}

.toggle {
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: var(--radius-full);
    position: relative;
    transition: all var(--transition-fast);
}

.receipt-option.active .toggle {
    background: #10B981 !important;
}

.toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: var(--radius-full);
    top: 3px;
    left: 3px;
    transition: all var(--transition-fast);
}

.receipt-option.active .toggle::after {
    left: 25px;
}

.discount-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.discount-btn {
    background: var(--secondary);
    border: 2px solid var(--border);
    padding: 0.875rem 0.5rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
}

.discount-btn:hover {
    border-color: var(--warning);
    transform: translateY(-2px);
}

.discount-btn.active {
    background: #F59E0B !important;
    border-color: #F59E0B !important;
    color: #0F172A !important;
    box-shadow: var(--shadow-md) !important;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 2rem 2rem 2rem;
}

.btn {
    padding: 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: 'Work Sans', sans-serif;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0891B2);
    color: white;
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
    filter: brightness(1.05);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Offer type buttons (Aukro) */
.offer-type-btn {
    background: var(--secondary);
    color: var(--text-muted);
    border: 2px solid var(--border);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.offer-type-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.offer-type-btn.active {
    background: var(--accent);
    color: var(--text);
    border-color: var(--accent);
}

/* Aukro Wizard Steps */
.aukro-step {
    transition: all var(--transition-slow);
}

.aukro-step:hover {
    opacity: 0.9;
}

.aukro-wizard-step {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sales History View */
.history-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.filters-section {
    padding: 1.5rem 2rem;
    background: var(--primary);
    border-bottom: 1px solid var(--border);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
    font-weight: 600;
}

.filter-input {
    padding: 0.75rem 1rem;
    background: var(--secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Work Sans', sans-serif;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.filter-select {
    padding: 0.75rem 1rem;
    background: var(--secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.btn-filter {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-filter:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.btn-export {
    padding: 0.75rem 1.5rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-success);
}

.table-section {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.data-table {
    width: 100%;
    background: var(--card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

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

.data-table thead {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tbody tr {
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--color-accent-subtle);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.action-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.action-link:hover {
    color: var(--color-accent-hover);
}

.code-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Product Management */
.products-grid {
    display: grid;
    gap: 2rem;
    padding: 2rem;
}

.product-form-card {
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.form-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: var(--tracking-tight);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
    font-weight: 600;
}

.form-input {
    padding: 0.875rem 1rem;
    background: var(--secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 1rem;
    font-family: 'Work Sans', sans-serif;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.products-table-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.delete-btn {
    background: var(--danger);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.delete-btn:hover {
    transform: scale(1.05);
}

.edit-btn {
    background: var(--accent);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.edit-btn:hover {
    transform: scale(1.05);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.bag-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    border: none;
    border-radius: var(--radius-xl);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bag-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.quick-cash-btn {
    padding: 0.5rem 0.75rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: 'JetBrains Mono', monospace;
}

.quick-cash-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Shipment Views */
.shipment-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.shipment-form-card {
    background: var(--card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.shipment-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.shipment-stats .stat-box {
    text-align: center;
    min-width: 120px;
}

.shipment-stats .stat-box .stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.shipment-stats .stat-box .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.receive-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.receive-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-pill {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
}

.stat-pill.waiting {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.stat-pill.received {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.stat-pill.total {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent);
}

.category-selector {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.category-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    border: 2px solid var(--border);
    background: var(--secondary);
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text);
}

.category-btn:hover {
    border-color: var(--accent);
}

.category-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.scan-section {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
}

.shipment-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
}

.shipment-card:hover {
    border-color: var(--accent);
}

.shipment-card-info h4 {
    margin: 0 0 0.5rem 0;
}

.shipment-card-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.shipment-card-stats {
    text-align: right;
}

.shipment-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 600;
}

.shipment-status.na-ceste {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.shipment-status.probiha {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.shipment-status.dokonceno {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.btn-undo {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.btn-undo:hover {
    background: var(--warning);
    border-color: var(--warning);
}

.amazon-link {
    text-decoration: none;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.amazon-link:hover {
    opacity: 1;
}

/* Category/Status buttons for edit modal */
.category-btn, .status-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.category-btn:hover, .status-btn:hover {
    border-color: var(--accent);
    background: var(--secondary);
}

.category-btn.active, .status-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.btn-edit-item {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.btn-edit-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Data Management View */
.data-management-container {
    padding: 2rem;
}

.data-section {
    background: var(--card);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.data-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.data-section-header h3 {
    margin: 0;
}

.btn-warning {
    background: var(--warning);
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-warning:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.btn-danger-sm {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-edit-sm {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-right: 0.5rem;
}

.btn-danger-sm:hover, .btn-edit-sm:hover {
    transform: scale(1.05);
}

/* Receiving View */
.receiving-container {
    padding: 2rem;
}

.receiving-header {
    text-align: center;
    margin-bottom: 2rem;
}

.receiving-header h2 {
    margin-bottom: 0.5rem;
}

.shelf-selector {
    background: var(--card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
}

.shelf-selector h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.shelf-btn {
    aspect-ratio: 1;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--border);
    background: var(--secondary);
    color: var(--text);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.shelf-btn:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

.shelf-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.receiving-scanner {
    background: var(--card);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    text-align: center;
}

.selected-shelf-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.shelf-badge {
    background: var(--accent);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.receiving-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
}

.stat-box {
    text-align: center;
}

.stat-box .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.stat-box .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.recently-received {
    margin-top: 2rem;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.recently-received h4 {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.received-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 0.5rem;
}

.received-item .item-name {
    font-weight: 600;
}

.received-item .item-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Repricing View */
.repricing-container {
    padding: 2rem;
}

.repricing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.repricing-header h2 {
    margin: 0;
}

.repricing-summary {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.repricing-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.dot.green { background: #22c55e; }
.dot.yellow { background: #eab308; }
.dot.orange { background: #f97316; }
.dot.red { background: #ef4444; }

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.status-dot.green { background: #22c55e; }
.status-dot.yellow { background: #eab308; }
.status-dot.orange { background: #f97316; }
.status-dot.red { background: #ef4444; }

.price-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
}

.new-price {
    color: var(--success);
    font-weight: 700;
}

.confirm-btn {
    background: var(--success);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.confirm-btn:hover {
    transform: scale(1.05);
}

.not-found-btn {
    background: var(--warning);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.not-found-btn:hover {
    transform: scale(1.05);
}

/* Not Found View */
.not-found-container {
    padding: 2rem;
}

.not-found-header {
    margin-bottom: 1.5rem;
}

.not-found-header h2 {
    margin-bottom: 0.5rem;
}

.found-btn {
    background: var(--success);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    margin-right: 0.5rem;
}

.write-off-btn {
    background: var(--danger);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
}

/* Stats View */
.stats-section {
    background: var(--secondary);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    margin: 1rem 2rem;
    box-shadow: var(--shadow-sm);
}

.stats-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stats-section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text);
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
}

.date-nav span {
    min-width: 150px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
}

.nav-btn {
    background: var(--accent);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    transform: scale(1.1);
}

.nav-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
}

.period-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.period-input {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.period-input:focus {
    outline: none;
    border-color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-description {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Staff sees only basic stats */
/* DEPRECATED: Starý role-based systém - nyní řeší applyPermissions() v core.js */

.staff-stats {
    display: none;
}

body.role-staff .staff-stats {
    display: block;
}

/* Admin-only content (not menu items - those are controlled by applyPermissions) */
#view-new-sale .admin-only {
    display: block;
}

body.role-staff #view-new-sale .admin-only {
    display: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card);
    padding: 2.5rem;
    border-radius: var(--radius-2xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

/* Large modal for forms with many fields */
.modal-content.modal-lg {
    max-width: 700px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--success), #34D399);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
}

.modal-body {
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: 2rem;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.page-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.print-content {
    display: none;
}

@media print {
    body > *:not(.print-content) {
        display: none !important;
    }
    
    .print-content {
        display: block !important;
        font-family: monospace;
        white-space: pre;
        padding: 20px;
        font-size: 12pt;
        color: black;
        background: white;
    }
}

/* Edit Sale Modal Styles */
.modal-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.edit-sale-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.edit-sale-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.btn-icon-danger {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-icon-danger:hover {
    background: var(--danger);
    transform: scale(1.1);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

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

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

.logout-item {
    color: var(--danger) !important;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem !important;
}

.logout-item:hover {
    background: var(--danger) !important;
    color: white !important;
}

/* DEPRECATED: Starý role-based systém - nyní řeší applyPermissions() v core.js */
/* Admin a manager only elementy jsou nyní kontrolovány centrálně podle oprávnění */

/* Attendance message styles */
.attendance-message {
    padding: 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.attendance-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.attendance-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.attendance-message.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.attendance-message.info {
    background: rgba(6, 182, 212, 0.2);
    color: var(--info);
    border: 1px solid var(--info);
}

/* Attendance tab buttons */
.attendance-tab-btn {
    transition: all var(--transition-fast);
}

.attendance-tab-btn.active {
    background: var(--primary) !important;
    color: white !important;
}

/* VAT toggle buttons */
.vat-toggle {
    display: flex;
    gap: 0.25rem;
}

.vat-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    background: var(--secondary);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.vat-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.vat-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

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

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .pos-layout {
        flex-direction: column;
    }
    
    .pos-right {
        width: 100%;
        max-width: none;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    
    .filter-row {
        flex-wrap: wrap;
    }
    
    .filter-group {
        min-width: 150px;
        flex: 1 1 150px;
    }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left var(--transition-slow);
        flex-direction: column;
        overflow-y: auto;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .menu-section {
        display: block;
    }
    
    .menu-section-title {
        padding: 0.5rem 1rem;
    }
    
    .menu-item {
        padding: 0.75rem 1rem;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* Overlay when menu is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .view-title {
        font-size: 1.25rem;
    }
    
    .filter-section {
        padding: 1rem;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .table-section {
        padding: 0.5rem;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Hide less important columns on mobile */
    .data-table th:nth-child(2),
    .data-table td:nth-child(2),
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    .data-table th:nth-child(6),
    .data-table td:nth-child(6) {
        display: none;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-link {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* POS Layout Mobile */
    .pos-layout {
        flex-direction: column;
        height: auto;
    }
    
    .pos-left {
        padding: 1rem;
    }
    
    .pos-right {
        padding: 1rem;
    }
    
    .cart-items {
        max-height: 200px;
    }
    
    .discount-buttons {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .discount-btn {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .payment-options {
        flex-direction: row;
    }
    
    .payment-btn {
        flex: 1;
        padding: 0.75rem;
    }
    
    /* Forms */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-buttons button {
        width: 100%;
    }
    
    /* Stats cards */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}

/* Small mobile (max 480px) */
@media (max-width: 480px) {
    .sidebar-header .logo {
        font-size: 1.25rem;
    }
    
    .view-title {
        font-size: 1.1rem;
    }
    
    .total-amount {
        font-size: 1.5rem;
    }
    
    .complete-btn {
        font-size: 1rem;
        padding: 0.875rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    /* Hide even more columns */
    .data-table th:nth-child(7),
    .data-table td:nth-child(7) {
        display: none;
    }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }
}

/* Ensure tables scroll horizontally on small screens */
.data-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table table {
    min-width: 600px;
}

/* Compact invoice items table */
#invoiceItemsContainer th,
#invoiceItemsContainer td {
    padding: 0.5rem 10px;
}

/* Touch-friendly buttons */
@media (max-width: 768px) {
    button, .btn, .action-link, .menu-item {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Shipment type toggle */
.shipment-type-toggle, .currency-toggle {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn, .currency-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    background: var(--secondary);
    color: var(--text);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.95rem;
}

.toggle-btn:hover, .currency-btn:hover {
    background: var(--card);
}

.toggle-btn.active, .currency-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-success:hover {
    filter: brightness(1.1);
}

/* ==================== ACCOUNTING EXPORT ==================== */

.export-period-selector {
    background: var(--secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.period-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.period-tab {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.period-tab:hover {
    border-color: var(--accent);
}

.period-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.period-options {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.period-options .form-input {
    min-width: 180px;
}

.export-modules {
    background: var(--secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.export-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.export-module-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.export-module-card:hover {
    border-color: var(--accent);
}

.export-module-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}

.export-module-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.export-count {
    margin-left: auto;
    background: var(--border);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

.export-count.has-data {
    background: var(--accent);
    color: white;
}

.export-module-options {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.export-format-selector {
    background: var(--secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.format-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.format-btn {
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
    font-weight: 500;
}

.format-btn:hover {
    border-color: var(--accent);
}

.format-btn.active {
    border-color: var(--accent);
    background: rgba(8, 145, 178, 0.15);
}

.export-actions {
    text-align: center;
    padding: 1.5rem;
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .period-tabs {
        flex-wrap: wrap;
    }

    .period-tab {
        flex: 1 1 45%;
    }

    .period-options {
        flex-direction: column;
        align-items: stretch;
    }

    .format-buttons {
        flex-direction: column;
    }

    .format-btn {
        width: 100%;
    }
}

/* ==================== AUDIT LOG ==================== */

.audit-log-container {
    max-width: 1400px;
    margin: 0 auto;
}

.audit-filters {
    background: var(--secondary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.audit-filters .form-group {
    margin: 0;
}

.audit-filters label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: block;
}

/* Audit Badge Styles */
.audit-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.audit-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.audit-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.audit-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.audit-badge-info {
    background: rgba(8, 145, 178, 0.15);
    color: #0891B2;
    border: 1px solid rgba(8, 145, 178, 0.3);
}

.audit-badge-muted {
    background: rgba(148, 163, 184, 0.15);
    color: #94A3B8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Audit Log Table */
#auditLogTable tr:hover {
    background: var(--color-accent-subtle);
}

#auditLogTable td {
    vertical-align: middle;
    padding: 0.75rem;
}

/* Audit changes display */
.audit-change-old {
    color: var(--danger);
    text-decoration: line-through;
}

.audit-change-new {
    color: var(--success);
}

.audit-change-arrow {
    color: var(--text-muted);
    margin: 0 0.25rem;
}

/* ==================== Stock Movements (Fáze 2.2) ==================== */

.stock-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
}

.stock-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.stock-tab:hover {
    color: var(--text);
}

.stock-tab.active {
    color: var(--text);
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
    margin-bottom: -2px;
}

.stock-tab-content {
    display: none;
}

.stock-tab-content.active {
    display: block;
}

/* Movement type badges */
.type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.type-receipt {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.type-issue {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.type-transfer {
    background: rgba(8, 145, 178, 0.15);
    color: var(--accent);
}

.type-adjustment {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Warehouse location types */
.type-warehouse {
    background: rgba(8, 145, 178, 0.15);
    color: var(--accent);
}

.type-zone {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.type-rack {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.type-shelf {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.type-bin {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

/* Reference badges */
.ref-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--secondary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Search results dropdown */
.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--secondary);
}

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

/* Status badges for warehouse */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-inactive {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

/* ==================== Stock Alerts (Fáze 2.3) ==================== */

.alert-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
}

.alert-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.alert-tab:hover {
    color: var(--text);
}

.alert-tab.active {
    color: var(--text);
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
    margin-bottom: -2px;
}

.alert-tab-content {
    display: none;
}

.alert-tab-content.active {
    display: block;
}

/* Alert type badges */
.alert-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.alert-low_stock {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.alert-out_of_stock {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.alert-restocked {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* Stock count display */
.stock-count {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.stock-zero {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.stock-low {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Alert status badges */
.status-unread {
    background: rgba(8, 145, 178, 0.15);
    color: var(--accent);
}

.status-read {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

.status-dismissed {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Unread row highlight */
.alert-unread {
    background: rgba(8, 145, 178, 0.05);
}

.alert-dismissed {
    opacity: 0.6;
}

/* Menu badge for alerts */
.menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Toggle switch for settings */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary);
    transition: var(--transition-slow);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: var(--transition-slow);
    border-radius: var(--radius-full);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
    background-color: white;
}

/* Min stock input */
.min-stock-input {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* ==================== SUPPLIER DETAIL ==================== */

.supplier-detail .detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.supplier-detail .detail-section h4 {
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.supplier-detail .detail-section p {
    margin: 0.35rem 0;
    font-size: 0.9rem;
}

.supplier-detail .detail-section-full {
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.supplier-detail .detail-notes {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--secondary);
    border-radius: var(--radius-lg);
}

.supplier-detail .detail-notes h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Mini table for supplier detail */
.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.mini-table th,
.mini-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.mini-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.mini-table tr:hover {
    background: var(--color-accent-subtle);
}

.mini-table .status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* ============================================================================
   WAREHOUSE TREE VIEW (v1.1.0)
   ============================================================================ */

.warehouse-tree-container {
    background: var(--secondary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.warehouse-tree {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tree-node {
    margin-bottom: 2px;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: var(--primary);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.tree-node-header.has-children {
    cursor: pointer;
}

.tree-node-header.has-children:hover {
    background: var(--border);
}

.tree-node.level-0 > .tree-node-header {
    background: linear-gradient(135deg, var(--accent) 0%, #4a90d9 100%);
    color: white;
    font-weight: 600;
}

.tree-node.level-1 > .tree-node-header {
    background: var(--border);
    font-weight: 500;
}

.tree-node.level-2 > .tree-node-header {
    background: var(--primary);
}

.tree-toggle {
    width: 16px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.tree-node.level-0 .tree-toggle {
    color: rgba(255,255,255,0.8);
}

.tree-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tree-code {
    font-family: monospace;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 100px;
}

.tree-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-node.level-0 .tree-name {
    color: rgba(255,255,255,0.9);
}

.tree-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
    padding: 0.2rem 0.5rem;
    background: rgba(0,0,0,0.1);
    border-radius: var(--radius-sm);
}

.tree-count.has-items {
    background: var(--success);
    color: white;
}

.tree-node.level-0 .tree-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

.tree-type {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
}

.tree-status {
    font-size: 0.8rem;
    width: 20px;
    text-align: center;
}

.tree-status.status-active {
    color: var(--success);
}

.tree-status.status-inactive {
    color: var(--text-muted);
}

.tree-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tree-node-header:hover .tree-actions {
    opacity: 1;
}

.tree-actions .btn-icon {
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: var(--radius-sm);
}

.tree-actions .btn-icon:hover {
    background: rgba(255,255,255,0.3);
}

.tree-children {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
    margin-top: 2px;
}

.tree-children.collapsed {
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* Type badges in tree */
.tree-type.type-warehouse {
    background: var(--accent);
    color: white;
}

.tree-type.type-zone {
    background: var(--warning);
    color: #333;
}

.tree-type.type-rack {
    background: var(--info);
    color: white;
}

.tree-type.type-shelf {
    background: var(--success);
    color: white;
}

.tree-type.type-bin {
    background: var(--text-muted);
    color: white;
}

/* Small button variant */
.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

/* ==================== DASHBOARD (v2.7.0) ==================== */

.dashboard-view {
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-period-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-period-btn {
    background: var(--secondary);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all var(--transition-fast);
}

.dashboard-period-btn:hover {
    background: var(--card);
    border-color: var(--accent);
}

.dashboard-period-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.dashboard-custom-dates {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* KPI Cards */
.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
}

.kpi-change {
    margin-top: 0.25rem;
}

.kpi-detail {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.dashboard-chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.chart-container {
    position: relative;
    height: 250px;
}

.chart-container-sm {
    height: 200px;
}

/* Dashboard Sections */
.dashboard-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.dashboard-section .section-header {
    margin-bottom: 1rem;
}

.dashboard-section .section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Top Products List */
.top-products-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--secondary);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
}

.top-product-item:hover {
    background: var(--primary);
}

.top-product-rank {
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    min-width: 24px;
}

.top-product-info {
    flex: 1;
}

.top-product-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.top-product-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* E-Commerce Order Cards */
.ecom-orders-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ecom-order-card {
    background: var(--card);
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--border);
    overflow: hidden;
}

.ecom-order-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.ecom-order-body {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ecom-order-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ecom-order-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-wrap: wrap;
}