﻿/* ============================================================
   GOLD ERP - Common Stylesheet
   Color Palette inspired by Smart POS jewellery software
   Primary: Deep Navy #1a2744, Gold Accent #c9a227, 
   Light BG: #f4f6fb, Text: #2c3e50
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
    --primary: #1a2744;
    --primary-light: #243459;
    --primary-dark: #111b33;
    --gold: #c9a227;
    --gold-light: #e8c84a;
    --gold-dark: #a07c10;
    --accent: #2196f3;
    --accent-hover: #1565c0;
    --success: #2e7d32;
    --success-light: #e8f5e9;
    --warning: #f57c00;
    --warning-light: #fff3e0;
    --danger: #c62828;
    --danger-light: #ffebee;
    --info: #0277bd;
    --info-light: #e1f5fe;
    --bg-body: #f0f2f8;
    --bg-card: #ffffff;
    --bg-sidebar: #1a2744;
    --bg-topbar: #1a2744;
    --text-primary: #1e2a3a;
    --text-secondary: #5a6a7e;
    --text-muted: #8fa0b3;
    --text-on-dark: #e8edf5;
    --text-gold: #c9a227;
    --border: #dde3ef;
    --border-light: #edf0f7;
    --shadow-sm: 0 2px 8px rgba(26,39,68,0.08);
    --shadow-md: 0 4px 20px rgba(26,39,68,0.12);
    --shadow-lg: 0 8px 32px rgba(26,39,68,0.16);
    --shadow-gold: 0 4px 16px rgba(201,162,39,0.25);
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --footer-height: 44px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-main: 'Nunito', sans-serif;
    --font-display: 'Playfair Display', serif;
    --transition: all 0.22s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.erp-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- TOP BAR ---- */
.erp-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1050;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

    .erp-topbar .brand {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: var(--sidebar-width);
        text-decoration: none;
    }

    .erp-topbar .brand-icon {
        width: 34px;
        height: 34px;
        background: var(--gold);
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        flex-shrink: 0;
    }

    .erp-topbar .brand-name {
        font-family: var(--font-display);
        font-size: 18px;
        color: #fff;
        line-height: 1;
    }

    .erp-topbar .brand-sub {
        font-size: 10px;
        color: var(--gold);
        letter-spacing: 1.5px;
        text-transform: uppercase;
        font-weight: 700;
    }

    /* Topbar nav tabs - horizontal module links */
    .erp-topbar .topnav {
        display: flex;
        align-items: center;
        gap: 2px;
        margin-left: 12px;
        flex: 1;
        overflow-x: auto;
        scrollbar-width: none;
    }

        .erp-topbar .topnav::-webkit-scrollbar {
            display: none;
        }

        .erp-topbar .topnav .tnav-item {
            position: relative;
        }

        .erp-topbar .topnav .tnav-link {
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            color: #c8d3e8;
            font-size: 12.5px;
            font-weight: 600;
            white-space: nowrap;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            background: none;
            letter-spacing: 0.3px;
        }

            .erp-topbar .topnav .tnav-link:hover,
            .erp-topbar .topnav .tnav-link.active {
                color: #fff;
                background: rgba(255,255,255,0.12);
            }

            .erp-topbar .topnav .tnav-link .tnav-icon {
                font-size: 14px;
                opacity: 0.85;
            }

        /* Dropdown */
        .erp-topbar .topnav .tnav-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            min-width: 190px;
            background: #fff;
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border);
            z-index: 2000;
            padding: 6px 0;
        }

        .erp-topbar .topnav .tnav-item:hover .tnav-dropdown,
        .erp-topbar .topnav .tnav-item:focus-within .tnav-dropdown {
            display: block;
        }

.tnav-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

    .tnav-dropdown a:hover {
        background: var(--bg-body);
        color: var(--primary);
        padding-left: 22px;
    }

.tnav-dropdown .divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* Topbar right */
.erp-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-info-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 6px;
}

    .topbar-info-chip .shop-name {
        font-size: 13px;
        font-weight: 700;
        color: #fff;
    }

    .topbar-info-chip .shop-sub {
        font-size: 10px;
        color: var(--gold);
        font-weight: 600;
    }

