:root {
    --bg: #f4efe7;
    --surface: rgba(255, 252, 247, 0.84);
    --surface-strong: #fffaf2;
    --line: rgba(67, 61, 47, 0.12);
    --text: #231f18;
    --muted: #6b6256;
    --accent: #0f766e;
    --accent-soft: #d7f3ee;
    --gold: #c68429;
    --warning: #d97706;
    --danger: #b45309;
    --shadow: 0 18px 45px rgba(74, 56, 24, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --font-ui: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.15), transparent 28%),
        radial-gradient(circle at bottom right, rgba(198, 132, 41, 0.16), transparent 32%),
        linear-gradient(145deg, #f6f1e8 0%, #efe7da 48%, #f9f5ee 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.erp-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.erp-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 22px;
    border-right: 1px solid var(--line);
    background: rgba(35, 31, 24, 0.94);
    color: #f7f2e9;
    backdrop-filter: blur(18px);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand-badge {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 18px;
    font-weight: 700;
    color: #12332f;
    background: linear-gradient(135deg, #f3d18d, #8fe5d7);
}

.brand-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.brand-subtitle {
    margin: 4px 0 0;
    color: rgba(247, 242, 233, 0.68);
    font-size: 0.9rem;
}

.nav-list {
    display: grid;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    color: rgba(247, 242, 233, 0.82);
    transition: all 0.25s ease;
}

.nav-item:hover,
.nav-item.is-active {
    color: #fffaf2;
    border-color: rgba(143, 229, 215, 0.24);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.36), rgba(198, 132, 41, 0.18));
}

.nav-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.sidebar-card {
    margin-top: 28px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-card-label,
.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-card h3,
.panel h3,
.feature-card h3,
.topbar h1,
.hero-panel h2,
.module-hero h2 {
    margin: 0;
}

.sidebar-card p,
.page-subtitle,
.hero-summary,
.feature-card p,
.panel-head span,
.stack-item p,
.timeline-item p,
.todo-item p,
.mini-stat span,
.kpi-card p {
    margin: 0;
    color: var(--muted);
}

.erp-main {
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.topbar-actions {
    display: flex;
    gap: 12px;
}

.primary-btn,
.ghost-btn {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
}

.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #14532d);
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.ghost-btn {
    color: var(--text);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid var(--line);
}

.page-content {
    display: grid;
    gap: 22px;
}

.hero-panel,
.module-hero,
.panel,
.kpi-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.hero-panel,
.module-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    padding: 28px;
}

.chip-row,
.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.chip,
.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--accent-soft);
    color: #0f5f57;
    font-size: 0.86rem;
}

.hero-metrics {
    display: grid;
    gap: 14px;
}

.mini-stat,
.feature-card,
.todo-item {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.mini-stat strong,
.kpi-card strong,
.todo-item strong {
    display: block;
    margin: 8px 0 6px;
    font-size: 1.65rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.kpi-card {
    padding: 22px;
}

.trend {
    display: inline-flex;
    margin-top: 12px;
    font-size: 0.88rem;
    font-weight: 600;
}

.trend-positive {
    color: var(--accent);
}

.trend-warning {
    color: var(--warning);
}

.trend-neutral {
    color: #4b5563;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.content-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    padding: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.todo-grid,
.stack-list,
.timeline {
    display: grid;
    gap: 12px;
}

.stack-item,
.timeline-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.stack-item:last-child,
.timeline-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.timeline-item span {
    min-width: 52px;
    font-weight: 700;
    color: var(--accent);
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.module-inventory {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.6));
}

.module-orders {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.12), rgba(255, 255, 255, 0.6));
}

.module-purchase {
    background: linear-gradient(135deg, rgba(198, 132, 41, 0.14), rgba(255, 255, 255, 0.6));
}

.module-finance {
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.12), rgba(255, 255, 255, 0.6));
}

.module-customers {
    background: linear-gradient(135deg, rgba(190, 24, 93, 0.1), rgba(255, 255, 255, 0.6));
}

.module-emag {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.13), rgba(255, 255, 255, 0.64));
}

.notice {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.notice strong {
    display: block;
    margin-bottom: 6px;
}

.notice-success {
    border-color: rgba(15, 118, 110, 0.22);
    background: rgba(215, 243, 238, 0.8);
}

.notice-error {
    border-color: rgba(217, 119, 6, 0.22);
    background: rgba(255, 244, 229, 0.88);
}

.sync-form {
    display: grid;
    gap: 14px;
}

.sync-form label {
    display: grid;
    gap: 8px;
}

.sync-form span {
    font-weight: 600;
}

.sync-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.78);
    font: inherit;
}

.sync-form button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-tip {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.product-cell {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 260px;
}

.product-cell img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
}

.product-cell strong {
    display: block;
}

.product-cell p {
    margin: 4px 0 0;
}

@media (max-width: 1180px) {
    .kpi-grid,
    .content-grid,
    .content-grid-wide,
    .hero-panel,
    .module-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .erp-shell {
        grid-template-columns: 1fr;
    }

    .erp-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 20;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .erp-sidebar.is-open {
        transform: translateX(0);
    }

    .erp-main {
        padding: 20px;
    }

    .topbar {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .erp-main {
        padding: 16px;
    }

    .hero-panel,
    .module-hero,
    .panel,
    .kpi-card {
        padding: 18px;
        border-radius: 22px;
    }

    .topbar-actions {
        width: 100%;
    }

    .primary-btn,
    .ghost-btn {
        flex: 1;
        text-align: center;
    }
}
