:root {
    --bg-color: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-hover: rgba(51, 65, 85, 0.8);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #10b981;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Typography & Utils */
.text-sub { color: var(--text-sub); }
.text-red { color: var(--danger); }
.text-sm { font-size: 0.875rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.w-100 { width: 100%; }
.flex-col { display: flex; flex-direction: column; align-items: flex-start; }
.flex-1 { flex: 1; }

/* Glassmorphism Classes */
.glass-header {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.glass-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon {
    font-size: 1.5rem;
    color: var(--primary);
}
.header-left h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    gap: 10px;
}

.content-area {
    padding: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-icon {
    background: transparent;
    color: var(--text-main);
    font-size: 1.25rem;
    padding: 8px;
    border-radius: 50%;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Inputs & Search */
.search-bar {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}
.search-bar i {
    color: var(--text-sub);
    margin-right: 10px;
}
.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 1rem;
}
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-sub);
    font-size: 0.9rem;
}
.input-group input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-main);
    outline: none;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.input-group input:focus {
    border-color: var(--primary);
}

/* Lists and Cards */
.grid-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 768px) {
    .grid-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.wala-card {
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.wala-card:hover {
    transform: translateY(-2px);
    background: var(--surface-hover);
}
.wala-card h3 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

/* Inventory List */
.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inv-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}
.inv-info h3 {
    margin-bottom: 4px;
    font-size: 1.1rem;
}
.inv-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-sub);
}
.inv-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.inv-actions {
    display: flex;
    gap: 10px;
}
.btn-in { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.btn-in:hover { background: rgba(16, 185, 129, 0.3); }
.btn-out { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.btn-out:hover { background: rgba(239, 68, 68, 0.3); }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fab-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
    cursor: pointer;
    z-index: 900;
    border: none;
    transition: transform 0.2s, background 0.2s;
}
.fab-btn:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}
.fab-btn i {
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-sub);
}
.modal-close:hover {
    color: var(--text-main);
}

/* Tabs for IN/OUT modal */
.tabs {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 1rem;
}
.tab-btn {
    flex: 1;
    background: transparent;
    color: var(--text-sub);
    padding: 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}
.tab-btn.active {
    background: var(--surface);
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
#tab-in.active { color: #34d399; }
#tab-out.active { color: #f87171; }

/* Designs List in Modal */
.designs-list {
    max-height: 60vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.design-item {
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}
.design-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
.design-img-wrap {
    width: 100%;
    height: 180px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
}
.design-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.magnify-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border: none;
}
.magnify-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.edit-mode-element {
    display: none;
}
.edit-mode-active .edit-mode-element {
    display: flex;
}
.edit-mode-active .normal-view-element {
    display: none;
}

/* Loader */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* History list */
.history-list {
    margin-top: 1rem;
}
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid var(--border);
    transition: transform 0.2s;
}
.history-item:hover {
    transform: translateX(4px);
    background: rgba(255,255,255,0.12);
}
.history-item.in { border-left-color: #34d399; }
.history-item.out { border-left-color: #ef4444; }
.history-meta {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 4px;
}
.history-val {
    font-weight: 600;
    font-size: 1.2rem;
}
.history-val.in { color: #34d399; }
.history-val.out { color: #ef4444; }