.topbar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #c8d3e8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    position: relative;
}

    .topbar-btn:hover {
        background: rgba(255,255,255,0.2);
        color: #fff;
    }

    .topbar-btn .badge-dot {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 8px;
        height: 8px;
        background: var(--gold);
        border-radius: 50%;
        border: 2px solid var(--primary);
    }

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    border: 2px solid rgba(201,162,39,0.4);
    transition: var(--transition);
}

    .topbar-avatar:hover {
        border-color: var(--gold);
    }

.sidebar-toggle {
    background: none;
    border: none;
    color: #c8d3e8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: none;
}

    .sidebar-toggle:hover {
        background: rgba(255,255,255,0.1);
        color: #fff;
    }

/* ---- MAIN BODY ---- */
.erp-body {
    display: flex;
    flex: 1;
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
}

/* ---- SIDEBAR ---- */
.erp-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

    .erp-sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .erp-sidebar::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.1);
        border-radius: 4px;
    }

.sidebar-section-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 16px 16px 6px;
}

.sidebar-nav-item {
    padding: 0 10px;
    margin-bottom: 2px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #9eb0cc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .sidebar-nav-link .nav-icon {
        font-size: 16px;
        flex-shrink: 0;
        width: 20px;
        text-align: center;
    }

    .sidebar-nav-link .nav-label {
        flex: 1;
    }

    .sidebar-nav-link .nav-arrow {
        font-size: 11px;
        transition: transform 0.2s;
    }

    .sidebar-nav-link .nav-badge {
        font-size: 10px;
        font-weight: 700;
        background: var(--gold);
        color: var(--primary-dark);
        padding: 1px 6px;
        border-radius: 20px;
        min-width: 18px;
        text-align: center;
    }

    .sidebar-nav-link:hover {
        background: rgba(255,255,255,0.08);
        color: #fff;
    }

    .sidebar-nav-link.active {
        background: var(--gold);
        color: var(--primary-dark);
    }

        .sidebar-nav-link.active .nav-icon {
            color: var(--primary-dark);
        }

/* Submenu */
.sidebar-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    padding-left: 10px;
}

    .sidebar-submenu.open {
        max-height: 500px;
    }

    .sidebar-submenu a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 12px 7px 28px;
        color: #7a90aa;
        font-size: 12.5px;
        font-weight: 500;
        border-radius: var(--radius-sm);
        transition: var(--transition);
        margin-bottom: 1px;
    }

        .sidebar-submenu a:hover {
            color: #fff;
            background: rgba(255,255,255,0.06);
        }

        .sidebar-submenu a.active {
            color: var(--gold);
        }

        .sidebar-submenu a::before {
            content: '';
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: currentColor;
            flex-shrink: 0;
            opacity: 0.6;
        }

/* Gold price ticker in sidebar bottom */
.sidebar-ticker {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

    .sidebar-ticker .ticker-card {
        background: rgba(201,162,39,0.1);
        border: 1px solid rgba(201,162,39,0.2);
        border-radius: var(--radius-md);
        padding: 10px 12px;
    }

    .sidebar-ticker .ticker-title {
        font-size: 10px;
        color: var(--gold);
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        margin-bottom: 6px;
    }

    .sidebar-ticker .ticker-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 4px;
    }

    .sidebar-ticker .ticker-label {
        font-size: 11px;
        color: #7a90aa;
        font-weight: 600;
    }

    .sidebar-ticker .ticker-val {
        font-size: 12px;
        color: #fff;
        font-weight: 700;
    }

/* ---- MAIN CONTENT ---- */
.erp-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--topbar-height));
}

.erp-page-area {
    flex: 1;
    padding: 24px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-primary);
    font-weight: 700;
}

.page-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

    .page-breadcrumb span {
        color: var(--gold);
        font-weight: 600;
    }

/* ---- FOOTER ---- */
.erp-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.5);
    font-size: 11.5px;
    padding: 0 20px;
    height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: wrap;
}

    .erp-footer .footer-brand {
        color: var(--gold);
        font-weight: 700;
    }

    .erp-footer .footer-ticker {
        display: flex;
        gap: 16px;
        align-items: center;
        background: rgba(201,162,39,0.1);
        border: 1px solid rgba(201,162,39,0.2);
        border-radius: 20px;
        padding: 3px 12px;
    }

    .erp-footer .ticker-item {
        font-size: 11px;
        font-weight: 600;
        color: #c8d3e8;
    }

        .erp-footer .ticker-item strong {
            color: var(--gold);
        }

