:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-hover: rgba(51, 65, 85, 0.5);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-accent: #38bdf8;

    --border-color: rgba(148, 163, 184, 0.1);
    --primary-color: #0ea5e9;
    --success-color: #22c55e;
    --danger-color: #ef4444;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

/* Layout */
#app {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    width: 100%;
    height: 100vh;
    gap: 0;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.stats-container {
    display: flex;
    gap: 2rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Navigation */
.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* View System */
.view-section {
    flex: 1;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.view-section.hidden {
    display: none;
}

/* Inventory & Lists */
.product-list {
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding-right: 0.5rem;
}

/* Two-Panel Layout */
.items-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.sizes-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.item-selector-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.item-selector-card:hover {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.05);
    transform: translateX(4px);
}

.item-selector-card.selected {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.15);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
}

.product-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.05);
}

.product-card.low-stock {
    border-color: var(--danger-color);
}

.product-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.product-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.product-price {
    color: var(--text-accent);
    font-weight: 700;
}

.product-details {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: var(--text-secondary);
    gap: 0.25rem;
}

/* Management Table */
#mgmt-inventory-list tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

#mgmt-inventory-list td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Sales (Right) */
#sales-section {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    height: 100%;
}

#cart-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-total-section {
    margin-top: auto;
    flex-shrink: 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* UI Elements */
.btn {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    background: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.5);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.btn-icon:hover {
    color: white;
}

.input-group {
    margin-bottom: 1rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    /* JS toggles this */
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Login View Specifics */
#view-login {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#view-login.hidden {
    display: none !important;
}