/* app.css - Clean version with layout variables only */

:root {
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Border Radius */
    --radius: 0.375rem;
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 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);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Font Family */
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

button[title="Toggle Theme"] .mud-icon-root {
    color: white !important;
}

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

html, body {
    height: 100%;
    font-family: var(--font-sans), sans-serif;
}

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth transitions for theme changes — scoped to elements that actually
   recolor with the theme so we don't pay layout/paint cost on every node. */
body,
.theme-aware,
.theme-aware * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Container utilities */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Pill buttons - work with any theme */
.btn-modern {
    border-radius: var(--radius-full) !important;
    padding: var(--space-3) var(--space-8) !important;
    font-weight: 700;
    font-size: var(--text-sm);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-modern:hover {
    transform: translateY(-2px);
}

.mud-button-root {
    border-radius: var(--radius-full) !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-4);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-3);
    }
}

/* Phase 8 ERP modules */
.phase8-page {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: var(--space-6);
    box-sizing: border-box;
    overflow-x: hidden;
}

.phase8-header,
.phase8-chip-row,
.phase8-filter-panel {
    max-width: 100%;
}

.phase8-chip-row {
    flex-wrap: wrap;
}

.phase8-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--radius-md);
}

.phase8-table {
    min-width: 980px;
}

.phase8-table--suppliers { min-width: 1180px; }
.phase8-table--offers { min-width: 1220px; }
.phase8-table--policies { min-width: 1320px; }
.phase8-table--suggestions { min-width: 1880px; }
.phase8-table--runs { min-width: 1120px; }
.phase8-table--run-lines { min-width: 1540px; }
.phase8-table--po-lines { min-width: 1040px; }

.phase8-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.phase8-nowrap,
.phase8-chip-nowrap {
    white-space: nowrap;
}

.phase8-truncate {
    display: inline-block;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.phase8-generated-source {
    min-width: 18rem;
}

.phase8-generated-source .mud-typography {
    line-height: 1.25;
}

.phase8-filter-numeric {
    max-width: 12rem;
}

@media (max-width: 768px) {
    .phase8-page {
        padding: var(--space-4);
    }

    .phase8-header {
        gap: var(--space-3);
    }

    .phase8-truncate {
        max-width: 12rem;
    }
}
