@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: rgba(17, 24, 39, 0.7);
    --bg-tertiary: rgba(31, 41, 55, 0.5);
    
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Harmonious HSL colors */
    --primary: hsl(250, 85%, 65%);
    --primary-hover: hsl(250, 85%, 58%);
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --success: hsl(150, 80%, 40%);
    --success-glow: rgba(16, 185, 129, 0.15);
    
    --warning: hsl(35, 90%, 55%);
    --warning-glow: rgba(245, 158, 11, 0.15);
    
    --danger: hsl(350, 85%, 55%);
    --danger-glow: rgba(239, 68, 68, 0.15);

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225, 39%, 12%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(260, 40%, 15%, 0.3) 0, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #ffffff, #a5b4fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-badge {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Stats Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.8;
}

.stat-card.stat-low-stock::before {
    background: var(--warning);
}

.stat-card.stat-sales::before {
    background: var(--success);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 20px -10px rgba(0, 0, 0, 0.5);
}

.stat-info h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.stat-icon {
    font-size: 1.75rem;
    opacity: 0.8;
}

/* Layout Columns */
.portal-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .portal-layout {
        grid-template-columns: 1fr;
    }
}

/* Cards & Sections */
.card-section {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

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

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Controls & Inputs */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(55, 65, 81, 0.7);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: hsl(150, 80%, 35%);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

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

.badge-success {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: var(--warning-glow);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: var(--danger-glow);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Forms & Modals */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Modal styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-hover);
    border-radius: 1.25rem;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ffffff;
}

/* Notifications */
.notifications-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.notification {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 450px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateX(120%);
    animation: slideIn 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: bold;
    margin-left: 1rem;
}

/* Helpers */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted-small { color: var(--text-muted); font-size: 0.8rem; }
.bold { font-weight: 600; }
.clickable { cursor: pointer; }

/* Micro-animations */
.fade-in-row {
    animation: fadeInRow 0.5s ease-out forwards;
}

@keyframes fadeInRow {
    from {
        opacity: 0;
        background-color: rgba(99, 102, 241, 0.15);
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        background-color: transparent;
        transform: translateY(0);
    }
}

.highlight-update {
    animation: pulseUpdate 1s ease-out;
}

@keyframes pulseUpdate {
    0% {
        background-color: rgba(16, 185, 129, 0.25);
    }
    100% {
        background-color: transparent;
    }
}

/* Actions Flex default */
.actions-flex {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Responsive Styles for Mobile */
@media (max-width: 640px) {
    .container {
        padding: 1rem 0.75rem;
    }
    
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        text-align: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }
    
    .logo-container {
        justify-content: center;
    }
    
    h1 {
        font-size: 1.85rem;
    }
    
    /* Stats grid into 2 columns to fit comfortably on screen */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
        border-radius: 0.75rem;
    }
    
    .stat-card::before {
        width: 3px;
    }
    
    .stat-value {
        font-size: 1.35rem;
    }
    
    .stat-icon {
        display: none; /* Hide large icons to save horizontal space */
    }
    
    /* Layout stacks on mobile */
    .portal-layout {
        gap: 1.25rem;
    }
    
    .card-section {
        padding: 1rem;
        border-radius: 0.75rem;
        margin-bottom: 1.25rem;
    }
    
    .section-title {
        font-size: 1.15rem;
    }
    
    /* Search block fills space */
    .search-filter-bar {
        margin-bottom: 1rem;
    }
    
    /* Compact Table */
    td, th {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .product-description {
        display: none; /* Hide item details in lists to prevent table wrap */
    }
    
    .actions-flex {
        flex-direction: column;
        gap: 0.35rem;
        align-items: stretch;
    }
    
    .btn-sm {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
        width: 100%;
    }
    
    /* Form fields and Modals */
    .modal-content {
        padding: 1.25rem;
        border-radius: 0.75rem;
        width: 95%;
    }
    
    .modal-title {
        font-size: 1.15rem;
    }
    
    .notifications-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    
    .notification {
        min-width: auto;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

