/* ==========================================
   Oko Sklad — Premium UI System
   ========================================== */

:root {
    --brand-primary: #5BC2E7;
    --brand-secondary: #29B489;
    --brand-dark: #0f172a;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--slate-800);
    background-color: var(--slate-50);
}

/* === SCROLLBAR === */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* === SIDEBAR === */
#sidebar {
    background-color: var(--slate-900);
    color: white;
    border-right: none;
}

.sidebar-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--slate-400);
    border-radius: 12px;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-item.active {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 194, 231, 0.3);
}

.sidebar-item.active i {
    color: white;
}

/* === CARDS & CONTAINERS === */
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-card {
    background: white;
    border: 1px solid var(--slate-100);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 24px rgba(0,0,0,0.06);
}

/* === TABLE STYLES === */
#data-table {
    border-spacing: 0;
}

#data-table thead th {
    background-color: var(--slate-50);
    color: var(--slate-500);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--slate-200);
}

#data-table tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--slate-100);
    transition: background-color 0.15s;
}

#data-table tbody tr:last-child td {
    border-bottom: none;
}

#data-table tbody tr:hover td {
    background-color: var(--slate-50);
}

/* === BADGES === */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-instock { background-color: #ecfdf5; color: #059669; }
.badge-lowstock { background-color: #fffbeb; color: #d97706; }
.badge-outstock { background-color: #fef2f2; color: #dc2626; }

/* === BUTTONS === */
.btn-primary {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 6px rgba(91, 194, 231, 0.2);
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #48b2d6;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(91, 194, 231, 0.3);
}

/* === MODALS === */
.modal-backdrop {
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

/* === IMAGE THUMBNAILS === */
.img-preview {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* === ANIMATIONS === */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out forwards;
}

/* Mobile Quick Actions */
.mobile-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background-color: var(--brand-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(91, 194, 231, 0.4);
    z-index: 50;
    border: none;
}

/* Transaction List Item */
.history-item {
    border-left: 4px solid var(--slate-200);
    padding: 12px 16px;
    background: white;
    border-radius: 0 12px 12px 0;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.history-item.income { border-left-color: var(--brand-secondary); }
.history-item.outcome { border-left-color: #f43f5e; }
.history-item.add { border-left-color: var(--brand-primary); }
.history-item.delete { border-left-color: var(--slate-400); }

/* === MODAL MOBILE === */
#item-modal-content {
    -webkit-overflow-scrolling: touch;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    height: 100vh;
}