/* ============================================================
   CARDS & STATS
   ============================================================ */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--card-accent, var(--gold));
    }

    .stat-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

    .stat-card .sc-icon {
        width: 44px;
        height: 44px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        margin-bottom: 12px;
        background: var(--card-icon-bg, rgba(201,162,39,0.12));
        color: var(--card-accent, var(--gold));
    }

    .stat-card .sc-value {
        font-size: 26px;
        font-weight: 800;
        color: var(--text-primary);
        line-height: 1;
        margin-bottom: 4px;
    }

    .stat-card .sc-label {
        font-size: 12px;
        color: var(--text-secondary);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .stat-card .sc-change {
        font-size: 11px;
        font-weight: 700;
        margin-top: 8px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

.sc-change.up {
    color: var(--success);
}

.sc-change.down {
    color: var(--danger);
}

/* Data card */
.data-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

    .data-card .card-head {
        padding: 14px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-light);
    }

    .data-card .card-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
    }

    .data-card .card-body {
        padding: 20px;
    }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-erp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-main);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

    .btn-erp:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

/* Variants */
.btn-primary {
    background: var(--primary);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--primary-light);
        box-shadow: var(--shadow-md);
    }

.btn-gold {
    background: var(--gold);
    color: var(--primary-dark);
}

    .btn-gold:hover {
        background: var(--gold-light);
        box-shadow: var(--shadow-gold);
    }

.btn-success {
    background: var(--success);
    color: #fff;
}

    .btn-success:hover {
        background: #1b5e20;
    }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

    .btn-danger:hover {
        background: #b71c1c;
    }

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

    .btn-outline-primary:hover {
        background: var(--primary);
        color: #fff;
    }

.btn-outline-gold {
    background: transparent;
    color: var(--gold-dark);
    border: 1.5px solid var(--gold);
}

    .btn-outline-gold:hover {
        background: var(--gold);
        color: var(--primary-dark);
    }

/* Sizes */
.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 11px 26px;
    font-size: 15px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .form-label .required {
        color: var(--danger);
        margin-left: 2px;
    }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-family: var(--font-main);
    color: var(--text-primary);
    background: #fff;
    transition: var(--transition);
    outline: none;
}

    .form-control:focus {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px rgba(201,162,39,0.12);
    }

    .form-control::placeholder {
        color: var(--text-muted);
    }

    .form-control:disabled {
        background: var(--bg-body);
        cursor: not-allowed;
    }

