/**
 * MOSAROMA ERP - Modern Admin Design System
 *
 * Modernisiertes Design im mrweb2-Stil
 * Nur CSS/Design - keine Funktionsänderungen
 */

:root {
    /* ===== PRIMARY COLORS (Mosaroma Orange) ===== */
    --primary-50: #fef9f3;
    --primary-100: #fef3e6;
    --primary-200: #fde6cc;
    --primary-300: #fbd4a0;
    --primary-400: #f8b765;
    --primary-500: #f47f24;
    --primary-600: #d9650b;
    --primary-700: #b8530a;
    --primary-800: #954410;
    --primary-900: #7a3a06;

    /* ===== NEUTRAL COLORS (Warm Greys) ===== */
    --neutral-50: #fafaf9;
    --neutral-100: #f5f5f4;
    --neutral-200: #e7e5e4;
    --neutral-300: #d6d3d1;
    --neutral-400: #a8a29e;
    --neutral-500: #78716c;
    --neutral-600: #57534e;
    --neutral-700: #44403c;
    --neutral-800: #292524;
    --neutral-900: #1c1917;

    /* ===== STATS ACCENT COLORS ===== */
    /* Blue - für Seiten/Dokumente */
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;

    /* Green - für Kollektionen/Gruppen */
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-600: #16a34a;
    --green-700: #15803d;

    /* Purple - für Produkte */
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-600: #9333ea;
    --purple-700: #7e22ce;

    /* Amber - für Medien */
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-600: #d97706;
    --amber-700: #b45309;

    /* Red - für Anfragen/Alerts */
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-600: #dc2626;
    --red-700: #b91c1c;

    /* ===== SEMANTIC COLORS (light theme defaults) ===== */
    --bg-page: var(--neutral-50);
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;

    --text-primary: var(--neutral-900);
    --text-secondary: var(--neutral-600);
    --text-tertiary: var(--neutral-400);

    --border-subtle: var(--neutral-200);
    --border-strong: var(--neutral-300);

    /* ===== SPACING SYSTEM (8px base grid) ===== */
    --spacing-xs: 0.25rem;    /* 4px */
    --spacing-sm: 0.5rem;     /* 8px */
    --spacing-md: 1rem;       /* 16px */
    --spacing-lg: 1.5rem;     /* 24px */
    --spacing-xl: 2rem;       /* 32px */
    --spacing-2xl: 3rem;      /* 48px */
    --spacing-3xl: 4rem;      /* 64px */

    /* ===== BORDER RADIUS ===== */
    --radius-sm: 0.375rem;    /* 6px */
    --radius-md: 0.5rem;      /* 8px */
    --radius-lg: 0.75rem;     /* 12px */
    --radius-xl: 1rem;        /* 16px */
    --radius-2xl: 1.5rem;     /* 24px */
    --radius-full: 9999px;

    /* ===== SHADOWS ===== */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* ===== TRANSITIONS ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== DARK THEME =====
   Kein automatisches prefers-color-scheme: Das ERP nutzt aktuell durchgehend
   das helle Theme (theme-light.css) und Tailwind-Klassen mit festen Farben.
   Ein automatischer Dark-Mode würde nur die CSS-Variablen umschalten und
   unlesbare Mischzustände erzeugen. Aktivierung später explizit via
   data-theme="dark" sobald alle Seiten Dark-Mode-fähig sind. */
:root[data-theme="dark"] {
    --bg-page: #18181b;
    --bg-card: #27272a;
    --bg-card-hover: #3f3f46;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;

    --border-subtle: #3f3f46;
    --border-strong: #52525b;

    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
}

:root[data-theme="light"] {
    --bg-page: var(--neutral-50);
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;

    --text-primary: var(--neutral-900);
    --text-secondary: var(--neutral-600);
    --text-tertiary: var(--neutral-400);

    --border-subtle: var(--neutral-200);
    --border-strong: var(--neutral-300);

    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ===== LEGACY-OVERRIDE KORREKTUR =====
   theme-light.css erzwingt .text-white -> dunkel (!important) für alte,
   nicht modernisierte Seiten. In der Sidebar und auf farbigen Buttons
   muss text-white aber wirklich weiß sein. Gezielt statt global, damit
   Alt-Seiten lesbar bleiben. */
#sidebar .text-white,
.bg-mosaroma.text-white,
.bg-mosaromaDark.text-white,
.bg-primary-500.text-white,
.bg-primary-600.text-white,
.bg-red-600.text-white,
.bg-red-700.text-white {
    color: #ffffff !important;
}

/* ===== BASE TYPOGRAPHY ===== */
body {
    font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em; /* Tighter tracking for modern look */
}

/* ===== UTILITY CLASSES ===== */

/* Cards */
.card-modern {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.card-modern:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-strong);
}

/* Stats Card specific */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-strong);
}

/* Action Card specific */
.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-decoration: none;
    display: block;
    transition: all var(--transition-base);
}

.action-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn-primary {
    background: var(--primary-500);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-600);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--neutral-100);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-ghost:hover {
    background: var(--neutral-100);
    color: var(--text-primary);
}

/* Form Inputs */
.input-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

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

/* Table Modern */
.table-modern {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.table-modern thead {
    background: var(--neutral-50);
    border-bottom: 1px solid var(--border-subtle);
}

.table-modern th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.table-modern tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.table-modern tbody tr:hover {
    background: var(--neutral-50);
}

.table-modern tbody tr:last-child {
    border-bottom: none;
}

.table-modern td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Sidebar Modern */
.sidebar-modern {
    width: 16rem;
    background: var(--bg-card);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.nav-item-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-item-modern:hover {
    background: var(--neutral-100);
    color: var(--text-primary);
}

.nav-item-modern.active {
    background: var(--primary-50);
    color: var(--primary-600);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .sidebar-modern {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
}

/* Animation Utilities */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slideInUp var(--transition-slow) ease-out;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
