/* =========================================================
   SUNLINE MARKET ERP
   GLOBAL DESIGN SYSTEM
   ========================================================= */

/* ---------------------------------------------------------
   1. ROOT VARIABLES
   --------------------------------------------------------- */

:root {
    /* Brand */
    --brand-primary: #0f766e;
    --brand-primary-dark: #115e59;
    --brand-primary-light: #ccfbf1;

    /* Background */
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-surface-soft: #f8fafc;

    /* Text */
    --color-text: #172033;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    --color-text-inverse: #ffffff;

    /* Border */
    --color-border: #e2e8f0;
    --color-border-light: #eef2f7;

    /* Status */
    --color-success: #16a34a;
    --color-success-bg: #dcfce7;

    --color-warning: #d97706;
    --color-warning-bg: #fef3c7;

    --color-danger: #dc2626;
    --color-danger-bg: #fee2e2;

    --color-info: #2563eb;
    --color-info-bg: #dbeafe;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 76px;

    /* Navbar */
    --navbar-height: 72px;

    /* Radius */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);

    /* Typography */
    --font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 220ms ease;
    --transition-slow: 320ms ease;

    /* Z-index */
    --z-sidebar: 1000;
    --z-navbar: 900;
    --z-overlay: 1100;
    --z-dropdown: 1200;
    --z-modal: 2000;
    --z-toast: 3000;
}


/* ---------------------------------------------------------
   2. RESET
   --------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;

    background: var(--color-bg);
    color: var(--color-text);

    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}


/* ---------------------------------------------------------
   3. APP SHELL
   --------------------------------------------------------- */

#app {
    display: flex;
    min-height: 100vh;
    width: 100%;
}


/* ---------------------------------------------------------
   4. MAIN CONTENT AREA
   --------------------------------------------------------- */

.app-main {
    flex: 1;
    min-width: 0;
    min-height: 100vh;

    margin-left: var(--sidebar-width);

    padding-top: var(--navbar-height);

    transition:
        margin-left var(--transition-normal);
}


/* ---------------------------------------------------------
   5. PAGE CONTAINER
   --------------------------------------------------------- */

.page-container {
    width: 100%;
    max-width: 1600px;

    margin: 0 auto;
    padding: 28px 32px 32px;
}


/* ---------------------------------------------------------
   6. PAGE HEADER
   --------------------------------------------------------- */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 28px;
}

.page-header__content {
    min-width: 0;
}

.page-header__title {
    margin: 0;

    color: var(--color-text);

    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.page-header__description {
    margin: 7px 0 0;

    color: var(--color-text-secondary);

    font-size: 14px;
    line-height: 1.6;
}

.page-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}


/* ---------------------------------------------------------
   7. CONTENT SECTIONS
   --------------------------------------------------------- */

.content-section {
    margin-bottom: 28px;
}

.content-section:last-child {
    margin-bottom: 0;
}


/* ---------------------------------------------------------
   8. UTILITY CLASSES
   --------------------------------------------------------- */

.text-muted {
    color: var(--color-text-muted);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

.text-danger {
    color: var(--color-danger);
}

.text-info {
    color: var(--color-info);
}

.fw-medium {
    font-weight: 500;
}

.fw-semibold {
    font-weight: 600;
}

.fw-bold {
    font-weight: 700;
}

.hidden {
    display: none !important;
}

.no-scroll {
    overflow: hidden;
}


/* ---------------------------------------------------------
   9. SCROLLBAR
   --------------------------------------------------------- */

* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

*::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* ---------------------------------------------------------
   10. SELECTION
   --------------------------------------------------------- */

::selection {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
}


/* ---------------------------------------------------------
   11. FOCUS
   --------------------------------------------------------- */

:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.20);
    outline-offset: 2px;
}


/* ---------------------------------------------------------
   12. PAGE LOADING
   --------------------------------------------------------- */

body.is-loading {
    cursor: progress;
}

body.is-loading * {
    pointer-events: none;
}


/* ---------------------------------------------------------
   13. REDUCED MOTION
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}