/* ===== SA Apparel Solutions ERP — Global Design System ===== */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(31, 41, 55, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-input: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --border-focus: #4f8cff;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #4f8cff;
    --accent-blue-glow: rgba(79, 140, 255, 0.3);
    --accent-emerald: #00d68f;
    --accent-emerald-glow: rgba(0, 214, 143, 0.3);
    --accent-coral: #ff6b6b;
    --accent-coral-glow: rgba(255, 107, 107, 0.3);
    --accent-amber: #fbbf24;
    --accent-amber-glow: rgba(251, 191, 36, 0.3);
    --accent-purple: #a78bfa;
    --accent-purple-glow: rgba(167, 139, 250, 0.3);
    --accent-cyan: #22d3ee;

    --gradient-blue: linear-gradient(135deg, #4f8cff, #3b6fd4);
    --gradient-emerald: linear-gradient(135deg, #00d68f, #00b876);
    --gradient-coral: linear-gradient(135deg, #ff6b6b, #e05252);
    --gradient-amber: linear-gradient(135deg, #fbbf24, #d4991c);
    --gradient-purple: linear-gradient(135deg, #a78bfa, #8b6fd4);
    --gradient-dark: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 50%, #0a0e1a 100%);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(79, 140, 255, 0.15);
    --shadow-glow-emerald: 0 0 20px rgba(0, 214, 143, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --header-height: 64px;

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: #6ba3ff; }

img { max-width: 100%; display: block; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Typography ===== */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 500; }

/* ===== Utility Classes ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--accent-emerald); }
.text-danger { color: var(--accent-coral); }
.text-warning { color: var(--accent-amber); }
.text-blue { color: var(--accent-blue); }
.text-purple { color: var(--accent-purple); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.hidden { display: none !important; }

/* ===== Glass Card ===== */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.glass-card.no-hover:hover {
    transform: none;
    box-shadow: none;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--gradient-blue);
    color: white;
    box-shadow: 0 2px 12px rgba(79, 140, 255, 0.3);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(79, 140, 255, 0.5); }

.btn-success {
    background: var(--gradient-emerald);
    color: white;
    box-shadow: 0 2px 12px rgba(0, 214, 143, 0.3);
}
.btn-success:hover { box-shadow: 0 4px 20px rgba(0, 214, 143, 0.5); }

.btn-danger {
    background: var(--gradient-coral);
    color: white;
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.3);
}
.btn-danger:hover { box-shadow: 0 4px 20px rgba(255, 107, 107, 0.5); }

.btn-warning {
    background: var(--gradient-amber);
    color: #1a1a2e;
    box-shadow: 0 2px 12px rgba(251, 191, 36, 0.3);
}

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

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon {
    width: 36px; height: 36px; padding: 0;
    border-radius: var(--radius-sm);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.03em;
}
.badge-blue { background: rgba(79,140,255,0.15); color: var(--accent-blue); }
.badge-emerald { background: rgba(0,214,143,0.15); color: var(--accent-emerald); }
.badge-coral { background: rgba(255,107,107,0.15); color: var(--accent-coral); }
.badge-amber { background: rgba(251,191,36,0.15); color: var(--accent-amber); }
.badge-purple { background: rgba(167,139,250,0.15); color: var(--accent-purple); }
.badge-gray { background: rgba(148,163,184,0.15); color: var(--text-secondary); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: var(--space-md);
}
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}
.modal-body { padding: var(--space-lg); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-fade { animation: fadeIn 0.4s ease; }
.animate-slide { animation: slideUp 0.4s ease; }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: slideInLeft 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}
.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-error { border-left: 4px solid var(--accent-coral); }
.toast-warning { border-left: 4px solid var(--accent-amber); }
.toast-info { border-left: 4px solid var(--accent-blue); }
.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    html { font-size: 13px; }
    .toast-container { top: var(--space-sm); right: var(--space-sm); left: var(--space-sm); }
    .toast { min-width: auto; }
}
