:root{
      --erp-bg:#f4f7fb;
      --erp-panel:#ffffff;
      --erp-text:#0f172a;
      --erp-text-soft:rgba(15,23,42,.66);
      --erp-text-faint:rgba(15,23,42,.48);
      --erp-line:rgba(15,23,42,.08);
      --erp-primary:#2563eb;
      --erp-shadow-sm:0 8px 24px rgba(15,23,42,.05);
      --erp-shadow-md:0 16px 40px rgba(15,23,42,.08);
      --erp-shadow-lg:0 24px 60px rgba(15,23,42,.12);
      --erp-sidebar-w:320px;
      --erp-sidebar-mobile:320px;
      --erp-topbar-h:72px;
    }

    *{ box-sizing:border-box; }
    html,body{ min-height:100%; }

    body{
      margin:0;
      background:
        radial-gradient(1200px 520px at 0% 0%, rgba(37,99,235,.07), transparent 60%),
        radial-gradient(900px 420px at 100% 0%, rgba(16,185,129,.05), transparent 52%),
        linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
      color:var(--erp-text);
    }

    body.page-login{
      margin:0;
      padding:0;
      overflow:hidden;
      background:#090f1a;
    }

    a{ text-decoration:none; }

    .login-flash{
      position:fixed;
      top:16px;
      left:50%;
      transform:translateX(-50%);
      width:min(520px, calc(100vw - 24px));
      z-index:3000;
      pointer-events:none;
    }
    .login-flash .alert{
      pointer-events:auto;
      box-shadow:0 12px 40px rgba(0,0,0,.35);
      border:1px solid rgba(255,255,255,.12);
      background-color:rgba(255,255,255,.10);
      backdrop-filter:blur(10px);
    }

    .erp-app{
      min-height:100vh;
      overflow:visible !important;
    }

    .erp-sidebar{
      position:fixed;
      left:0;
      top:0;
      bottom:0;
      width:var(--erp-sidebar-w);
      z-index:1020;
      display:flex;
      flex-direction:column;
      background:
        radial-gradient(420px 220px at 0% 0%, rgba(59,130,246,.22), transparent 60%),
        radial-gradient(300px 180px at 100% 0%, rgba(16,185,129,.16), transparent 55%),
        linear-gradient(180deg, #0f172a 0%, #111c36 35%, #12203f 70%, #13294b 100%);
      color:#fff;
      box-shadow:24px 0 60px rgba(15,23,42,.16);
      overflow:hidden;
    }

    .erp-brand{
      position:relative;
      padding:18px 16px 14px;
      border-bottom:1px solid rgba(255,255,255,.08);
      z-index:2;
    }

    .erp-brand-badge{
      display:inline-flex;
      align-items:center;
      gap:8px;
      padding:6px 10px;
      border-radius:999px;
      background:rgba(255,255,255,.08);
      border:1px solid rgba(255,255,255,.10);
      color:rgba(255,255,255,.88);
      font-size:12px;
      margin-bottom:10px;
      line-height:1;
    }

    .erp-brand-row{
      display:flex;
      align-items:center;
      gap:12px;
    }

    .erp-mark{
      width:44px;
      height:44px;
      border-radius:14px;
      display:flex;
      align-items:center;
      justify-content:center;
      font-weight:900;
      color:#eef2ff;
      background:linear-gradient(135deg, rgba(37,99,235,.95), rgba(99,102,241,.88));
      box-shadow:0 16px 28px rgba(37,99,235,.24);
      border:1px solid rgba(255,255,255,.24);
      flex:0 0 auto;
      font-size:1rem;
    }

    .erp-brand-title{
      margin:0;
      color:#fff;
      font-size:.96rem;
      line-height:1.2;
      font-weight:900;
      letter-spacing:.01em;
      white-space:nowrap;
    }

    .erp-brand-sub{
      margin-top:4px;
      color:rgba(255,255,255,.62);
      font-size:.78rem;
      line-height:1.45;
    }

    .erp-side-scroll{
      flex:1 1 auto;
      overflow-y:auto;
      overflow-x:hidden;
      padding:14px 12px 18px;
      position:relative;
      z-index:2;
    }

    .erp-side-scroll::-webkit-scrollbar{ width:6px; }
    .erp-side-scroll::-webkit-scrollbar-thumb{
      background:rgba(255,255,255,.12);
      border-radius:999px;
    }

    .erp-home-entry{ margin-bottom:10px; }

    .erp-home-link{
      display:flex;
      align-items:center;
      gap:12px;
      padding:12px 14px;
      border-radius:16px;
      color:rgba(255,255,255,.82);
      border:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.05);
      transition:all .14s ease;
      box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
    }

    .erp-home-link:hover,
    .erp-home-link.active{
      color:#fff;
      background:
        radial-gradient(120% 120% at 0% 0%, rgba(37,99,235,.34), transparent 60%),
        rgba(255,255,255,.09);
      border-color:rgba(255,255,255,.10);
      transform:translateY(-1px);
    }

    .erp-home-icon{
      width:38px;
      height:38px;
      border-radius:12px;
      display:flex;
      align-items:center;
      justify-content:center;
      border:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.06);
      flex:0 0 auto;
      font-size:16px;
    }

    .erp-home-text{
      font-weight:800;
      font-size:14px;
      line-height:1.2;
    }

    .erp-zone-list{
      display:flex;
      flex-direction:column;
      gap:10px;
    }

    .erp-zone{
      position:relative;
    }

    .erp-zone-btn{
      width:100%;
      border:none;
      border-radius:18px;
      padding:12px 14px;
      display:flex;
      align-items:center;
      gap:12px;
      text-align:left;
      color:rgba(255,255,255,.86);
      background:
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.035));
      border:1px solid rgba(255,255,255,.08);
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.04),
        0 10px 24px rgba(0,0,0,.08);
      transition:all .15s ease;
      cursor:pointer;
    }

    .erp-zone:hover .erp-zone-btn,
    .erp-zone.is-active .erp-zone-btn,
    .erp-zone.is-open .erp-zone-btn,
    .erp-zone.is-desktop-open .erp-zone-btn{
      color:#fff;
      background:
        radial-gradient(120% 120% at 0% 0%, rgba(37,99,235,.32), transparent 58%),
        linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
      border-color:rgba(255,255,255,.12);
      transform:translateY(-1px);
    }

    .erp-zone-btn-icon{
      width:42px;
      height:42px;
      border-radius:14px;
      display:flex;
      align-items:center;
      justify-content:center;
      background:rgba(255,255,255,.08);
      border:1px solid rgba(255,255,255,.08);
      font-size:18px;
      flex:0 0 auto;
    }

    .erp-zone-btn-main{
      min-width:0;
      flex:1 1 auto;
    }

    .erp-zone-btn-title{
      display:block;
      font-size:15px;
      font-weight:900;
      line-height:1.2;
      letter-spacing:.01em;
    }

    .erp-zone-btn-desc{
      display:block;
      margin-top:4px;
      font-size:12px;
      color:rgba(255,255,255,.54);
      line-height:1.35;
    }

    .erp-zone-btn-arrow{
      width:30px;
      height:30px;
      border-radius:10px;
      display:flex;
      align-items:center;
      justify-content:center;
      color:rgba(255,255,255,.70);
      background:rgba(255,255,255,.06);
      border:1px solid rgba(255,255,255,.06);
      flex:0 0 auto;
      font-size:14px;
      transition:transform .14s ease;
    }

    .erp-zone-panel-mobile{
      display:none;
    }

    .erp-side-bottom{
      padding:14px 12px 16px;
      border-top:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.02);
      position:relative;
      z-index:2;
    }

    .erp-tenant-card{
      border-radius:16px;
      border:1px solid rgba(255,255,255,.10);
      background:rgba(255,255,255,.06);
      padding:12px;
    }

    .erp-tenant-label{
      color:rgba(255,255,255,.52);
      font-size:12px;
    }

    .erp-tenant-value{
      margin-top:4px;
      color:#fff;
      font-size:14px;
      font-weight:800;
      word-break:break-word;
      line-height:1.45;
    }

    .erp-hover-panel{
      position:fixed;
      left:calc(var(--erp-sidebar-w) - 8px);
      top:120px;
      width:360px;
      padding:14px;
      border-radius:24px;
      background:linear-gradient(180deg, rgba(255,255,255,.985), rgba(255,255,255,.965));
      border:1px solid rgba(15,23,42,.08);
      box-shadow:0 26px 60px rgba(15,23,42,.18);
      opacity:0;
      visibility:hidden;
      transform:translateX(18px) scale(.985);
      transition:opacity .16s ease, transform .16s ease, visibility .16s ease;
      pointer-events:none;
      z-index:1600;
    }

    .erp-hover-panel.show{
      opacity:1;
      visibility:visible;
      transform:translateX(0) scale(1);
      pointer-events:auto;
    }

    .erp-hover-panel::before{
      content:"";
      position:absolute;
      left:-8px;
      top:28px;
      width:16px;
      height:16px;
      transform:rotate(-45deg);
      background:#fff;
      border-top:1px solid rgba(15,23,42,.08);
      border-left:1px solid rgba(15,23,42,.08);
      border-radius:4px 0 0 0;
    }

    .erp-hover-panel-head{
      display:flex;
      align-items:flex-start;
      gap:12px;
      margin-bottom:14px;
      padding-bottom:12px;
      border-bottom:1px solid rgba(15,23,42,.06);
    }

    .erp-hover-panel-icon{
      width:46px;
      height:46px;
      border-radius:15px;
      display:flex;
      align-items:center;
      justify-content:center;
      color:#1d4ed8;
      background:
        radial-gradient(120% 120% at 0% 0%, rgba(37,99,235,.16), transparent 62%),
        rgba(37,99,235,.06);
      border:1px solid rgba(37,99,235,.12);
      flex:0 0 auto;
      font-size:18px;
    }

    .erp-hover-panel-title{
      margin:0;
      font-size:16px;
      line-height:1.2;
      font-weight:900;
      color:var(--erp-text);
    }

    .erp-hover-panel-sub{
      margin-top:4px;
      color:var(--erp-text-faint);
      font-size:12px;
      line-height:1.5;
    }

    .erp-hover-grid{
      display:grid;
      grid-template-columns:repeat(2, minmax(0, 1fr));
      gap:10px;
    }

    .erp-hover-link{
      display:flex;
      align-items:center;
      gap:10px;
      min-height:56px;
      padding:10px 12px;
      border-radius:16px;
      color:rgba(15,23,42,.82);
      background:linear-gradient(180deg, rgba(248,250,252,.95), rgba(255,255,255,1));
      border:1px solid rgba(15,23,42,.07);
      transition:all .14s ease;
      box-shadow:0 8px 18px rgba(15,23,42,.04);
    }

    .erp-hover-link:hover{
      color:#0f172a;
      border-color:rgba(37,99,235,.18);
      background:
        radial-gradient(120% 120% at 0% 0%, rgba(37,99,235,.10), transparent 60%),
        #fff;
      transform:translateY(-1px);
      box-shadow:0 14px 24px rgba(37,99,235,.10);
    }

    .erp-hover-link.active{
      color:#0f172a;
      border-color:rgba(37,99,235,.18);
      background:
        radial-gradient(120% 120% at 0% 0%, rgba(37,99,235,.14), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,1), rgba(246,249,255,1));
      box-shadow:0 16px 28px rgba(37,99,235,.14);
    }

    .erp-hover-link-icon{
      width:36px;
      height:36px;
      flex:0 0 auto;
      display:flex;
      align-items:center;
      justify-content:center;
      border-radius:12px;
      background:rgba(15,23,42,.04);
      border:1px solid rgba(15,23,42,.06);
      font-size:15px;
    }

    .erp-hover-link-text{
      min-width:0;
      font-weight:800;
      font-size:13px;
      line-height:1.25;
    }

    .erp-main{
      margin-left:var(--erp-sidebar-w);
      min-height:100vh;
      overflow:visible !important;
      position:relative;
      z-index:1;
      transform:none !important;
      filter:none !important;
    }

    .erp-topbar{
      position:sticky;
      top:0;
      z-index:1030;
      height:var(--erp-topbar-h);
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      padding:14px 18px;
      background:rgba(255,255,255,.96);
      border-bottom:1px solid rgba(15,23,42,.06);
      backdrop-filter:none !important;
    }

    .erp-topbar-left{
      display:flex;
      align-items:center;
      gap:12px;
      min-width:0;
    }

    .erp-mobile-toggle{
      display:none;
      width:42px;
      height:42px;
      border:none;
      border-radius:12px;
      background:#fff;
      box-shadow:var(--erp-shadow-sm);
      color:var(--erp-text);
      font-size:18px;
      font-weight:900;
    }

    .erp-topbar-title-wrap{ min-width:0; }

    .erp-topbar-title{
      margin:0;
      font-size:18px;
      line-height:1.2;
      font-weight:900;
      color:var(--erp-text);
    }

    .erp-topbar-sub{
      margin-top:4px;
      color:var(--erp-text-faint);
      font-size:12px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .erp-topbar-right{
      display:flex;
      align-items:center;
      gap:10px;
      flex:0 0 auto;
    }

    .erp-top-chip{
      display:flex;
      align-items:center;
      gap:8px;
      padding:8px 12px;
      border-radius:999px;
      border:1px solid var(--erp-line);
      background:rgba(255,255,255,.92);
      box-shadow:var(--erp-shadow-sm);
      color:var(--erp-text-soft);
      font-size:12px;
      font-weight:700;
      white-space:nowrap;
    }

    .erp-top-user{
      display:flex;
      align-items:center;
      gap:10px;
      padding:6px 8px 6px 6px;
      border-radius:999px;
      border:1px solid var(--erp-line);
      background:rgba(255,255,255,.96);
      box-shadow:var(--erp-shadow-sm);
      color:var(--erp-text);
    }

    .erp-avatar{
      width:36px;
      height:36px;
      border-radius:999px;
      display:flex;
      align-items:center;
      justify-content:center;
      font-weight:900;
      color:#0f172a;
      background:
        radial-gradient(120% 120% at 0% 0%, rgba(37,99,235,.18), transparent 55%),
        rgba(15,23,42,.04);
      border:1px solid rgba(15,23,42,.08);
      flex:0 0 auto;
    }

    .erp-user-meta{
      display:flex;
      flex-direction:column;
      line-height:1.15;
    }

    .erp-user-name{
      max-width:140px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
      color:var(--erp-text);
      font-weight:800;
      font-size:.88rem;
    }

    .erp-user-hint{
      margin-top:2px;
      color:var(--erp-text-faint);
      font-size:.74rem;
    }

    .erp-user-menu{
      border-radius:16px;
      border:1px solid rgba(15,23,42,.12);
      box-shadow:var(--erp-shadow-md);
      padding:.45rem;
      z-index:1500;
    }

    .erp-user-menu .dropdown-item{
      border-radius:12px;
      padding:.58rem .78rem;
      font-weight:600;
      color:rgba(15,23,42,.78);
    }

    .erp-user-menu .dropdown-item:hover{
      background:rgba(37,99,235,.08);
    }

    .erp-page-wrap{
      padding:18px;
      overflow:visible !important;
      position:relative;
      z-index:1;
      transform:none !important;
      filter:none !important;
    }

    .erp-page-card{
      border-radius:24px;
      border:1px solid rgba(15,23,42,.06);
      background:#ffffff;
      padding:16px;
      min-height:calc(100vh - var(--erp-topbar-h) - 36px);
      position:relative;
      z-index:1;
      overflow:visible !important;
      transform:none !important;
      filter:none !important;
      backdrop-filter:none !important;
      box-shadow:0 14px 34px rgba(15,23,42,.04);
    }

    .erp-breadcrumb{
      display:flex;
      align-items:center;
      gap:8px;
      flex-wrap:wrap;
      margin-bottom:12px;
      color:var(--erp-text-faint);
      font-size:12px;
      font-weight:700;
    }

    .erp-breadcrumb .dot{ opacity:.55; }

    .erp-mobile-backdrop{
      display:none;
      position:fixed;
      inset:0;
      background:rgba(15,23,42,.38);
      z-index:1015;
    }

    .btn{ border-radius:12px; }
    .form-control,.form-select{ border-radius:12px; }
    .card,.dropdown-menu{ border-radius:16px; }
    .table{ overflow:hidden; }

    .erp-main .dropdown-menu,
    .erp-main .popover,
    .erp-main .tooltip,
    .erp-main .offcanvas,
    .erp-main .menu,
    .erp-main .panel,
    .erp-main .floating-panel{
      z-index:1400;
    }

    .modal-backdrop{ z-index:2000 !important; }
    .modal{ z-index:2010 !important; }
    .modal-dialog{
      position:relative !important;
      z-index:2011 !important;
      pointer-events:auto !important;
    }
    .modal-content{
      position:relative !important;
      z-index:2012 !important;
      pointer-events:auto !important;
      border-radius:16px;
    }
    [role="dialog"]{ z-index:2010 !important; }

    .erp-app,.erp-main,.erp-page-wrap,.erp-page-card{
      overflow:visible !important;
      transform:none !important;
      filter:none !important;
    }

    .dialog,
    .popup,
    .layer,
    .modal-layer,
    .detail-modal,
    .detail-dialog,
    .popup-layer{
      z-index:2010 !important;
    }

    @media (max-width: 1399.98px){
      :root{ --erp-sidebar-w:300px; }
    }

    @media (max-width: 1199.98px){
      :root{ --erp-sidebar-w:280px; }
      .erp-hover-panel{ width:330px; }
      .erp-brand-title{
        font-size:.92rem;
      }
    }

    @media (max-width: 991.98px){
      :root{ --erp-sidebar-w:var(--erp-sidebar-mobile); }

      .erp-sidebar{
        width:var(--erp-sidebar-mobile);
        transform:translateX(-100%);
        transition:transform .18s ease;
        z-index:1045 !important;
      }

      .erp-sidebar.show{ transform:translateX(0); }
      .erp-main{ margin-left:0; }

      .erp-mobile-toggle{
        display:inline-flex;
        align-items:center;
        justify-content:center;
      }

      .erp-mobile-backdrop.show{ display:block; }

      .erp-hover-panel{ display:none !important; }

      .erp-zone-panel-mobile{
        display:none;
        margin-top:10px;
        padding:0;
        border-radius:18px;
        background:transparent;
        border:none;
      }

      .erp-zone.is-open .erp-zone-panel-mobile{ display:block; }
      .erp-zone.is-open .erp-zone-btn-arrow{ transform:rotate(90deg); }

      .erp-zone-panel-mobile .erp-hover-panel-head{
        display:none !important;
      }

      .erp-hover-panel-icon{
        color:#fff;
        background:rgba(255,255,255,.08);
        border-color:rgba(255,255,255,.10);
      }

      .erp-hover-panel-title{ color:#fff; }
      .erp-hover-panel-sub{ color:rgba(255,255,255,.58); }

      .erp-hover-grid{
        grid-template-columns:1fr;
        gap:8px;
      }

      .erp-hover-link{
        background:rgba(255,255,255,.08);
        border-color:rgba(255,255,255,.08);
        color:#fff;
        box-shadow:none;
      }

      .erp-hover-link:hover,
      .erp-hover-link.active{
        background:
          radial-gradient(120% 120% at 0% 0%, rgba(37,99,235,.22), transparent 60%),
          rgba(255,255,255,.10);
        border-color:rgba(255,255,255,.14);
        color:#fff;
        box-shadow:none;
      }

      .erp-hover-link-icon{
        background:rgba(255,255,255,.08);
        border-color:rgba(255,255,255,.08);
      }

      .erp-brand-title{
        white-space:normal;
        font-size:1rem;
      }

      .erp-topbar{ padding:12px 14px; }
      .erp-page-wrap{ padding:12px; }
      .erp-page-card{
        padding:12px;
        border-radius:18px;
        min-height:calc(100vh - var(--erp-topbar-h) - 24px);
      }
      .erp-top-chip.hide-mobile{ display:none; }
      .erp-user-name{ max-width:100px; }
    }

    @media (max-width: 575.98px){
      .erp-topbar-right{ gap:8px; }
      .erp-top-chip{
        padding:7px 10px;
        font-size:11px;
      }
      .erp-topbar-title{ font-size:16px; }
      .erp-topbar-sub{ font-size:11px; }
      .erp-page-wrap{ padding:10px; }
      .erp-user-meta{ display:none; }
      .erp-top-user{ padding-right:6px; }
    }
