/* =====================================================================
   TEXTILE PROCESSING ERP - GLOBAL THEME
   White background / Green gradient / Light grey cards / Corporate look
   ===================================================================== */

:root {
    --erp-primary: #0F9D58;
    --erp-primary-light: #34A853;
    --erp-primary-dark: #1B5E20;
    --erp-white: #FFFFFF;
    --erp-grey-light: #F5F7F6;
    --erp-grey-card: #F8F9FA;
    --erp-grey-border: #E6E9E8;
    --erp-green-tint: #EAF7EF;
    --erp-text-dark: #1E2A26;
    --erp-text-muted: #6B7B76;
    --erp-radius: 14px;
    --erp-radius-sm: 8px;
    --erp-shadow: 0 4px 18px rgba(15, 157, 88, 0.08);
    --erp-shadow-hover: 0 8px 28px rgba(15, 157, 88, 0.16);
    --erp-font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--erp-font);
    background: var(--erp-grey-light);
    color: var(--erp-text-dark);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ---------------- Layout Shell ---------------- */
.erp-shell { display: flex; min-height: 100vh; }

.erp-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--erp-primary-dark) 0%, var(--erp-primary) 100%);
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    transition: transform 0.25s ease;
    z-index: 1000;
}
.erp-sidebar .brand {
    padding: 22px 20px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.3px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.erp-sidebar nav { padding: 12px 10px; }
.erp-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    margin-bottom: 3px;
    border-radius: var(--erp-radius-sm);
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.15s ease, transform 0.1s ease;
}
.erp-nav-item i { width: 18px; text-align: center; opacity: 0.9; }
.erp-nav-item:hover { background: rgba(255,255,255,0.12); color: #fff; }
.erp-nav-item.active { background: rgba(255,255,255,0.2); color: #fff; font-weight: 600; }

.erp-main { margin-left: 260px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------------- Topbar ---------------- */
.erp-topbar {
    position: sticky; top: 0; z-index: 900;
    background: var(--erp-white);
    border-bottom: 1px solid var(--erp-grey-border);
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.erp-topbar .search-box {
    background: var(--erp-grey-card);
    border: 1px solid var(--erp-grey-border);
    border-radius: 999px;
    padding: 8px 16px;
    display: flex; align-items: center; gap: 8px;
    width: 320px; max-width: 40vw;
}
.erp-topbar .search-box input { border: 0; background: transparent; outline: none; width: 100%; font-size: 0.88rem; }
.erp-topbar-actions { display: flex; align-items: center; gap: 18px; }
.erp-icon-btn {
    position: relative; background: none; border: none; cursor: pointer;
    color: var(--erp-text-muted); font-size: 1.05rem; padding: 6px;
    border-radius: 50%; transition: background 0.15s;
}
.erp-icon-btn:hover { background: var(--erp-green-tint); color: var(--erp-primary); }
.erp-badge-dot {
    position: absolute; top: 2px; right: 2px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #EA4335; border: 2px solid #fff;
}

/* ---------------- Content / Cards ---------------- */
.erp-content { padding: 24px; flex: 1; }
.erp-card {
    background: var(--erp-white);
    border: 1px solid var(--erp-grey-border);
    border-radius: var(--erp-radius);
    box-shadow: var(--erp-shadow);
    padding: 20px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.erp-card:hover { box-shadow: var(--erp-shadow-hover); }
.erp-card-flat { background: var(--erp-grey-card); border: 1px solid var(--erp-grey-border); border-radius: var(--erp-radius); }

.erp-kpi-value { font-size: 1.9rem; font-weight: 700; color: var(--erp-text-dark); }
.erp-kpi-label { font-size: 0.82rem; color: var(--erp-text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.erp-kpi-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--erp-green-tint); color: var(--erp-primary); font-size: 1.15rem;
}

/* ---------------- Buttons ---------------- */
.btn-erp-primary {
    background: linear-gradient(135deg, var(--erp-primary-light), var(--erp-primary-dark));
    color: #fff; border: none; border-radius: var(--erp-radius-sm);
    padding: 10px 20px; font-weight: 600; font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(15,157,88,0.25);
    position: relative; overflow: hidden; cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-erp-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,157,88,0.32); color: #fff; }
.btn-erp-outline {
    background: #fff; border: 1.5px solid var(--erp-primary); color: var(--erp-primary);
    border-radius: var(--erp-radius-sm); padding: 9px 18px; font-weight: 600; font-size: 0.9rem;
}
.btn-erp-outline:hover { background: var(--erp-green-tint); color: var(--erp-primary-dark); }

/* Ripple effect */
.btn-erp-primary .ripple {
    position: absolute; border-radius: 50%; transform: scale(0);
    animation: erp-ripple 0.6s linear; background: rgba(255,255,255,0.5);
}
@keyframes erp-ripple { to { transform: scale(3); opacity: 0; } }

/* ---------------- Tables ---------------- */
.erp-table thead th {
    background: var(--erp-grey-card); color: var(--erp-text-muted);
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px;
    border-bottom: 1px solid var(--erp-grey-border); padding: 12px 14px;
}
.erp-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--erp-grey-border); font-size: 0.88rem; }
.erp-table tbody tr:hover { background: var(--erp-green-tint); }

/* ---------------- Forms ---------------- */
.erp-form-label { font-size: 0.82rem; font-weight: 600; color: var(--erp-text-dark); margin-bottom: 6px; display: block; }
.erp-form-control {
    border: 1px solid var(--erp-grey-border); border-radius: var(--erp-radius-sm);
    padding: 10px 14px; font-size: 0.9rem; width: 100%; background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.erp-form-control:focus { outline: none; border-color: var(--erp-primary); box-shadow: 0 0 0 3px rgba(15,157,88,0.15); }

/* ---------------- Responsive ---------------- */
@media (max-width: 991px) {
    .erp-sidebar { transform: translateX(-100%); }
    .erp-sidebar.open { transform: translateX(0); }
    .erp-main { margin-left: 0; }
    .erp-topbar .search-box { display: none; }
}

/* ---------------- Login Page ---------------- */
.erp-login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 20% 20%, var(--erp-green-tint), var(--erp-grey-light) 60%);
    padding: 20px;
}
.erp-login-card {
    background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(15,157,88,0.15);
    width: 100%; max-width: 380px; padding: 40px 32px;
}
.erp-login-logo {
    width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--erp-primary-light), var(--erp-primary-dark));
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem;
}