/* Input with icon */
.input-group {
    position: relative;
    display: flex;
}

    .input-group .input-icon {
        position: absolute;
        left: 11px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        font-size: 15px;
        z-index: 1;
    }

    .input-group .form-control {
        padding-left: 36px;
    }

    .input-group .input-addon {
        display: flex;
        align-items: center;
        padding: 0 12px;
        background: var(--bg-body);
        border: 1.5px solid var(--border);
        border-left: none;
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 600;
    }

    .input-group .form-control:first-child:not(:last-child) {
        border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235a6a7e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

    .form-check input[type="checkbox"],
    .form-check input[type="radio"] {
        width: 16px;
        height: 16px;
        accent-color: var(--gold);
        cursor: pointer;
    }

.form-check-label {
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

/* Validation */
.is-invalid .form-control,
.form-control.is-invalid {
    border-color: var(--danger) !important;
}

.invalid-feedback {
    font-size: 11px;
    color: var(--danger);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   TABLES
   ============================================================ */
.erp-table-wrap {
    overflow-x: auto;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .erp-table thead th {
        background: var(--primary);
        color: #fff;
        padding: 10px 14px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.7px;
        text-align: left;
        white-space: nowrap;
    }

        .erp-table thead th:first-child {
            border-radius: var(--radius-sm) 0 0 0;
        }

        .erp-table thead th:last-child {
            border-radius: 0 var(--radius-sm) 0 0;
        }

    .erp-table tbody tr {
        border-bottom: 1px solid var(--border-light);
        transition: background 0.15s;
    }

        .erp-table tbody tr:hover {
            background: #f7f9ff;
        }

        .erp-table tbody tr:last-child {
            border-bottom: none;
        }

    .erp-table tbody td {
        padding: 10px 14px;
        color: var(--text-primary);
        vertical-align: middle;
    }

    .erp-table tfoot td {
        padding: 10px 14px;
        font-weight: 700;
        background: var(--bg-body);
        color: var(--text-primary);
        border-top: 2px solid var(--border);
    }

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-gold {
    background: rgba(201,162,39,0.15);
    color: var(--gold-dark);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-primary {
    background: rgba(26,39,68,0.1);
    color: var(--primary);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border-left: 4px solid;
    margin-bottom: 16px;
}

.alert-success {
    background: var(--success-light);
    border-color: var(--success);
    color: #1b5e20;
}

.alert-danger {
    background: var(--danger-light);
    border-color: var(--danger);
    color: #b71c1c;
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning);
    color: #e65100;
}

.alert-info {
    background: var(--info-light);
    border-color: var(--info);
    color: #01579b;
}

.alert-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    font-size: 18px;
    line-height: 1;
    background: none;
    border: none;
}

/* ============================================================
   MODALS
   ============================================================ */
.erp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,15,30,0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

    .erp-modal-overlay.show {
        opacity: 1;
        pointer-events: all;
    }

.erp-modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.erp-modal-overlay.show .erp-modal {
    transform: scale(1) translateY(0);
}

.erp-modal-lg {
    max-width: 780px;
}

.erp-modal-xl {
    max-width: 1000px;
}

.modal-head {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--bg-body);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

    .modal-close:hover {
        background: var(--danger-light);
        color: var(--danger);
    }

.modal-body {
    padding: 20px 22px;
}

.modal-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   TABS
   ============================================================ */
.erp-tabs {
    border-bottom: 2px solid var(--border-light);
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

    .erp-tabs::-webkit-scrollbar {
        display: none;
    }

.erp-tab {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: var(--transition);
    border-top: none;
    border-left: none;
    border-right: none;
    background: none;
    font-family: var(--font-main);
}

    .erp-tab:hover {
        color: var(--primary);
    }

    .erp-tab.active {
        color: var(--primary);
        border-bottom-color: var(--gold);
    }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.erp-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px;
    min-width: 280px;
    border-left: 4px solid var(--gold);
    animation: toastIn 0.3s ease;
}

    .erp-toast.toast-success {
        border-color: var(--success);
    }

    .erp-toast.toast-danger {
        border-color: var(--danger);
    }

    .erp-toast.toast-info {
        border-color: var(--info);
    }

    .erp-toast .toast-icon {
        font-size: 18px;
    }

    .erp-toast .toast-msg {
        flex: 1;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-primary);
    }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-gold {
    color: var(--gold);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-muted);
}

.text-primary-erp {
    color: var(--primary);
}

.fw-bold {
    font-weight: 700;
}

.fw-medium {
    font-weight: 600;
}

.fs-sm {
    font-size: 12px;
}

.fs-xs {
    font-size: 11px;
}

.divider {
    height: 1px;
    background: var(--border-light);
    margin: 16px 0;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 220px;
    }

    .erp-topbar .topnav {
        display: none;
    }

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 767px) {
    :root {
        --topbar-height: 54px;
    }

    .erp-sidebar {
        transform: translateX(-100%);
    }

        .erp-sidebar.open {
            transform: translateX(0);
        }

    .erp-content {
        margin-left: 0 !important;
    }

    .erp-topbar .brand-sub {
        display: none;
    }

    .erp-topbar .topbar-info-chip {
        display: none;
    }

    .erp-page-area {
        padding: 14px;
    }

    .erp-footer {
        flex-direction: column;
        height: auto;
        padding: 8px 16px;
        gap: 4px;
        text-align: center;
    }

        .erp-footer .footer-ticker {
            display: none;
        }
}

@media (max-width: 480px) {
    .erp-topbar {
        padding: 0 10px;
    }

        .erp-topbar .brand-name {
            font-size: 15px;
        }

    .stat-card .sc-value {
        font-size: 20px;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1039;
}

    .sidebar-overlay.show {
        display: block;
    }
