:root {
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
    --space-6: 48px;

    --primary: #1867f2;
    --primary-hover: #0f56d3;
    --background: #f4f6fa;
    --surface: #ffffff;
    --border: #d8deea;
    --text-primary: #111827;
    --text-secondary: #5b6474;
    --success: #1f9d63;
    --warning: #cc8b00;
    --danger: #c43838;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --sidebar-width: 272px;
    --topbar-height: 64px;
    --content-max-width: 1300px;
    --font-family: "Inter", "Segoe UI", "Noto Sans", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--background);
    color: var(--text-primary);
    font-family: var(--font-family);
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: var(--space-4);
}

h2 {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 650;
    margin-bottom: var(--space-3);
}

h3 {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    margin-bottom: var(--space-3);
}

body,
input,
button,
textarea,
select {
    font-size: 16px;
    font-weight: 400;
}

p {
    color: var(--text-secondary);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

.app-shell {
    min-height: 100vh;
    background: var(--background);
}

.app-container {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--space-5);
}

.app-container.is-fluid {
    max-width: none;
}

.app-muted {
    color: var(--text-secondary);
}

.app-error-ui {
    color-scheme: light only;
    background: #fff8ed;
    border-top: 1px solid #f1cf9b;
    color: #5c3f1e;
    bottom: 0;
    display: none;
    left: 0;
    padding: var(--space-3) var(--space-4);
    position: fixed;
    width: 100%;
    z-index: 9999;
}

.app-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 10px;
}

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 240px;
    }

    .app-container {
        padding: var(--space-4);
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .app-container {
        padding: var(--space-3);
    }
}
